[BUG] Brief Description of the Issue
Found a bug? Please fill out the sections below. 👍
Describe the bug
[Self-Operating Computer | claude-3] Hello, I can help you with anything. What would you like done? [User] move mouse little to the right [Self-Operating Computer][claude-3] That did not work. Trying another method [Self-Operating Computer][Operate] That did not work. Trying again Error code: 401 - {'error': {'message': 'Incorrect API key provided: google/g*************free. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} [Self-Operating Computer][Error] -> cannot access local variable 'content' where it is not associated with a value PS C:\Users\Tango>
Steps to Reproduce
- installed normally
- tried Google: Gemma 2 9B (free) api from open source and did not work
- changed claude m version you suggested on page
- got that msg above
Expected Behavior
work normally
Actual Behavior:
msg above
Environment
- OS: window 11
- Model Used Google: Gemma 2 9B (free) claude
You should enter the entire API key, including the sk-proj- prefix. The entire API key looks like this: sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the rest of the key.
How to enter the API key in the configuration file:
Here's how to do it:
-
Open the configuration file (
config.py) in your text editor. -
Find where you define your OpenAI API key.
-
Enter entire API key: Replace
"your_api_key"with your full API key, including thesk-proj-prefix. Example:
classConfig:
def __init__(self):
load_dotenv()
self.verbose = False
self.openai_api_key = "sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Enter your entire API key here
self.google_api_key = None
self.anthropic_api_key = None
Alternatively, use the .env file:
-
Create an
.envfile in the root of your project if you don't already have one. -
Add the API key to the
.envfile:
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Load the environment variable in
config.py: Make sureload_dotenv()is used to load environment variables andopenai_api_keyis set withos.getenv():
from dotenv import load_dotenv
import pers
classConfig:
def __init__(self):
load_dotenv()
self.verbose = False
self.openai_api_key = os.getenv("OPENAI_API_KEY")
self.google_api_key = None
self.anthropic_api_key = None
.env way works for me.
im getting the same msg after i tried your first config method
i dont even understand what you mean with env,
Im not good with computers but I really want this for my grandma