Pythagora-io / gpt-pilot

The first real AI developer
Other
29.08k stars 2.91k forks source link

[Bug]: Failing project architecture - There was a problem with request to openai API #741

Open ObiWanFoley opened 3 months ago

ObiWanFoley commented 3 months ago

Version

VisualStudio Code extension

Operating System

Windows 10

What happened?

when I move into the project architecture phase I can see the JSON begin to be created and then it fails with the following:

There was a problem with request to openai API: {'description': 'The architecture of the xxxxxxxx application includes a Node.js backend with Express framework, MongoDB database using Mongoose ORM, and Vanilla JavaScript with Bootstrap for the frontend. The frontend interacts with the user, while the backend manages database connections, user authentication, and query executions.'} is not of type 'string'

Failed validating 'type' in schema['properties']['architecture']: {'description': 'General description of the app architecture.', 'type': 'string'}

On instance['architecture']: {'description': 'The architecture of the xxxxxxxx application includes a Node.js backend with Express framework, MongoDB database using Mongoose ORM, and Vanilla JavaScript with Bootstrap for the frontend. The frontend interacts with the user, while the backend manages database connections, user authentication, and query executions.'}

I have restarted several times and I continue to get the same issue. This is utilizing gpt-3.5-turbo-0125

ericchen0121 commented 3 months ago

same issue on Mac OS on gpt-3.5-turbo.

XjoeX commented 2 months ago

Add some prompt, the file is /pilot/utils/describe.py

DESCRIBE_PROMPT == """You're a software developer AI assistant. Your task is to explain the functionality implemented by a particular source code file.

Given a file path and file contents, your output should contain:

Output the result in a JSON format with the following structure, as in this example:

Example: { "summary": "Describe in detail the functionality being defind o implemented in this file. Be as detailed as possible", "references": [ "some/file.py", "some/other/file.js" ], }

Your response must be a valid JSON document, following the example format. Do not add any extra explanation or commentary outside the JSON document. """

Add the following string at last

Be careful NOT to write as 
{
    "summary": {
        "type": "string",  
        "description": "This file implements a command-line interface (CLI) for generating BTC or ETH wallet addresses. It uses the argparse library to parse command-line arguments for specifying the type of cryptocurrency and the number of addresses to generate. It also sets up logging to provide information about the wallet generation process. If the arguments are provided correctly, it calls a function from 'wallet_generator.py' to handle the wallet generation request."
    },
    "references": [
        "wallet_generator.py"
    ]
}
that is incorrect.
the "summary" field should be a string, not an object.