no function clause matching in Pgvector.new/1
This is what I'm doing:
With this
case Req.post(url, json: body) do
{:ok, %{status: 200, body: %{"embeddings" => embeddings}}} ->
binary_embeddings =
embeddings
|> Enum.map(fn %{"values" => values} ->
# Create Pgvector from the float values and convert to binary
values
|> Pgvector.new()
|> Pgvector.to_binary()
end)
{:ok, binary_embeddings}case Req.post(url, json: body) do
{:ok, %{status: 200, body: %{"embeddings" => embeddings}}} ->
binary_embeddings =
embeddings
|> Enum.map(fn %{"values" => values} ->
# Create Pgvector from the float values and convert to binary
values
|> Pgvector.new()
|> Pgvector.to_binary()
end)
{:ok, binary_embeddings}With this
vectorize do
attributes description: :description_vector
embedding_model CoffeeViewer.EmbeddingModels.Gemini
strategy :after_action
endvectorize do
attributes description: :description_vector
embedding_model CoffeeViewer.EmbeddingModels.Gemini
strategy :after_action
end