Skip to main content
UpdateContext feeds information into the conversation without triggering a visible response. Where SendMessage creates a chat message the user sees, UpdateContext works behind the scenes — it updates what the model knows without interrupting the flow.

When to Use It

UpdateContext is for situations where the UI interaction should inform the model’s future behavior without generating an immediate response:
  • User selects a preference or mode that should influence subsequent answers
  • A form submission captures structured data the model should reference later
  • Background state changes that provide context for the next conversation turn

Structured Content

For richer data, pass a dict instead of plain text:

API Reference

UpdateContext Parameters

content
str
default:"None"
Text content to add to the model’s context. Can be passed as a positional argument.
structured_content
dict[str, Any]
default:"None"
Structured data to add to the model’s context.

Protocol Reference

UpdateContext
{
  "action": "updateContext",
  "content?": "string",
  "structuredContent?": "object"
}
For the complete protocol schema, see UpdateContext.