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

Prompt KeyError after running #11

Open
13516513760 opened this issue Apr 2, 2024 · 1 comment
Open

Prompt KeyError after running #11

13516513760 opened this issue Apr 2, 2024 · 1 comment

Comments

@13516513760
Copy link

I filled in my API KEY in app. py and started it, but it prompted KEYError. Xxxxxxxxxx is my confidential API KEY

KeyError:'xxxxxxxxx'
File "C:\Users\99548\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
File "E:\groq\conversational-chatbot-groq-main\app.py", line 70, in <module>
    main()
File "E:\groq\conversational-chatbot-groq-main\app.py", line 18, in main
    groq_api_key = os.environ['org_01htfdrvx4et585nnqtsq1vp9p']
                   ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
@zenitogr
Copy link

zenitogr commented Jun 5, 2024

you dont fill there the API key, if you want to fill it there you should do directly:

groq_api_key = '<your api key>'

you put your key normally in an environment variable GROQ_API_KEY
add you get it:

groq_api_key = os.environ['GROQ_API_KEY']

the os.environ['myenvvariable'] gets the value of environmental variable myenvvariable

myenvvariable is the name of the variable and the value is returned

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

No branches or pull requests

2 participants