Skip to content

Vector encoding provider AzureOpenAI is not supported under genai.vector.encode #13459

Closed
@pangyyen

Description

@pangyyen

Vector encoding provider AzureOpenAI is not supported in genai.vector.encode.

Error message 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:

# 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)

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
)
  • Neo4j version: 5.18.1
  • Edition: enterprise
  • Operating system: MacOS Sonoma 14.1
  • API/Driver: both VSCode and Neo4j desktop App

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions