githubEdit

listAvailable Events

Complete reference of all available agent events.

Agent Status Events

AgentStatusChanged

Fired when the agent's operational status changes.

public readonly struct AgentStatusChanged : IEvent
{
    public AgentStatus NewStatus { get; }
    public string Args { get; }
}

Properties:

  • NewStatus - The new agent status

  • Args - Optional context-specific arguments

Status Values:

  • None - Initial state

  • Initializing - Agent is initializing

  • Ready - Agent is ready for requests

  • GeneratingResponse - Agent is generating a response

  • Thinking - Agent is processing reasoning

  • Transcribing - Agent is transcribing audio input

  • ExecutingTool - Agent is executing a tool

  • WaitingForApproval - Agent is waiting for MCP approval

  • Error - Agent encountered an error

  • Disposed - Agent has been disposed

Example:


Conversation Events

All conversation events inherit from ConversationEvent.

ConversationCreated

Fired when a new conversation is created.

Example:

ConversationLoaded

Fired when an existing conversation is loaded from storage.

Example:

ConversationDeleted

Fired when a conversation is deleted.

Example:

ConversationTitleUpdated

Fired when a conversation's title is updated.

Example:

ConversationSummaryUpdated

Fired when a conversation's summary is updated.

ConversationItemsLoaded

Fired when conversation items (messages) are loaded.

Example:

ConversationListLoaded

Fired when a list of conversations is retrieved.

Example:

Handle All Conversation Events

You can subscribe to the base type to handle all conversation events:


Tool Events

ToolCall

Fired when the agent decides to call a tool (function, code interpreter, or file search).

Properties:

  • Index - Optional index of the tool call

  • CallId - Unique identifier for this tool call

  • Name - Name of the tool being called

Example:


ToolStatusEvent

Fired when a tool's execution status changes.

Properties:

  • Type - The type of tool (Search, Generation, etc.)

  • ToolStatus - General tool execution status

  • SearchStatus - Search-specific status

  • GenerationStatus - Generation-specific status

Example:

ToolOutputEvent

Fired when a tool produces output or completes execution.

Event Types:

  • Unknown - Unknown event type

  • Submitting - Tool output is being submitted

  • Result - Tool execution completed with result

  • Error - Tool execution failed

Example:


McpApprovalRequest

Fired when an MCP (Model Context Protocol) tool requires human approval before execution.

Properties:

  • Arguments - JSON-encoded arguments for the tool

  • Name - Name of the MCP tool requiring approval

  • ServerLabel - Label of the MCP server

Example:


Streaming Events (Deltas)

Delta<ITextChunk>

Fired during text streaming, including chat responses, reasoning, and transcription.

Text Types:

  • Message - Standard message text

  • Reasoning - Reasoning/thinking text

  • ReasoningSummary - Summary of reasoning

  • InputTranscript - Transcribed user input

Example:

Delta<IImageChunk>

Fired when image data is received (streaming or complete).

Delta<IAudioChunk>

Fired when audio data is received (streaming or complete).

Delta<IAnnotationChunk>

Fired when content annotations are received (citations, references, etc.).


Audio Events

AudioBufferStateChanged

Fired when the audio buffer state changes (for Realtime API).

State Values:

  • Committed - Audio buffer committed

  • Cleared - Audio buffer cleared

  • SpeechStarted - Speech detection started

  • SpeechStopped - Speech detection stopped

  • TimeoutTriggered - VAD timeout triggered

Example:

AudioRateLimitsUpdated

Fired when audio rate limits are updated (for Realtime API).

Example:


Metadata Events

Usage

Fired when token usage information is available.

Example:

Exception

Fired when an error occurs during agent operations.


Event Interfaces

If you prefer interface-based event handling, implement IAgentEventListener:


Event Summary Table

Event
Category
Description

AgentStatusChanged

Agent

Agent operational status changes

ConversationCreated

Conversation

New conversation created

ConversationLoaded

Conversation

Conversation loaded from storage

ConversationDeleted

Conversation

Conversation deleted

ConversationTitleUpdated

Conversation

Conversation title changed

ConversationSummaryUpdated

Conversation

Conversation summary changed

ConversationItemsLoaded

Conversation

Conversation messages loaded

ConversationListLoaded

Conversation

List of conversations retrieved

ToolCall

Tool

Tool invocation by agent

ToolStatusEvent

Tool

Tool execution status update

ToolOutputEvent

Tool

Tool execution result

McpApprovalRequest

Tool

MCP tool approval request

Delta<ITextChunk>

Streaming

Text streaming updates

Delta<IImageChunk>

Streaming

Image data updates

Delta<IAudioChunk>

Streaming

Audio data updates

Delta<IAnnotationChunk>

Streaming

Content annotation updates

AudioBufferStateChanged

Audio

Audio buffer state changes

AudioRateLimitsUpdated

Audio

Rate limit updates

Usage

Metadata

Token usage information

Exception

Metadata

Error events


Next Steps

Last updated