Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pangyyen opened this issue May 20, 2024 · 1 comment
Assignees

Comments

@pangyyen
Copy link

pangyyen commented May 20, 2024

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
@pangyyen pangyyen added the bug label May 20, 2024
@pangyyen pangyyen changed the title 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} Vector encoding provider AzureOpenAI is not supported under genai.vector.encode May 20, 2024
@parnmatt
Copy link
Contributor

parnmatt commented May 21, 2024

Hey @pangyyen that really is odd.
I've just pulled 5.18.1 directly from the source we provide, and installed the GenAI plugin by moving from products to plugins.

When running the genai.vector.encode function with dummy values for 'AzureOpenAI' (as I currently don't have an Azure deployment running), I am getting parameter validation issues on those dummy values that could only be returned to me if the Azure OpenAI provider was correctly detected. So for me, it seems to be working.

As silly as it sounds could you triple-check check you are sending the request to a cluster member that is running the Neo4j 5.18.1 enterprise binary, and that the version of the GenAI plugin running within those members are also 5.18.1.
The JAR should be plugins/neo4j-genai-plugin-5.18.1.jar by default.
Please check all cluster members, just in case the one that is getting the request is running an older binary version.

@parnmatt parnmatt self-assigned this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants