OpenInterpreter / open-interpreter

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

Freezes after generating prompt #1126

Open interpreteragent opened 7 months ago

interpreteragent commented 7 months ago

Describe the bug

interpreter console freezes after user enters a request when using --debug, I can see that a prompt for gpt4 was generated but then interpreter simply hangs

Reproduce

  1. launch interpreter
  2. enter openAI api key
  3. enter user request
  4. Prompt seems to be crafted, then interpreter just hangs forever

Expected behavior

  1. launch interpreter
  2. enter openAI api key
  3. enter user request
  4. Prompt seems to be crafted
  5. Either interpreter continues, or --debug sends appropriate message to diagnose error

Screenshots

image

Open Interpreter version

0.2.4

Python version

3.11.2

Operating System name and version

debian 12

Additional context

No response

interpreteragent commented 7 months ago

Running in python environment I get the error message - penai.py: Received openai error - Error code: 401 - {'error': {'message': 'Incorrect API key provided: x

However I believe I set the API key correctly via:

interpreter.llm.api_key 'real key shows up here'

thetiaradiaries commented 7 months ago

interpreter.llm.api_key 'real key shows up here.' copy that.

interpreteragent commented 7 months ago

interpreter.llm.api_key 'real key shows up here.' copy that.

copy that to where?

Why does it say the api key is 'x'. Received openai error - Error code: 401 - {'error': {'message': 'Incorrect API key provided: x

Also the CURL: POST Request Sent from LiteLLM: curl -X POST \ https://api.openai.com/v1/ \ -H 'Authorization: Bearer x' \

Is the API key not being passed? Where is 'x' coming from?

Is litellm actually trying to use the api key 'x'?

Here's what I've tried so far. Using verbose and debug.

  1. launching interpreter from bash with the OPENAI_API_KEY set
  2. launching from bash and pasting it in when asked for the API key
  3. from a python environment using import os

os.environ["OPENAI_API_KEY"] = "your_openai_api_key"

All of these seem to result in the same error.

interpreteragent commented 7 months ago

Okay. I solved it. But I don't understand how.

I installed miniconda and did a pip install open-interpreter inside a new conda env. (v2.0) Both the conda env interpreter and the previous one (cloned from this repo) (without refreshing bash or python) started working and actually sending the openai api key instead of 'x'.