Overview
Context updates allow you to dynamically add information to the conversation’s context during voice interactions. This helps provide the AI agent with additional context about the user, conversation state, or UI state.Automatic Context Updates
During voice conversations, several types of items are automatically added to the context:- User speech: Everything the user says is automatically transcribed and added as message items
- Agent responses: All agent responses are added to maintain conversation flow
- Function calls: When agents call tools, the function call details are automatically added
- Function outputs: Tool results are automatically added by the SDK when tools complete
Manual Context Updates
Adding context doesn’t trigger an agent response.
conversation.item.create
event:
Event Notifications
The server sends events for all context operations:Retrieving Context Items
You can retrieve a specific item from the conversation context by its ID:Deleting Context Items
You can remove items from the conversation context:Item Structure
Context items follow this structure:Field | Type | Description |
---|---|---|
type | string | Item type: “message”, “function_call”, “function_call_output” |
role | string | Message role: “user”, “assistant”, “system” |
content | array | Message content with type and text |
status | string (optional) | Item status: “in_progress”, “completed” |