Error when compile Resoure with vectorize

I try to add to support ai in Ash framework. Follow guide from document I add Embedding model like:

defmodule TryNewAThing.OpenAIEmbeddingModel do
  use AshAi.EmbeddingModel

  @impl true
  def dimensions(_opts), do: 3072
...
end

When compile Resource with vectorize that rise an error:

== Compilation error in file lib/try_a_new_thing/my_doamin/resources/my_resource.ex ==
** (RuntimeError) Exception in transformer AshAi.Transformers.Vectorize on TryNewAThing.MyDomain.MyResource:

function TryNewAThing.OpenAiEmbeddingModel.dimensions/1 is undefined (module TryNewAThing.OpenAiEmbeddingModel is not available)
    TryNewAThing.OpenAiEmbeddingModel.dimensions([])
    (ash_ai 0.3.0) /Users/a/repo/deps/spark/lib/spark/dsl/builder.ex:136: AshAi.Transformers.Vectorize.vectorize_attribute/2

I confused about this error, Module is existed but compiler still raise error.

Any suggestions?

Sound like compiler has an issue with cache. After change name now I can compile successful.

1 Like