Pythagora-io / gpt-pilot

The first real AI developer
Other
31.96k stars 3.23k forks source link

[Bug]: Error parsing LLM response in a laravel simple project! #1003

Open hooman-mirghasemi opened 5 months ago

hooman-mirghasemi commented 5 months ago

Version

VisualStudio Code extension

Operating System

Linux (other)

What happened?

I just start a laravel project when I define a simple task to "create a category with crud in admin panel"

{ "summary": "The 'User.php' file defines the User model class within the 'App\Models' namespace. This class extends 'Authenticatable' class provided by Laravel framework for user authentication. It includes attributes like 'name', 'email', and 'password' that are mass assignable and hidden attributes like 'password' and 'remember_token'. Additionally, it defines a method 'casts' to specify the data types for certain attributes like 'email_verified_at' and 'password'.", "references": [ "Illuminate/Contracts/Auth/MustVerifyEmail.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php", "Illuminate/Foundation/Auth/User.php", "Illuminate/Notifications/Notifiable.php" ] }

{ "summary": "The 'User.php' file defines the User model class within the 'App\Models' namespace. This class extends 'Authenticatable' class provided by Laravel framework for user authentication. It includes attributes like 'name', 'email', and 'password' that are mass assignable and hidden attributes like 'password' and 'remember_token'. Additionally, it defines a method 'casts' to specify the data types for certain attributes like 'email_verified_at' and 'password'.", "references": [ "Illuminate/Contracts/Auth/MustVerifyEmail.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php", "Illuminate/Foundation/Auth/User.php", "Illuminate/Notifications/Notifiable.php" ] }

{ "summary": "The 'User.php' file defines the User model class within the 'App\Models' namespace. This class extends 'Authenticatable' class provided by Laravel framework for user authentication. It includes attributes like 'name', 'email', and 'password' that are mass assignable and hidden attributes like 'password' and 'remember_token'. Additionally, it defines a method 'casts' to specify the data types for certain attributes like 'email_verified_at' and 'password'.", "references": [ "Illuminate/Contracts/Auth/MustVerifyEmail.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php", "Illuminate/Foundation/Auth/User.php", "Illuminate/Notifications/Notifiable.php" ] }

Error parsing LLM response

it seems every time with every task Pythagora try to read all project files and send to API!!?

I set it much simpler: "only create category model"

and again faced up with:

Hooman mir

Yes

Code Monkey Agent

{ "summary": "The 'Category.php' file defines the Category model class within the 'App\Models' namespace. This model extends the Eloquent Model class provided by Laravel and uses the HasFactory trait. It represents a category entity with properties such as id, name, and description. The 'fillable' property specifies which attributes can be mass assigned when creating instances of this model. Additionally, the file mentions that future relationships might be defined within this class.", "references": [ "Illuminate/Database/Eloquent/Model.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php" ] }

{ "summary": "The 'Category.php' file defines the Category model class within the 'App\Models' namespace. This model extends the Eloquent Model class provided by Laravel and uses the HasFactory trait. It represents a category entity with properties such as id, name, and description. The 'fillable' property specifies which attributes can be mass assigned when creating instances of this model. Additionally, the file mentions that future relationships might be defined within this class.", "references": [ "Illuminate/Database/Eloquent/Model.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php" ] }

{ "summary": "The 'Category.php' file defines the Category model class within the 'App\Models' namespace. This model extends the Eloquent Model class provided by Laravel and uses the HasFactory trait. It represents a category entity with properties such as id, name, and description. The 'fillable' property specifies which attributes can be mass assigned when creating instances of this model. Additionally, the file mentions that future relationships might be defined within this class.", "references": [ "Illuminate/Database/Eloquent/Model.php", "Illuminate/Database/Eloquent/Factories/HasFactory.php" ] }

Error parsing LLM response

senko commented 5 months ago

@hooman-mirghasemi which LLM was that? The default or you configured a specific one?

The file summary is done just once after the file is changed, but this looks like the response couldn't be parsed so Pythagora retried several times before giving up.

DaddyWozBucks commented 5 months ago

I got the same error on gpt-4o. It is now stuck in a loop trying to update the plan. Even restarting the process ends up back here


    {
      "description": "Create a Docker setup for the application. Create a `Dockerfile` for the backend and a `docker-compose.yml` file in the project root. Configure the Docker setup to build and run the entire application, including the backend, frontend, and MongoDB database."
    }
  ]
}

[Tech Lead] 
Error parsing LLM response[Pythagora] Would you like to retry the failed request?
hooman-mirghasemi commented 5 months ago

"agent": { "default": { "provider": "openai", "model": "gpt-4-0125-preview", "temperature": 0.5 }, "CodeMonkey.describe_files": { "provider": "openai", "model": "gpt-3.5-turbo", "temperature": 0.0 } },

banchaa commented 5 months ago

I'm having a similar issue. After some generation, suddenly the generation stops, resulting in: Error parsing LLM response[Pythagora] Would you like to retry the failed request?

This happens with the standalone CLI in Debian and gpt-4o.

I could choose [yes], which generates the whole code again usually without success. Sometimes choosing [yes] and then [no] and then reloading the project from the last step works suddenly. But this process is draining lots of money..

ChiefGorilla commented 5 months ago

Same issue. Both gpt 4 and local llms

Global-ti commented 5 months ago

Same error, I got this since the v2 update.

bridgebrain commented 4 months ago

@hooman-mirghasemi which LLM was that? The default or you configured a specific one?

The file summary is done just once after the file is changed, but this looks like the response couldn't be parsed so Pythagora retried several times before giving up.

Does it require the file summary to know what is where in a default installation? If not, skipping this step might get it past it.

Additional information: It does this randomly, I ran several different runs and it always found a different point to freak out on. Maybe an option to interrupt the current step and explain what is going wrong, then have it adjust the current step accordingly? Currently it's a yes or no option only, and refuses other approaches

Also, here is the error location, since I don't see it elsewhere in the thread:

File "C:\Users\Bridgebrain.conda\envs\gpt-Pilot\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 2 column 103 (char 104)

Edit edit: It might be hitting the rate limit. I changed the script for the describer to be extremely concise, and it made it through the process only to rate limit on the next command and need some downtime. It makes sense, because it'll hit the rate limit at some point, but then fail to toss on the ending brackets and such at the end of the json string, throwing a json error. I also set it to not describe vendor, which might cause problems down the line, but it was easily the biggest file jam and rarely needs to be directly edited