mirror of
https://github.com/langchain-ai/web-explorer.git
synced 2026-07-16 10:14:25 -04:00
error reading API key #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @NickCassab on GitHub (Jul 27, 2023).
i tried running this streamlit app but I keep running into a validation error related to finding my openAI API key:
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_keyas a named parameter. (type=value_error)i'm hoping this is just user error, and someone may be able to help me out? thank you
@jeremyarbid commented on GitHub (Jul 27, 2023):
Do you have your api keys in the environment variable?
@NickCassab commented on GitHub (Jul 27, 2023):
yes, i've tried setting my api keys as the environment variable using python, i've tried using a secrets.toml file, and i've tried setting the variables in the script directly. neither method seems to work. Where in the script are the API keys being set and sent to the streamlet app?
@shashankdeshpande commented on GitHub (Jul 27, 2023):
You can configure those as environment variables in script.
For example -
@jeremyarbid commented on GitHub (Jul 28, 2023):
You have a paid OpenAI api, or have quota to use? Are you running the command "streamlit run web_explorer.py" from command terminal? I set my api keys in the secret.toml and it's working for me...
@NickCassab commented on GitHub (Jul 28, 2023):
thank you everyone, i got it working using environment variables, with a .env file