Is it possible to update the instructions inside a thread run?

For assistant API:
I know that we can override the instructions when create a new run inside a thread. So that the original instructions for the assistant would be replaced by the new instructions.
But I’m wondering if I can also update the instructions for the runs inside a thread? i.e., after different function calls I can update the instructions? The idea for this purpose is to save tokens.

1 Like

It is not possible to update/replace the instruction that way. But can you tell us at least a sample scenario why do you want to do that? Maybe there is some other work around in implementing it.

2 Likes

Thanks for your reply!

Like, I want my assistant capable to do 2-3 tasks in a ordered pipeline, called task A, task B and task C. For each user input, the assistant should conduct functions A, B, C in order. Sometimes the result of B or C could be wrong based on predefined rules, then it will automatically go back to task A. This auto mechanism is what I like to use Assistant API.

The situation is, each time, the assistant should start from task A, so I hope the initial instruction only include prompts for task A and general rules, do not include prompts for task B and task C. Later when we have the result of task A, like, we select a table / select a region, should go to task B then, then we update the instruction to also include prompt for task B.

Compared with a fixed initial instructions, this way could help save more tokens.

Is it possible to make separate Assistant per task? Like Assistant A for Task A, Assistant B for Task B and Assistant C for Task C. This will make A, B and C behave as external API. Then make another Assistant D with 3 functions. Each functions will call the Assistant like an external API. Your Assistant D will have instruction that will lay out the sequence of how the functions will be invoked, like call Assistant B if Assistant A result is so and so.

Thanks for your suggestion!

However, I can not do like split my system into multiple assistants, the code is not easy to reorg.

I still want to find a way to update the instructions or update context (of task B, C).