as per the lesson 5 I am trying to make search call using genai.vector.encode as per below code, but in my case I don’t have the “OpenAiKey” inestade I am using “AzureOpenAiKey” is there any changes required to make it runable.
kg.query(“”"
MATCH (chunk:Chunk) WHERE chunk.textEmbedding IS NULL
WITH chunk, genai.vector.encode(
chunk.text,
“OpenAI”,
{
token: $openAiApiKey,
endpoint: $openAiEndpoint
}) AS vector
CALL db.create.setNodeVectorProperty(chunk, “textEmbedding”, vector)
“”",
params={“openAiApiKey”:OPENAI_API_KEY, “openAiEndpoint”: OPENAI_ENDPOINT})
with this code i am getting error:
message: Failed to invoke function genai.vector.encode: Caused by: com.neo4j.genai.util.GenAIProcedureException: Not authorized to make API request; check your credentials.
Can you share the screenshot of the Message you are getting, did you check into the utils file?
The reason probably it is not working because the authentication for Azure openai API key would be solely from openai, so if you have metadata access to the codes you are working, you can probably look for changing the api key in utils file. if utils file is not available then you need to get an openai api key for the api keys to be authorised.
Hi @Deepti_Prasad , Thanks for your reply.
Actually I am executing the code from my Jupyter Notebook,
And also I verifyed that the AzureOpenAIkey is correct. But here the main difference is while calling Azure OpenAI the EndPoint URL is different as it must include Deployment Name and API Version so may be my EndPoint Is not correctlly formed, I have used like below
“https://{AzureResourceName}.openai.azure.com/openai/deployments/{MyDeploymentName}” Also I am not sure if i cam pass API version too with this code.
This seems neo client don’t authorise to use your own openai api keys.
I also came across a thread in the same course category where you probably need to address the Neo environment rather than changing the api key. You can check once
Hi @Deepti_Prasad, I also ran beloew query within my DB and can see there are no proc named “genai.vector.encode”, I already copied the jar file neo4j-genai-plugin-5.20.0.jar from product folder to pluging folder, do you have any idea from where I can install the missing procedures?
The client error could also be related to Coursera platform as we encountering some issues with external links.
I am tagging L.T so he is notified of this issue and can give his input, but as per the error image, I can see because you don’t have access to all the metadata, you are running into issue to run it locally.
@Mubsi Please have a look here. Another client error report but here the learner is running the codes locally in his Jupyter notebook.
It is very hard to provide assistance when something is not part of the course material, given that you are running things locally. There could be a number of things wrong here. I’d start first by using Open AI Key to see the issue is with Azure Open AI Key authentication.
I encourage you to find the solution to this on your own and share it with the community!
Hi @Mubsi , Thanks for reply.
As already communicated in previous chat with @Deepti_Prasad That I tried to find the Function on my DB by running the query(See Attached Image) within my DB and can see there are no proc named “genai.vector.encode”,
From Availabe info on internet, I already copied the jar file neo4j-genai-plugin-5.20.0.jar from product folder to pluging folder to enable genai proc, but issue not resolved, do you have any idea from where I can install the missing genai procedures?
Few peoples are suggesting that only “enterprise edition” of neo4j is having function genai.vector.encode, if its true how can I Install enterprise edition of neo4j.
so issue is with neo4j Database, Can you help me here,
check if your version and the assignment codes version match
having access to an enterprise version cannot be just by copying jar file, it should be more than that, the other link mentions the same issue where copying didn’t resolve the issue.
Thank you for your suggestions. I’ve already tried various permutations and combinations available online.
The core issue is that the procedure “genai.vector.encode” is not available in my Neo4j database. Until this procedure is installed or made available in my database, the issue will remain unresolved.
I suppose because the codes use OpenAI api key and not Azure OpenAI api key, you might be encountering this issue. They surely do use same language model. The one provided directly by OpenAI is the OpenAI API, while the one provided by Microsoft is Microsoft Azure OpenAI.
Hi Rohan,
The issue is not resolved yet, may be its required enterprise edition to work properly.
But at the same time i have found one workaround and its working fine for me, i have use my Azure OpenAi model of GPT turbo 3.5 to to create embedding inestad of “genai.vector.encode” method of neo4j database, and saved them back to neo4j database. For that you have to change the code a bit and exact code provided in course will not work.
By using your own model you may be able to create complete RAG.