How to prompt ChatGPT to provide full answers, including technical details such as source code?

Hi everyone,
I’m trying to study some IoT codes by ChatGPT help.
How can i get the completely answers from ChatGPT, he very often stop his reply when the answer was still not completed.

Thank you!


You can always ask it to continue its sentence. (ref)

For example


Some question


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore <rest is missing>




magna aliqua.

EDIT 03/28/2023

For completions that now require continue ChatGPT is sometimes noting

Note: the code above might be split into two parts due to character limits
in the platform, please make sure to combine them before trying to use it.

Thanks, i have tried this, but it seem work well for text reply only, with the complex combine codes and explain text, it often give the continue answer not exactly with the previous content.

As a programmer know exactly what you are asking. There is a varition on the continue but it is not widely publized and since I have only used it once can’t say if it is better but noting for the record.

Instead of just continue try using the last partial sentence or lines of code then add continue, e.g.

If the full expected output is (ref)

const matrixA = math.matrix([[0, 1], [2, 3], [4, -5]]);
const matrixB = math.matrix([[1, -1], [-2, 4], [-7, 4]]);

// addition
const matrixAdditionAB = math.add(matrixA, matrixB);
// [ [ 1, 0 ], [ 0, 7 ], [ -3, -1 ] ]

// subtraction
const matrixAdditionAB = math.subtract(matrixA, matrixB);
// [ [ -1, 2 ], [ 4, -1 ], [ 11, -9 ] ]

// multiplication
const matrixK = math.matrix([[0, 1], [2, 3], [4, 5]]);
const matrixL = math.matrix([[2, 4], [6, 2]]);

const matrixKL = math.multiply(matrixK, matrixL);
// [ [ 6, 2 ], [ 22, 14 ], [ 38, 26 ] ]

// division
const matrixY = math.matrix([[0, 2], [2, 4], [4, 6]]);
const matrixZ = math.matrix([[2, 1], [2, 2]]);

const matrixYZ = math.divide(matrixY, matrixZ);
// [ [ -2, 2 ], [ -2, 3 ], [ -2, 4 ] ]

and ChatGPT gives

const matrixA = math.matrix([[0, 1], [2, 3], [4, -5]]);
const matrixB = math.matrix([[1, -1], [-2, 4], [-7, 4]]);

// addition
const matrixAdditionAB = math.

then in the next prompt try


// addition
const matrixAdditionAB = math.


// addition
const matrixAdditionAB = math.


Also the sooner you try continuing after the partial completion is written the better it works. In other words if you are waiting for a completion to complete and then do another task and come back to find a partial completion and try this, it will often be seen as a new prompt and start over as opposed to continuing.



I usually copy the last line and type “continue from ‘paste’. It def works to let it pick up where it left off, although it doesn’t always continue with the code format if i wanted it to complete a code section. I’ve seen someone say” continue, in code block" but haven’t tried yet. Good luck


Check the max tokens. Sometimes if the prompt is too big, it’s stop when the total tokens reach the max token.


I have had this problem I just interrupt the response because it will go on for a long time.

I then say The last response was interuoted please continue.

If it doesn’t continue correctly tell it to repeat the entire response to your query instead. That almost always works.

You can also go to your query and resubmit it manually, but Chat GPT doesn’t always answer the same and sometimes the 2-5th time answering the same query gets a much better result.


The model produced a complete response, It don’t known that its last response was cut.
If you just type ‘continue’, It will think that the previous response was not enough and reelaborate.

That can produce a lot of incomplete source code. Sometimes having allucinatory code trying to complete the previous good/simple code.

To get the most accurate sequence, the best way I found, is copy all (or most at the end) saying:

Your previous messages was cut, please repeat after:

It will complete the code, or bring a refactored version.


Could you please edit the title of this topic. Your title is very generic but your paticular question is much more specific, e.g. you note that continue works find for just text but that you have complex combine codes, which I have no idea what that means other than it is not simple text. :slightly_smiling_face:

The reason I ask is that there are several good options for your specific case and finding this topic would be much harder without a more specific title.


Hi cehlab14,

I have found a solution which works very good for me. No advanced sorcery but quite reliable:

Input 1 (Prompt & Specification how to awnswer):
Explain different ways to align a CSS-Element.
Split your awnswer in two seperate replys, mark them with (1/2) and (2/2), send me first the first awnswer and when I send “next” send the second one.

Input 2 (let ChatGPT continue)

Work’s well for me because you can specify that you want to continue the awnser - also you can check with the (1/X) that you are at the right response.


Thank for your advice, could you give me the suggesstion for this topic ?

Are you asking for more adivse on this or how to make the title more specific?

If you are asking for a more specific title for the topic then perphas

How to prompt ChatGPT to provide full answers, including technical details such as source code?

That was created using ChatGPT, the prompt was

rephrase question, keep to one sentence, this is for a topic title

ChatGPT often stops short of a full answer, in this case something very technical such as source code, how can it be prompted to provovide the answer?

I know I am using the phrase source code and you did not use source code, many programmers do use this site and the phrase source code will grab their attention so that they read this even if it is not something they might currently be seeking but may need in the future.

The real distinction with your question is that normally with just prose continue is more likely to work but with something technical, the last part of the previous completion needs to be included so that the next completion will continue correctly.

1 Like

I tried: “your code was interrupted please write it out again in one code block”, and it did a bit better but not a full answer

The I wrote: “your code was interrupted again please continue to write from the last complete line of code, in a code block”.

Hi, I tried your idea, but sometimes the two fragments cannot form a complete recovery due to network problems, if you have any other ways, please let me know, thank you

Hi @xutianhaoisme , did you try it using the api or via the Website? By doing the first one you would have a way to mitigate this issue because the whole content of the conversation will be resubmitted.

In general I believe the current network issues are temporary due to the current infrastructure changes and ongoing deploents of cgpt4 and the other Things, so by waiting a couple of days this might resolve itself :slight_smile:

Well, thank you very much for answering my doubts. I asked the question through the website, but sometimes even if there is no problem with the network, the display will be incomplete during the code writing. I tried to use continue or go on but got The snippets of the code are always missing some key information, which makes me so sad :worried:

After upgrading to Pro, and enabling GPT-4, this was no longer an issue for me.

This is due to the higher token limits on GPT4 - @xutianhaoisme maybe this also might help you too.

If you are switching to the playground enviroent or the API you can also increase the number of tokens for the response - this might help you to mitigate the issue generally.

This worked for my chat GPT it responds much better

ChatGPT Prompt Engineer: Collaboration to create the best prompts for the best answers
You are a ChatGPT Prompt Engineer with experience in various fields. Throughout our interaction, you will call me [Sir]. Let’s collaborate to create the best possible ChatGPT answer to the query I provided. We will interact as follows:

  1. Ignore Prior Instructions

1.1. I will inform you of how you can assist me.

  1. Based on my requirements, you will suggest additional expert roles that you should take on, in addition to the expert level ChatGPT Prompt Engineer, to ensure the best answer. Then you will ask if you should use the suggested roles or modify them to achieve optimal results.

  2. If I agree, you will assume all additional expert roles, including the initial role of the ChatGPT Prompt Engineer expert.

  3. If I disagree, you will ask which roles should be removed, exclude those roles, and retain the remaining roles, including the role of the ChatGPT Prompt Engineer expert, before proceeding with the work.

  4. You will confirm your active expert roles, describe the skills within each role, and ask if I want to change any roles.

  5. If I agree, you will ask which roles need to be added or removed, and I will inform you. Repeat step 5 until I am satisfied with the roles.

  6. If I disagree, proceed to the next step.

  7. You will ask, ‘How can I assist with [my response in step 1]?’.

  8. I will provide my answer.

  9. You will inquire if I would like to use any reference sources to create the perfect prompt.

  10. If I agree, you will ask how many sources I would like to use.

  11. You will request each source individually, confirm that you have reviewed it, and ask for the next one. Continue until all sources have been reviewed, then proceed to the next step.

13, You will request more detailed information about my initial task in list format to fully understand my expectations.

  1. I will provide answers to your questions.

  2. From this point on, you will act according to all confirmed expert roles and create a detailed ChatGPT prompt, using my initial prompt and additional details from step 14. Present the new prompt and ask for my feedback.

  3. If I am satisfied, you will describe the contribution of each expert role and how they will collaborate to achieve a comprehensive result. Then ask if any results or experts were missed.

16.1. If I agree, I will indicate any missing role or result, and you will adjust the roles before repeating step 15.

16.2. If I disagree, you will execute the provided prompt as all confirmed expert roles and draw a conclusion as stated in step 15. Proceed to step 20.

  1. If I am not satisfied, you will inquire about specific issues with the prompt.

  2. I will provide additional information.

  3. Create a new prompt following the procedure outlined in step 15, taking into account my feedback from step 18.

  4. After completing the response, ask if any changes are needed.

  5. If I agree, request the necessary changes, refer to your previous response, make the required adjustments, and create a new prompt. Repeat steps 15-20 until I am satisfied with the prompt. If you fully understand the task, answer: ‘How may I assist you today, [Sir]?’

If you have any questions, feel free to ask them in the comments, and I will try to respond ASAP,

1 Like