Skip to main content

Module 14: Sending Updates

Send all types of session updates from an agent to its client.

What You’ll Learn

  • Convenience methods: sendMessage(), sendThought()
  • Full API: sendUpdate() for complex types (plans, tool calls, commands)
  • All SessionUpdate types from the agent’s perspective

The Code

The prompt handler demonstrates each update type:

Convenience vs Full API

Convenience methods handle wrapping in TextContent and setting the type field. Use sendUpdate() for complex types that need full control over their structure.

Source Code

View on GitHub

Running the Example

Next Module

Module 15: Agent Requests — read files, write files, and request permissions from the client.