Chatbot - ending the chat when conditions are met

I’m working on a chat bot where you can talk to the bot about a specific topic.

Main issue I’m facing is making the bot end the conversation when certain conditions have been satisfied.

Currently I tell the bot to add the word “THE END” to let me know that conversation has ended.
However, I’ve noticed that it adds that word even if conditions have not been satisfied.

Are there more reliable ways to achieve this task?

Not sure if this applies to your situation, but here’s a trick for how I’ve been doing it.
In your prompt, add something like this:

start/end chats with <BOT></BOT>

Then make sure the last text of your completion prompt ends with the text <BOT>.

Then use insert mode, together with suffix and stop parameters in your completion.

In python, it looks something like this:

completion = openai.Completion.create(engine="text-davinci-003",
            prompt=f"{prompt}\n<BOT>", suffix="</BOT>", stop=["</BOT>"])

This approach reliably keeps my completions to only the bot response. Hope that helps!

1 Like

I’ve been exploring possible ways for the assistant to end the conversation. So far I’ve done like you, ask it to add a specific word, but it’s not ideal, especially in multilingual environments. So I’m wondering if there is way for it to stop accepting prompts when conditions are met.

Hi I found that ChatGPT api is better at following instructions like this. Also I haven’t tried but apparently fine tuning works well for this purpose.

Can Turbo be fine tuned at this moment? In order to add learned behaviors and context I’m using messages.

I don’t think so. You have to fine tune using curie.

1 Like