Open arcturien opened 1 year ago
in cmd. $Env:OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxx"
Thanks a lot,
I'll test this tomorrow !!!
Oops, I got this error, any other option?
Error: Got unexpected extra argument ($Env:OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxx)
Thanks in advance.
Got it !!!
In the following article I can see that the key can be set in sys var (Windows). https://korben.info/chrome-gpt-controle-session-chrome-auto-gpt-langchain.html
in cmd. $Env:OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxx"
:OPENAI_API_KEY=: command not found
Create and Modify Environment Variables on Windows : https://docs.oracle.com/en/database/oracle/machine-learning/oml4r/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html#GUID-DD6F9982-60D5-48F6-8270-A27EC53807D0
I use Ubuntu Server 22
You can ask ChatGPT :
To add an environment variable on Ubuntu Server 22, you can follow these steps:
Open a terminal on your Ubuntu Server.
Run the following command to open the .bashrc
file in a text editor:
nano ~/.bashrc
In the text editor, scroll to the end of the file and add the following line:
export OPENAI_API_KEY="your_api_key_here"
Replace "your_api_key_here"
with your actual OpenAI API key.
Press Ctrl+O to save the file, and then press Enter to confirm the filename.
Press Ctrl+X to exit the text editor.
At this point, the OPENAI_API_KEY
environment variable is added to your .bashrc
file. However, to make it effective in the current terminal session, you need to run the following command:
source ~/.bashrc
Now, the OPENAI_API_KEY
environment variable is available for the current session. You can access it in your scripts or use it directly in the terminal.
If you want the environment variable to be available globally for all users and across all sessions, you can add it to the /etc/environment
file instead of the .bashrc
file. However, modifying the global environment variables may require administrative privileges.
Remember to keep your API key secure and avoid sharing it publicly or committing it to version control repositories.
It seems like the .env file I've copy-pasted from AutoGpt is not working.
Questions : 1 - Where is the template for the .env file ? 2 - How to pass the openai_api_key while running ChromeGPT ?
Thanks in advance.