gpt-engineer-org / gpt-engineer

Specify what you want it to build, the AI asks for clarification, and then builds it. Completely separate team and codebase from the AI Web App builder https://gptengineer.app
MIT License
51.73k stars 6.73k forks source link

**OpenAI API Errors: Internal Server Error and Bad Gateway** #812

Closed Nbtguyoriginal closed 10 months ago

Nbtguyoriginal commented 10 months ago

Title:

OpenAI API Errors: Internal Server Error and Bad Gateway

Issue Description:

When attempting to run gpt-engineer with specific projects and configurations following the steps closely, I consistently encounter OpenAI API errors, specifically "Internal Server Error" and "Bad Gateway".

Environment:

Steps to Reproduce:

  1. Installed gpt-engineer using the command: python -m pip install gpt-engineer. The installation completed without any issues.
  2. Ran the following commands:
    • gpt-engineer projects\gen gpt-3.5-turbo-16k-0613 -i ~~ error received
    • ' checked the help command for clarity the attempted to run with the default gpt4
    • gpt-engineer projects\gen -i ~~ error received

Both commands resulted in the same errors. if needed i can run the commands in the same terminal to provide both error logs

Expected Behavior:

The gpt-engineer tool should run without any errors and complete the intended operations. as per the instructions

Actual Behavior:

The tool encounters OpenAI API errors and eventually and errors until a user aborts the operation. The errors observed are:

Logs:

INFO:openai:error_code=502 error_message='Bad gateway.' error_param=None error_type=cf_bad_gateway message='OpenAI API error received' stream_error=False
...
WARNING:langchain.llms.base:Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIError: Bad gateway. ...
...
Aborted!

Additional Notes:

Recommendations:

gpt-engineer( potential bug inside).zip not sure if this is okay but some repos allow for this so here is the full directory for trouble shooting__ ty in advance for any help

I've attempted to disable cloud flare and restart only to receive the same error any help would be appreciated

ATheorell commented 10 months ago

Are you providing an OPENAI_API_KEY in the environment variable with the same name? auth_subrequest_error sounds like it.

If this is not the cause of the error, please provide a full stack trace

ATheorell commented 10 months ago

Im pretty sure that the problem is that you haven't set OPENAI_API_KEY in your environment. Closing