AgentResponse<State> class final

The completed result of a turn. Mirrors GenerateResponse and adds the agent fields (snapshotId, state, artifacts).

Constructors

AgentResponse.forTesting(AgentOutput raw, List<Message> messages)
Test-only constructor for building a response directly from a raw AgentOutput and message list, bypassing a transport turn.

Properties

artifacts List<Artifact>
no setter
data Object?
no setter
error AgentErrorInfo?
The structured error on a failed response, or null otherwise. A caller can branch on error.status and rerun the (persisted) snapshot.
no setter
finishMessage String?
no setter
finishReason AgentFinishReason
no setter
hashCode int
The hash code for this object.
no setterinherited
interrupts List<AgentInterrupt>
no setter
media Media?
no setter
message Message?
no setter
messages List<Message>
no setter
raw AgentOutput
no setter
reasoning String
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?
no setter
state → State?
no setter
text String
no setter
toolRequests List<ToolRequestPart>
no setter

Methods

assertValid() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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