Hello, using API, the chatCompletion can have finished early because it reach max length. How to make request to continue back where it left?
const response = await openai.createChatCompletion({
model: 'gpt-3.5-turbo',
messages: [
{role: 'system', content: systemPrompt},
{role: 'user', content: userPrompt}
],
n: 1,
});
const finishReason = response.data.choices[0].finish_reason;
if (finishReason === 'length') {
logger.info('ChatGPT response was too long. Retrying...');
} else if (finishReason === 'function_call') {
logger.error('Completion had a function call issue. Starting fresh...');
continue
}