Update Think

Send a message to replace the Think provider in the middle of a conversation.
Voice Agent

The UpdateThink message is a JSON message that you can use to replace the Think provider in the middle of a conversation.

Purpose

The UpdateThink message is a JSON message that allows you to replace the entire Think provider configuration during a conversation, including the model, prompt, endpoint, and functions. This flexibility enables real-time adjustments to the agent’s reasoning capabilities, ensuring a more dynamic and responsive interaction tailored to the evolving needs of the conversation.

Unlike UpdatePrompt, which adds to the existing prompt, UpdateThink replaces the entire Think provider configuration. This means you can switch to a different LLM provider, change the model, set a completely new prompt, and reconfigure functions all in a single message.

Example Payloads

To send the UpdateThink message, you need to send the following JSON message to the server:

JSON
1{
2 "type": "UpdateThink",
3 "think": {
4 "provider": {
5 "type": "open_ai", // LLM provider to use.
6 "model": "gpt-4o-mini"
7 },
8 "prompt": "You are a helpful voice assistant."
9 }
10}

Upon receiving the UpdateThink message, the server will process all remaining audio data and return a ThinkUpdated message.

JSON
1{
2 "type": "ThinkUpdated"
3}