#reset dialog

25 messages · Page 1 of 1 (latest)

magic zodiac
#

how to reset dialog in gpt-3.5-turbo API? In Python

civic flicker
#

1 prompt (api call) = 1 conversation
You cant send 2 prompts and have it remember both

The whole way how it remembers the conversation is that you send the whole conversation in 1 API call every time (yes it increases tokens used)

magic zodiac
#

I need it to be like this: Dialogue reset, I forgot what we were talking about.
Write a message to start a new conversation

magic zodiac
magic zodiac
#

@civic flicker

civic flicker
#

no you send one openai.ChatCompletion.create
thats all that the bot will remember
your next openai.ChatCompletion.create is completely clear, unless you include the previous conversation inside it

magic zodiac
civic flicker
magic zodiac
civic flicker
#

The only way to make it remember is to include the whole conversation in your openai.ChatCompletion.create
"messages": [{"role": "user", "content": "Hello!"},{"role": "assistant", "content": "Hello you!"},{"role": "user", "content": "How are you?"}]
here it would remember that I said hello

"messages": [{"role": "user", "content": "How are you?"}]
here it would NOT remember that I said hello

magic zodiac
civic flicker
#

"messages": [{"role": "user", "content": "Question1"},{"role": "assistant", "content": "answer1"},{"role": "user", "content": "Question2"}]

#

this should give you answer to question 2 while remembering question1 and that its already answered

#

"messages": [{"role": "user", "content": "Question2"}]
this would not remember question1 or answer1

just completely new question and conversation

#

I guess if I understand correctly, you might be doing this, after you already had answer1
"messages": [{"role": "user", "content": "Question1"},{"role": "user", "content": "Question2"}]
and this would probably give you answer to question1 and also question2
because you didnt include {"role": "assistant", "content": "answer1"} in the middle
it does not remember that it already answered

in other words, you need to include every bot completion in the "messages", if you want it to remember it

magic zodiac
civic flicker
magic zodiac
civic flicker
#

your first prompt was
"messages": [{"role": "user", "content": "Hello"}]

you got a completion back {"role": "assistant", "content": "Hello there! How can I assis you today?"}

If with the next message you want it to remember that
you send again
"messages": [{"role": "user", "content": "Hello"}, {"role": "assistant", "content": "Hello there! How can I assis you today?"},{"role": "user", "content": "next question"}]

if user clicks reset before that
you only send
"messages": [{"role": "user", "content": "next question"}]

#

thats how you reset

#

by not including the previous "messages"

#

the longer the conversation, the more tokens you will send
because you need to include the whole conversation if you want the bot to remember it