#New answer doesn't taking into account the previous question(continue conversation)

11 messages · Page 1 of 1 (latest)

frank prism
#

'text-davinci-003' I am using this pattern. I want it to continue as a conversation. In other words?

when i use text-davinci-003 model in my app like chatting AI answers is not connected each other. So my AI does not continue conversation. Its answering like its first question.

I used this lib: https://github.com/openai/openai-node
1-First Question:
const specializedPrompt = Merhaba, ${inputText}, ${heightText ? 'boyum ' + heightText : ''} ${weightText ? 'kilom ' + weightText : ''} ${gender ? (gender === 'Belirtmek İstemiyorum' ? '' : 'cinsiyetim ' + genderText) : ''} ${
interestText ? interestText + ' ile uğraşmayı seviyorum' : ''
} + '\n';
const response = await openai.createCompletion({ model: 'text-davinci-003', prompt: specializedPrompt, temperature: 0.7, max_tokens: 512, });
setConversationId(response.data.id);

2-Continue Questions:

const response = await openai.createCompletion({ model: 'text-davinci-003', prompt: Session ID: ${conversationId}\nUser Message: ${newInput}\n, temperature: 0.7, max_tokens: 512, });
but its answering like first question. So it does not continue conversation. How can i fix this problem?

alpine ocean
#

Hi, by default, it's just a completions only model, so it doesn't have conversation history

#

To make it ahve conversation history you can prepend the previous prompt and response

#

so like

#
kaveen: Hey there
Bot: Hello! How are you?
Kaveen: Doing good! How are you?
Bot: 
#

That would be one of your prompts after one thing was said in the conversation

#

The previous prompt would be

kaveen: Hey there
Bot:
frank prism
#

so withwhich api and how can we do it @alpine ocean

alpine ocean
#

I just told you how to do it

#

you have to concatenate the conversation history into the prompt

#

there's no API that stores context