gpt-engineer icon indicating copy to clipboard operation
gpt-engineer copied to clipboard

fix(bug): inconsistent file code blocks

Open gblikas opened this issue 1 year ago • 3 comments

an update of https://github.com/AntonOsika/gpt-engineer/pull/287

ChatGPT returns inconsistent formats for files; changing the philosophy to specify the format "Filename: file". This greatly improves the ability of the to_file method to adequately parse file names. This semantic re-enforcement could be applied to other identities, but this seems to a general solution, afaik.

gblikas avatar Jun 22 '23 09:06 gblikas

Question: Are you using gpt 3.5?

AntonOsika avatar Jun 25 '23 12:06 AntonOsika

As for the code, I don't see how this helps.

Also – I believe the best solution is to provide examples for gpt-engineer on what it should look like.

AntonOsika avatar Jun 25 '23 12:06 AntonOsika

Question: Are you using gpt 3.5?

@AntonOsika I tried it with a 3.5 token and a 4.0 token.

As for the code, I don't see how this helps.

Also – I believe the best solution is to provide examples for gpt-engineer on what it should look like.

Suggestions? @AntonOsika I feel like I provided an example; do you mean a more complete sample - perhaps you mean like a /projects/example/workspace/all_output.txt then feed it into gpt-engineer? If to_file is going to be expecting a format containing a specific symbol as a part of the codeblock, we should make sure that we prompt it for the specific symbol, rather than relying on the user to specify.

gblikas avatar Jun 25 '23 20:06 gblikas

Still don't see how this helps. There is already this kind of prompt in the generate file.

What I meant is something like this in the prompt

please use this format:

subdir/server.js
` ` `javascript
import dependency

function a() {
   dependency.run()
}
` ` `

AntonOsika avatar Jun 29 '23 20:06 AntonOsika

Closing for now

AntonOsika avatar Jun 29 '23 20:06 AntonOsika

Feel free to try to improve it if you think it is necessary!

AntonOsika avatar Jun 29 '23 20:06 AntonOsika