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

[BUG] Brief Description of the Issue #199

Open
BootsOfTango opened this issue Jul 2, 2024 · 2 comments
Open

[BUG] Brief Description of the Issue #199

BootsOfTango opened this issue Jul 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@BootsOfTango
Copy link

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 BootsOfTango added the bug Something isn't working label Jul 2, 2024
@Latryna
Copy link

Latryna commented Jul 2, 2024

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.

@BootsOfTango
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants