mbchang / data-driven-characters

Generate chatbots from a corpus
https://mbchang-data-driven-characters-app-273bzg.streamlit.app/
MIT License
123 stars 18 forks source link

ValidationError #3

Closed yuuuuuuuuri closed 1 year ago

yuuuuuuuuri commented 1 year ago

Sorry for asking such a silly question.

I followed the steps listed and executed the following code.

python -m streamlit run chat.py -- --corpus data/everything_everywhere_all_at_once.txt --character_name Evelyn --chatbot_type retrieval --retrieval_docs summarized --interface streamlit

Then I get the following error and cannot execute it.

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)

Can someone please help me with a solution??

mbchang commented 1 year ago

It looks like the environment variable OPENAI_API_KEY is not set. If you run

export OPENAI_API_KEY=<your_openai_api_key>

and then run the command does it work?

You can find your api key here: https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key.

mbchang commented 1 year ago

Closing this issue. Please reopen if this doesn't fix the issue.