Skip to main content

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.

Message Types

Messages form a closed hierarchy rooted at AGUIMessage. The base type carries only the fields shared by every role: Id and Role. Role-specific properties such as content, name, encryptedValue, toolCalls, and toolCallId are declared on the sealed role classes.

Roles

The Role property returns one of the lowercase constants in AGUIRoles:

AGUIDeveloperMessage

AGUISystemMessage

AGUIAssistantMessage

AGUIUserMessage

AGUIUserMessage.Content is an AGUIUserContent value. It models the AG-UI wire union string | InputContent[].
AGUIUserContent 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 as JsonElement? on RunAgentInput.State and as JsonElement payloads in StateSnapshotEvent and StateDeltaEvent.
The schema of the state is defined by the agent. The protocol only carries it.

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 in AGUIJsonSerializerContext, a source-generated JsonSerializerContext. Use it when serializing protocol types in AOT-sensitive code.