OpenInterpreter / open-interpreter

A natural language interface for computers
http://openinterpreter.com/
GNU Affero General Public License v3.0
52.21k stars 4.61k forks source link

Fix tip for API Keys #1338

Open JSee98 opened 2 months ago

JSee98 commented 2 months ago

Describe the bug

The tip to save API key for future use-cases by exporting to bash/zsh configs shows a redundant next line character "\n".

This can confuse non-programmers when they directly copy-paste the command.

Exact response on terminal:

Tip: To save this key for later, run one of the following and then restart your 
terminal.                                                                       
MacOS: echo '\nexport OPENAI_API_KEY=your_api_key' >> ~/.zshrc                  
Linux: echo '\nexport OPENAI_API_KEY=your_api_key' >> ~/.bashrc                 
Windows: setx OPENAI_API_KEY your_api_key

Reproduce

Run interpreter for without OpenAI key set in the environment

Expected behavior

Tip: To save this key for later, run one of the following and then restart your 
terminal.                                                                       
MacOS: echo 'export OPENAI_API_KEY=your_api_key' >> ~/.zshrc                  
Linux: echo 'export OPENAI_API_KEY=your_api_key' >> ~/.bashrc                 
Windows: setx OPENAI_API_KEY your_api_key

Screenshots

No response

Open Interpreter version

0.3.4

Python version

3.10.12

Operating System name and version

Ubuntu 22.04

Additional context

No response

danielbowne commented 3 weeks ago

Also "Linux: echo 'export OPENAI_API_KEY=your_api_key' >> ~/.bashrc " could be misleading. Should say :

MacOS/Linux: 

- zshrc: echo 'export OPENAI_API_KEY=your_api_key' >> ~/.zshrc                  
- Bash: echo 'export OPENAI_API_KEY=your_api_key' >> ~/.bashrc   

Windows: setx OPENAI_API_KEY your_api_key