TurnResult class

Result returned by a single turn handler passed to SessionRunner.run.

Returning a finishReason lets a custom agent explicitly state why the turn ended (e.g. interrupted, length). When omitted, no per-turn reason is reported.

Constructors

TurnResult({AgentFinishReason? finishReason, String? finishMessage, AgentErrorDetails? error})

Properties

error → AgentErrorDetails?
The structured error a failed turn ended with, or null otherwise.
final
finishMessage String?
An optional human-readable message describing why the turn ended.
final
finishReason AgentFinishReason?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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