AGUI.Abstractions Types
AGUI.Abstractions contains the protocol model shared by AG-UI .NET clients
and servers. The JSON wire names are camel-case and match the AG-UI protocol.
RunAgentInput
RunAgentInput is the request payload for running an agent. In the HTTP API, it
is the body of the POST request.
AGUIResume
One per-interrupt response insideRunAgentInput.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 null, the
object itself absent or an object but never null on the wire, and the
ag-ui key (AGUIMetadata.ReservedKey) reserved. A resume entry is a request
field, so nothing merges into it; see
Metadata. For non-tool interrupts, the
hosting layer carries it onto InterruptResponseContent.Metadata, and
AGUIChatClient copies it from InterruptResponseContent onto the entry it
sends. Tool-approval entries are translated through MEAI’s own approval
content types, which have no metadata surface — read it from the raw entry via
RunAgentInput.Resume if you need it there.
Message Types
Messages form a closed hierarchy rooted atAGUIMessage. The base type carries
only the fields shared by every role: Id, Role and Metadata. Role-specific
properties such as content, name, encryptedValue, toolCalls, and
toolCallId are declared on the sealed role classes.
Metadata (JsonElement?, JSON field metadata) is carried by every message
role and by AGUIToolCall, and is omitted from the tables below for brevity.
It is open by key — any JSON value is allowed under a key, including null —
and the object itself may be absent but is never null.
AGUIMetadata.ReservedKey ("ag-ui") 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.Roles
TheRole property returns one of the lowercase constants in AGUIRoles:
AGUIDeveloperMessage
AGUISystemMessage
AGUIAssistantMessage
AGUIUserMessage
AGUIUserMessage.Content is an AGUIContent value. It models the AG-UI
wire union string | InputContent[].
AGUIContent supports implicit conversions from string,
List<AGUIInputContent>, and AGUIInputContent[]. It also has a collection
builder, so C# collection expressions work. For reading, it implements
IReadOnlyList<AGUIInputContent>; a plain string is exposed as one
AGUITextInputContent part.
See Multimodal Inputs for the
AGUIInputContent hierarchy.
AGUIToolMessage
AGUIActivityMessage
AGUIReasoningMessage
AGUIToolCall
AGUIToolCallFunction has Name (name) and Arguments (arguments).
Context
AGUIContext represents a piece of contextual information provided to an agent.
Tool
AGUITool defines a tool that an agent can call.
State
State is represented asJsonElement? on RunAgentInput.State and as
JsonElement payloads in StateSnapshotEvent and StateDeltaEvent.
AgentCapabilities
AgentCapabilities is a structured declaration that an agent can expose so
clients can discover what it supports. All fields are optional.
See Capabilities for protocol-level concepts and
usage patterns.
Serialization
All protocol types are registered inAGUIJsonSerializerContext, a
source-generated JsonSerializerContext. Use it when serializing protocol
types in AOT-sensitive code.