Git Product home page Git Product logo

Comments (4)

willydouhard avatar willydouhard commented on August 12, 2024

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.

from docs.

bishi3000 avatar bishi3000 commented on August 12, 2024

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

from docs.

wangpengfei2048 avatar wangpengfei2048 commented on August 12, 2024

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?

from docs.

willydouhard avatar willydouhard commented on August 12, 2024

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.

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.