AgentState class
Immutable snapshot of an agent's current state.
Used for serialization, monitoring, and inter-agent communication.
Constructors
- AgentState({required String id, required AgentRole role, AgentStatus status = AgentStatus.idle, String? currentTaskId, DateTime? lastActivity})
- Creates a new agent state snapshot.
-
AgentState.fromJson(Map<
String, dynamic> json) -
Deserializes an agent state from a JSON map.
factory
Properties
- currentTaskId ↔ String?
-
ID of the task being processed, if any.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier of the agent.
final
- lastActivity ↔ DateTime
-
Timestamp of the agent's last recorded activity.
getter/setter pair
- role → AgentRole
-
The role this agent fulfills.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ AgentStatus
-
Current operational status.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this state to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited