Closed bishi3000 closed 10 months ago
The issue is that no OPENAI_API_KEY
environment variable is defined. You are probably setting the API key directly in the openai python package. LLM providers are detected by chainlit though specific environment variables.
Thanks @willydouhard that fixed the issue.
I was setting my openai key in the code but not as an environment variable.
export OPENAI_API_KEY='<my api key>'
fixed it
I have a similar problem, how to set the environment variables which chainlit though specific ??
If I set the .env file(include the OPENAI_API_KEY and OPENAI_API_BASE), there is no this problem.
But I want to use it with the config, should I set the user_env = [] in chainlit config file ?
what is the format with user_env ? Is there a example?
User env is useful to require one OPENAI_API_KEY per user. You should use it if you want your user to pay their openai consumption individually.
If you just want to setup a global OPENAI_API_KEY for all of your users, just add it in a .env
file.
Path: /examples/openai-sql
I tried running this example and it seems that the Prompt Playground doesn't work.
I get the following error when clicking on the "Inspect in prompt playground" icon.
"Prompt Playground error: No LLM provider available"