OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Setup error

Open zlip123 opened this issue 1 year ago • 8 comments

Is there an existing issue for the same bug?

  • [X] I have checked the troubleshooting document at https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting
  • [X] I have checked the existing issues.

Describe the bug

I ran the docker container and entered my gpt4 (yes i pay) API key but it said i don't have access to the model? i made a new project key and got the same error. i tried gpt4 turbo and got the same error. lmk if you know what I'm missing. i2 i

Current Version

ghcr.io/opendevin/opendevin:0.5

Installation and Configuration

none extra

Model and Agent

gpt-4

Reproduction Steps

  1. Cloned
  2. Made workspace folder
  3. Set workspace_base
  4. Copy pasted docker run from the readme
  5. Waited
  6. Selected gpt-4 in pop menu and entered my new project key i made from openAI official website
  7. It failed :(

Logs, Errors, Screenshots, and Additional Context

i2

zlip123 avatar May 07 '24 19:05 zlip123

I tried again today and it still does not work.

zlip123 avatar May 08 '24 15:05 zlip123

how do you run it?

iFurySt avatar May 09 '24 07:05 iFurySt

I cloned the repo --> cd into it --> set workspace_base (export WORKSPACE_BASE=$(pwd)/workspace;) --> docker run command from the readme --> enter api key --> it doesnt work with new api keys (yes i pay for gpt4)

zlip123 avatar May 09 '24 13:05 zlip123

Run this to check whether LLM is working properly.

import tomllib as toml
from litellm import completion
from datetime import datetime
file_path=r'config.toml'
config = toml.load(open(file_path,'rb'))

messages = [{ "content": "If there are 10 books in a room and I read 2, how many books are still in the room?","role": "user"}]
dt = datetime.now()
response = completion(model=config['LLM_MODEL'], 
                        api_key=config['LLM_API_KEY'],
                        base_url=config.get('LLM_BASE_URL'),
                      messages=messages)

content = response.choices[0].message.content
print(content)

if '8' in content:
    print('--> Correct answer! 🎉')
    print('There are still 10 books in the room; reading them does not reduce the count. Consider exploring more accurate models for better results.')

dt2 = datetime.now()
print('Used model:',config['LLM_MODEL'])
print(f"Time taken: {(dt2-dt).total_seconds():.1f}s")

SmartManoj avatar May 10 '24 12:05 SmartManoj

@zlip123 Does it work with gpt-3.5-turbo?

enyst avatar May 10 '24 16:05 enyst

@SmartManoj Do I make this file in the tests folder and download the dependencies and run through terminal?

zlip123 avatar May 10 '24 17:05 zlip123

You can run anywhere.

Run this to check whether LLM is working properly.

from litellm import completion
from datetime import datetime
config = {
    'LLM_MODEL': 'gpt-4-turbo-2024-04-09',
    'LLM_API_KEY': 'your-api-key',
    'LLM_BASE_URL': None
}

messages = [{ "content": "If there are 10 books in a room and I read 2, how many books are still in the room?","role": "user"}]
dt = datetime.now()
response = completion(model=config['LLM_MODEL'], 
                        api_key=config['LLM_API_KEY'],
                        base_url=config['LLM_BASE_URL'],
                      messages=messages)

content = response.choices[0].message.content
print(content)

if '8' in content:
    print('--> Correct answer! 🎉')
    print('There are still 10 books in the room; reading them does not reduce the count. Consider exploring more accurate models for better results.')

dt2 = datetime.now()
print('Used model:',config['LLM_MODEL'])
print(f"Time taken: {(dt2-dt).total_seconds():.1f}s")

SmartManoj avatar May 11 '24 02:05 SmartManoj

Yes, @zlip123 , you can run it through the terminal. This will help test whether it's a problem with your API key or something else.

neubig avatar May 13 '24 21:05 neubig

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 13 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Jun 21 '24 01:06 github-actions[bot]