4 ms·
How are you all getting around the response length limits? I've been experimenting with using ChatGPT to generate source code, and the code listings keep getti
by valleyer 4y ago
How are you all getting around the response length limits?
I've been experimenting with using ChatGPT to generate source code, and the code listings keep getting cut off. My attempts to get it to paginate its responses have not really worked (it seems to understand that I'm asking for the file to be broken across several messages, but suggestions like "limit each message to 50 lines of code" aren't heeded).
- sdwr 4y agoNot chatGPT, but the openAI code playground will continue a functionn if given another turn.
- valleyer 4y agoSo, I can totally get ChatGPT to continue the file it's listing, but when it does, it's clear that some code was skipped. (The messages often truncate right in the middle of a line, or even in the middle of a "quoted string literal".)
- lovasoa 4y agoI had to ask it to refactor components multiple times, so as to keep small components that it could easily rewrite in full in a single answer.
- ad404b8a372f2b9 4y agoThe best I've managed is to say something to the effect of: Ok now write the end of the file starting from line "[the literal line before it cut off]". That being said, as with the "Try Again" function, there is no guarantee that it's what it would have written the first time around. Also it keeps breaking the blockquote formatting, I don't know why. Generally I've found it's incapable of writing large novel systems correctly if you are trying to solve a specific problem, so I found large outputs generally useless. What I do is that I cut the problem into sub-problems and have him solve them one by one. Sometimes I'll show him an example of inputs, tell him what I want the function to do and ask him to generate the output. Then I'll tell him "Generate a function to go from this input to this output" and he has a good track record of producing small and correct pieces of code. Then the context of this previous task helps him solve the subsequent tasks more easily. Another pitfall with large outputs is that he seems to give as much weight to his answers as to yours. So if he gives a large incorrect output it will be more likely to corrupt the logic on which it will base subsequent answers. Often I'll tell it to just "Answer with O.K" or just end with "Do you understand?" so it doesn't go on a long logic-corrupting answer. The problem is that eventually he starts to answer with specifications of his own and asks me if I understand and to only respond with O.K ...
- djokkataja 4y agoHaven't tried it much for source code, but for prose you can simply say "continue" and it will pick up where it left off.
- keenmouse 4y agoI've had fairly good success with "Divide the code into numbered sections, tell me how many there are, and allow me to request a section by number." It usually then shows a numbered list of sections with descriptions of what is in each section(!). Then I just say, "Show me section x." for each one. I use either that method or "Continue from this line: [unique line of code from near the end of the previous output]" Neither method works consistently, but usually one or the other does.