AgentState class final

Public agent state. Ported from pi's AgentState.

Assigning tools or messages copies the provided top-level list. The runtime fields (isStreaming, streamingMessage, pendingToolCalls, errorMessage) are read-only for consumers; the owning Agent mutates them as it processes loop events.

Constructors

AgentState({String systemPrompt = '', required Model model, List<Tool> tools = const [], List<Message> messages = const []})

Properties

errorMessage String?
Error message from the most recent failed or aborted assistant turn.
no setter
hashCode int
The hash code for this object.
no setterinherited
isStreaming bool
True while the agent is processing a prompt or continuation.
no setter
messages List<Message>
Conversation transcript. Assigning copies the list.
getter/setter pair
model Model
Active model used for future turns.
getter/setter pair
pendingToolCalls Set<String>
Tool call ids currently executing.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamingMessage Message?
Partial assistant message for the current streamed response, if any.
no setter
systemPrompt String
System prompt sent with each model request.
getter/setter pair
tools List<Tool>
Tools available to the model. Assigning copies the list.
getter/setter pair

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