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

Did not find openai_api_key, #14

Open
5odead opened this issue May 26, 2023 · 1 comment
Open

Did not find openai_api_key, #14

5odead opened this issue May 26, 2023 · 1 comment

Comments

@5odead
Copy link

5odead commented May 26, 2023

Im running this on Windows 10
I added the API KEY in the .env file but i keep getting this error
ValidationError: 1 validation error for OpenAIEmbeddings __root__ Did not find openai_api_key, please add an environment variable OPENAI_API_KEYwhich contains it, or passopenai_api_key as a named parameter. (type=value_error) Traceback: File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.__dict__) File "C:\Users\DELL\Desktop\Projects\langchain-ask-pdf-main\app.py", line 55, in <module> main() File "C:\Users\DELL\Desktop\Projects\langchain-ask-pdf-main\app.py", line 37, in main embeddings = OpenAIEmbeddings() ^^^^^^^^^^^^^^^^^^ File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__

@ravindra-encoresky
Copy link

Im running this on Windows 10
I added the API KEY in the .env file but i keep getting this error
ValidationError: 1 validation error for OpenAIEmbeddings __root__ Did not find openai_api_key, please add an environment variable OPENAI_API_KEYwhich contains it, or passopenai_api_key as a named parameter. (type=value_error) Traceback: File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.__dict__) File "C:\Users\DELL\Desktop\Projects\langchain-ask-pdf-main\app.py", line 55, in <module> main() File "C:\Users\DELL\Desktop\Projects\langchain-ask-pdf-main\app.py", line 37, in main embeddings = OpenAIEmbeddings() ^^^^^^^^^^^^^^^^^^ File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__

rename your .env.example to .env and place your open AI key in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants