Skip to main content

Core Types

The Agent User Interaction Protocol Python SDK is built on a set of core types that represent the fundamental structures used throughout the system. This page documents these types and their properties.

RunAgentInput

from ag_ui.core import RunAgentInput Input parameters for running an agent. In the HTTP API, this is the body of the POST request. tools contains tools provided by the client for this run. Backend-defined tools should remain in the backend agent or framework configuration, and may be advertised separately through agent capabilities.

ResumeEntry

from ag_ui.core import ResumeEntry One per-interrupt response inside RunAgentInput.resume, addressing an interrupt from the previous run. See Interrupts for the full resume contract.
metadata follows the same conventions as metadata everywhere else in the protocol: open by key, any JSON value allowed under a key including None, the object itself absent or a mapping but never null on the wire, and the ag-ui key reserved. A resume entry is a request field, so nothing merges into it; see Metadata.

Message Types

The SDK includes several message types that represent different kinds of messages in the system.
Every message type carries an optional metadata object (Optional[Dict[str, Any]]), and so does ToolCall. Both are omitted from the per-type tables below for brevity. It is open by key — any JSON value is allowed under a key, including None — and the object itself may be absent but is never None. The ag-ui key is reserved for AG-UI’s own use. Metadata accumulates as a message is built from its events, and tool call events accumulate onto the tool call itself; see Metadata for the merge rules.

Role

from ag_ui.core import Role Represents the possible roles a message sender can have.

DeveloperMessage

from ag_ui.core import DeveloperMessage Represents a message from a developer.

SystemMessage

from ag_ui.core import SystemMessage Represents a system message.

AssistantMessage

from ag_ui.core import AssistantMessage Represents a message from an assistant.

UserMessage

from ag_ui.core import UserMessage Represents a message from a user.

InputContentSource

Represents how a non-text part is supplied.

TextInputContent

Represents a text fragment inside a multimodal user message.

BinaryInputContent

Represents binary data such as images, audio, or files.
Validation: At least one of id, url, or data must be provided. Deprecated: BinaryInputContent remains available as a temporary compatibility model. Prefer modality-specific parts below.

ImageInputContent / AudioInputContent / VideoInputContent / DocumentInputContent

ToolMessage

from ag_ui.core import ToolMessage Represents a message from a tool.

ActivityMessage

from ag_ui.core import ActivityMessage Represents structured activity progress emitted between chat messages.

ReasoningMessage

from ag_ui.core import ReasoningMessage Represents a reasoning/thinking message from an agent’s internal thought process.

Message

from ag_ui.core import Message A union type representing any type of message in the system.

ToolCall

from ag_ui.core import ToolCall Represents a tool call made by an agent.

FunctionCall

from ag_ui.core import FunctionCall Represents function name and arguments in a tool call.

Context

from ag_ui.core import Context Represents a piece of contextual information provided to an agent.

Tool

from ag_ui.core import Tool Defines a tool that can be called by an agent.

State

from ag_ui.core import State Represents the state of an agent during execution.
The state type is flexible and can hold any data structure needed by the agent implementation.