Vector encoding provider AzureOpenAI
is not supported in genai.vector.encode
.
Error message below encountered:
ClientError: {code: Neo.ClientError.Procedure.ProcedureCallFailed} {message: Failed to invoke function `genai.vector.encode`: Caused by: java.lang.RuntimeException: Vector encoding provider not supported: AzureOpenAI}
when calling genai.vector.encode
:
# Call on VScode where kg is an instance of my Neo4jGraph`
kg.query("""
MATCH (chunk:Chunk)
WHERE chunk.textEmbedding IS NULL
WITH chunk, genai.vector.encode(
chunk.text,
"AzureOpenAI",
{
token: $openAiApiKey,
resources: $resource,
deployment: $deployment
}
) AS vector
CALL db.create.setNodeVectorProperty(chunk, "textEmbedding", vector)
""",
params={"openAiApiKey":OPENAI_API_KEY, "resource":RESOURCE, "deployment":DEPLOYMENT})
# Call on Neo4j Desktop App
MATCH (chunk:Chunk)
WHERE chunk.textEmbedding IS NULL
WITH chunk, genai.vector.encode(
chunk.text,
"AzureOpenAI",
{
token: xxxxx,
resources: xxxxx
deployment: "embedding"
}
) AS vector
CALL db.create.setNodeVectorProperty(chunk, "textEmbedding", vector)
– Neo4j version: 5.18.1
– Edition: enterprise
– Operating system: MacOS Sonoma 14.1
– API/Driver: both VSCode and Neo4j desktop App
I have checked the version of my Neo4j and Apoc and met the requirements for both. My database on VScode has been successfully connected and the rest of the queries work as normal, e.g. `MATCH (n) RETURN n` on Desktop App, `print(kg.schema)` on VScode. The initialisation on VScode is done by calling method provided by langchain:
from langchain_community.graphs import Neo4jGraph
kg = Neo4jGraph(url=NEO4J_URI, username=NEO4J_USERNAME, password=NEO4J_PASSWORD, database=NEO4J_DATABASE )
Could anyone please help me solve this provider issue?
gorilla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.