Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.ai.agent_thread.event

Module Contents

AgentErrorEvent

class roboto.ai.agent_thread.event.AgentErrorEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Signals that message generation failed or was cancelled.

Parameters

data Any

Attributes

AgentErrorEvent.error_code

error_code str | None = None #

Optional error code for programmatic handling.

AgentErrorEvent.error_message

error_message str #

User-friendly error message describing what went wrong.

AgentEvent

type roboto.ai.agent_thread.event.AgentEvent = typing.Union[AgentStartTextEvent, AgentTextDeltaEvent, AgentTextEndEvent, AgentToolUseEvent, AgentToolResultEvent, AgentErrorEvent]#View Source

AgentStartTextEvent

class roboto.ai.agent_thread.event.AgentStartTextEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Signals the beginning of text generation in a chat response.

Parameters

data Any

AgentTextDeltaEvent

class roboto.ai.agent_thread.event.AgentTextDeltaEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Contains incremental text content as the AI generates its response.

Parameters

data Any

Attributes

AgentTextDeltaEvent.text

text str #

Text fragment from the streaming response.

AgentTextEndEvent

class roboto.ai.agent_thread.event.AgentTextEndEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Signals the completion of text generation in a chat response.

Parameters

data Any

AgentToolResultEvent

class roboto.ai.agent_thread.event.AgentToolResultEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Contains the result of a tool invocation.

Parameters

data Any

Attributes

AgentToolResultEvent.name

name str #

Name of the tool that was invoked.

AgentToolResultEvent.output

output dict[str, Any] | None = None #

Raw tool output payload (from the underlying tool_result’s raw_response). May be None for errored invocations or for tools that return no data.

AgentToolResultEvent.runtime_ms

runtime_ms int | None = None #

Wall-clock execution time of the tool in milliseconds, as reported by the tool-result content. None only if the underlying content omits it.

AgentToolResultEvent.success

success bool #

Whether the tool invocation succeeded.

AgentToolResultEvent.tool_use_id

tool_use_id str #

Unique identifier for this tool invocation.

AgentToolUseEvent

class roboto.ai.agent_thread.event.AgentToolUseEvent(/, **data)#View Source

Bases: pydantic.BaseModel

Signals that the AI is invoking a tool to gather information.

Parameters

data Any

Attributes

AgentToolUseEvent.input

input dict[str, Any] | None = None #

Parsed tool input parameters chosen by the LLM.

AgentToolUseEvent.name

name str #

Name of the tool being invoked.

AgentToolUseEvent.tool_use_id

tool_use_id str #

Unique identifier for this tool invocation.

Was this page helpful?