|
|
|
|
|
by Hakkin
1287 days ago
|
|
I believe ChatGPT has some kind of response token limit, which is why longer code snippets commonly get cut off. I've seen some people recommend to enter something like "Continue your previous message starting from the last token", which sometimes works, but even when it does, it often breaks formatting, making it difficult to read the resulting code without copying it somewhere else.
What I found to work better is instructing it to output a single function at a time, this usually results in short enough code that it can output all of it in a single message.
Something like: I want you to send a single function in each response, I will say "Next" when I want you to send the next function.
I was able to get it to generate decently lengthy programs using this (on the order of a few hundred lines) that were syntactically and logically correct without any modification.
This may work for some languages better than others, though I imagine you can find some way to logically split up the program for most. |
|