Hi, I am a complete novice in coding. tried replicating the steps and got errors. Following is the log-
Traceback (most recent call last):
File "C:\Users\Ravi Kumar\Desktop\New folder\langchain-rag-tutorial-main\langchain-rag-tutorial-in-rag-tutorial-main\query_data.py", line 29, in main
embedding_function = OpenAIEmbeddings()
^^^^^^^^^^^^^^^^^^
File "C:\Users\Ravi Kumar\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pydantic\v1\main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for OpenAIEmbeddings
root
Did not find openai_api_key, please add an environment variable OPENAI_API_KEY which contains it, or pass openai_api_key as a named parameter. (type=value_error)
Hi, I am a complete novice in coding. tried replicating the steps and got errors. Following is the log-
Traceback (most recent call last): File "C:\Users\Ravi Kumar\Desktop\New folder\langchain-rag-tutorial-main\langchain-rag-tutorial-in-rag-tutorial-main\query_data.py", line 29, in main embedding_function = OpenAIEmbeddings() ^^^^^^^^^^^^^^^^^^ File "C:\Users\Ravi Kumar\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pydantic\v1\main.py", line 341, in init raise validation_error pydantic.v1.error_wrappers.ValidationError: 1 validation error for OpenAIEmbeddings root Did not find openai_api_key, please add an environment variable
OPENAI_API_KEY
which contains it, or passopenai_api_key
as a named parameter. (type=value_error)please help.