In this course, in the first lesson, ‘Semantic Search’, we are using OpenAI Key. As I understand from code, it is just to get the last few string characters to be assigned as Index. That is the only purpose. Please clarify if it is correct? Instead, can’t we have our assigned index? Appreciate clarification
Normally you would use the OPENAI key to get access to chatgpt!
one cannot say that is the only purpose of openai api key to get assigned index as while building application, the vector database used are structured and unstructured data, with their vector embeddings.
With that being said if you can create your own vector database (which is not easy task but possible task) you would require to get all the factors like memory, money and time. I am sure once you do, even you would create your api keys access
That I I understand. My question is specific to the chapter ’ Semantic Serach
’ in the short course 'Building Applications with Vector Databases
". I see it is used in the method create_dlai_index_name
in ‘DLAIUtils.py
’ file only to extract its last few characters and assign to index name for the database being created in Pinecone. If this task requires only a string as index name, why OpenAI key is required and only its last 35 characters [-36:]
In such a case, instead of using that method create_dlai_index_name
at all, can I straightaway assign my own index name, for example ‘my_index
’ to INDEX_NAME
variable? What is the need for OpenAPI key when we are not making any OpenAI API call?
You can use different api keys provided you can make changes in the metadata file relative to the api keys you are using from.
Here deep learning.ai used openai api keys for vector database access, so you would require either your own openai api keys to run the codes locally or get a totally new api keys from a different portal, then make changes, and then try out ( chances are you might require more changes than just api keys changes as metadata comes with their own dependencies.
Regards
DP
You have your own vector database? then you can try out, but if you are using same codes from assignment then probably you need to make more changes than just changing the index_name variable!!?
No. Not necessary. I just tried. I did not use that method - ‘create_dlai_index_name’ at all. Instead I just assigned my name ‘Srinivas’ to the INDEX_NAME variable. It worked perfectly. No need for OpenAI key and that method at all.
it might work for the codes you shared but go further and let me know if you get any different output or error
None… See all snapshots untill the last cell output
So I appreciate if someone can clarify what is the need for OpenAI key at all in this lesson. Thank you.
you are using pinecone api key
Of course. Pinecone key is required.
any api keys is giving authentication or access to their data
while you created your own index_name using the same utils.create dlai, you can open the utils file and see if that has an open ai api keys, to confirm or clear your doubt.
I did not use utils.create_dlai as you can see in my screenshot. I commented out the line and assigned the value to the variable directly. There might be OpenAI key in your course environment which will be fetched if we use the util.create_dlai. What I am asking is what is the need for the OpenAI key, what is it doing? As per the DLAIUtils.py, there is no APi call made, other than getting the key from your course environment and extracting a partial string out of it for creating index name.
By the way, kindly note students cannot see the OpenAI key even if they open the DLAIUtils.py file…It is supposed to be a secret stored in your course environment. So when I open the file I won’t see it.
Did you try File ==>Open option?? It doesn’t have utils.py file?
You are right but you are using pinecone utils file according to the screenshot
Please see cell numbered.10. of my screen shot Anyhow, never mind. I just finished lesson.2RAG. Here indeed we make two different OpenAI calls and certainly OpenAI key is required. But still we don’t need the method create_dlai_index_name
to create INDEX_NAME. This method is sort of redundant. Thanks for your patience.
I did try File ==>Open option. After going through the code therein only, my initial query of this post started. Never mind. leave it. Thanks a lot.