self-operating-computer icon indicating copy to clipboard operation
self-operating-computer copied to clipboard

[BUG] Brief Description of the Issue

Open BootsOfTango opened this issue 1 year ago • 2 comments

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

  1. installed normally
  2. tried Google: Gemma 2 9B (free) api from open source and did not work
  3. changed claude m version you suggested on page
  4. got that msg above

Expected Behavior

work normally

Actual Behavior:

msg above

Environment

  • OS: window 11
  • Model Used Google: Gemma 2 9B (free) claude

BootsOfTango avatar Jul 02 '24 11:07 BootsOfTango

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:

  1. Open the configuration file (config.py) in your text editor.

  2. Find where you define your OpenAI API key.

  3. Enter entire API key: Replace "your_api_key" with your full API key, including the sk-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:

  1. Create an .env file in the root of your project if you don't already have one.

  2. Add the API key to the .env file:

OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Load the environment variable in config.py: Make sure load_dotenv() is used to load environment variables and openai_api_key is set with os.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.

Latryna avatar Jul 02 '24 20:07 Latryna

Screenshot 2024-07-03 000616

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

BootsOfTango avatar Jul 03 '24 04:07 BootsOfTango