How to make a dialogue system on GPT-3?

Hello, tell me how can I make a dialogue system with GPT-3 so that it remembers the user’s past messages? I am writing a telegram bot that responds to users in an online store and I need it to remember past messages and be able to respond to them, I can’t find it in the API

There is no context or continuity using the api. If you don’t mind looking at really crappy code here is an example of how I did it. Bitbucket

You should be using the chat endpoint, “gpt-3.5-turbo”. On Playground, you have to change Mode from Complete to Chat on the top right.

Documentation here: OpenAI API

Here’s one example I did for the endpoint. Not a proper chat, but just how the system, assistant, user roles work.

That’s not necessarily true, @sncocxach

In fact, after testing the newly released chat completion endpoint using turbo, many “hard core” devs here are reverting back to davinci models for chatbots because they stay in role better and have less restrictions.

FYI, The new chat completion API endpoint does does not manage the dialog history, just like the prior completion endpoint did not manage the dialog history either.

Both require similar software dev to feedback the prior prompts and completions (if needed) back to the API.

So, it really depends on your use case which model and API endpoint to use for a chatbot.

HTH

:slight_smile: