AgentChat<State> class final

A stateful conversation with an agent. Tracks state across turns so callers do not have to thread snapshotId/state by hand.

Properties

artifacts List<Artifact>
The artifacts accumulated across this conversation.
no setter
hashCode int
The hash code for this object.
no setterinherited
messages List<Message>
The running message history of this conversation.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String?
Stable identifier correlating snapshots/turns of this conversation.
no setter
snapshotId String?
The snapshot id tracked across turns of this conversation.
no setter
state → State?
no setter

Methods

abort({Map<String, dynamic>? context}) Future<SnapshotStatus?>
Aborts the current snapshot.
detach({String? text, Message? message, List<ToolResponsePart>? respond, List<ToolRequestPart>? restart, Map<String, dynamic>? context}) Future<DetachedTask<State>>
Submits a detached (background) turn. Requires a store.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resume({List<ToolResponsePart>? respond, List<ToolRequestPart>? restart, CancellationToken? cancel, Map<String, dynamic>? context}) Future<AgentResponse<State>>
Resumes after an interrupt. Sugar for send with only the resume params.
resumeStream({List<ToolResponsePart>? respond, List<ToolRequestPart>? restart, CancellationToken? cancel, Map<String, dynamic>? context}) AgentTurn<State>
Streaming resume. Sugar for sendStream with only the resume params.
send({String? text, Message? message, List<ToolResponsePart>? respond, List<ToolRequestPart>? restart, CancellationToken? cancel, Map<String, dynamic>? context}) Future<AgentResponse<State>>
Runs a single turn and resolves with the completed AgentResponse.
sendStream({String? text, Message? message, List<ToolResponsePart>? respond, List<ToolRequestPart>? restart, CancellationToken? cancel, Map<String, dynamic>? context}) AgentTurn<State>
Runs a single turn and returns an AgentTurn exposing .stream and .response.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited