How do I migrate threads from one assitant instance to another instance

I am building a chatbot. I have one file called prompts.py that holds the prompt for the assistant.
Various users talk to the chatbot and create a thread in the assistant instance called Assistant_A. Let’s say 3 users (A, B, C) use my chatbot in one assistant instance to create 3 threads.

I updated the prompt in prompts.py, which generates a new assistant instance called Assitant_B. When user A talks to the chatbot it talks to Assistant_A. since the thread for A is a part of Assistant_A. But the updated prompt is much better, I want user A to talk to Assistant B while retaining context from the conversation with Assistant_A.

In simple words, even if I update the prompt for the assistant in my program, I want users to to talk to the latest version of the assistant while retaining context from older versions. Is there any way to do this

Assistants endpoint uses different nomenclature for “system message”, “prompt”, etc.

The definition you talk about is a parameter for assistant creation called “instructions” that you create and set on an assistant. Then you have what amounts to more instruction-like text when you use tools or attach files.

same assistant, different instructions

The instructions are not immutable at runtime. When starting a run (executing a new user input message) you can specify additional_instructions that run alongside the instruction programming, or you can just give instructions, that replaces all of what the assistant was programmed with.

Same thread, different assistant

A thread contains the messages. When you create a run of the next user input you added to an existing thread, you also specify an assistant ID. You can pick a different assistant programmatically. For example, if your input box in your user interface let a user keep their conversation and switch between “programming” and “poetry”, the other assistant could be employed for a one-time on-demand answer.

1 Like