OpenAI API continuing conversation in a dialogue

In fact you can do what you want, it’s simple. Just provide to openai inputs part of previous conversation.

prompt = "chat message 1\n" + "chat message2\n" + ... + "your last message\n"

And don’t forget to set up “stop” variable in “openai.Completion.create”.

stop=["\n"]

Here “\n” will be used as delimiter between messages.

Leave a Comment