Package akka.javasdk.agent.autonomous
Class AgentState
Object
akka.javasdk.agent.autonomous.AgentState
Summary of an autonomous agent's current state.
Not for user extension or instantiation, returned by the SDK component client.
-
Constructor Summary
ConstructorsConstructorDescriptionAgentState(String phase, boolean suspended, String instructions, AutonomousAgent.TokenUsage totalTokenUsage, Optional<TaskKey> currentTask, List<String> pendingTaskIds) Deprecated, for removal: This API element is subject to removal in a future version.AgentState(String phase, boolean suspended, String instructions, AutonomousAgent.TokenUsage totalTokenUsage, Optional<TaskKey> currentTask, List<String> pendingTaskIds, List<MessageState> pendingMessages, List<MessageState> recentMessages) -
Method Summary
Modifier and TypeMethodDescriptionThe task currently being worked on, if any.The agent's current instructions.The messages that clients sent withAutonomousAgentClient.sendMessage(AgentMessage)and that wait for the model, in arrival order.The ids of tasks that are pending (queued but not yet started).phase()The current phase of the agent's execution loop: "idle", "advance" (determining the next unit of work), "model" (a model call is in progress), "tools" (tool calls are executing), or "stopped".The most recent messages that clients sent withAutonomousAgentClient.sendMessage(AgentMessage)and that the agent consumed or dropped, oldest first.booleanWhether the agent is currently suspended.Total token usage for this agent instance.
-
Constructor Details
-
AgentState
public AgentState(String phase, boolean suspended, String instructions, AutonomousAgent.TokenUsage totalTokenUsage, Optional<TaskKey> currentTask, List<String> pendingTaskIds, List<MessageState> pendingMessages, List<MessageState> recentMessages) -
AgentState
@Deprecated(since="3.7.3", forRemoval=true) public AgentState(String phase, boolean suspended, String instructions, AutonomousAgent.TokenUsage totalTokenUsage, Optional<TaskKey> currentTask, List<String> pendingTaskIds) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
phase
The current phase of the agent's execution loop: "idle", "advance" (determining the next unit of work), "model" (a model call is in progress), "tools" (tool calls are executing), or "stopped". -
suspended
public boolean suspended()Whether the agent is currently suspended. -
instructions
The agent's current instructions. -
totalTokenUsage
Total token usage for this agent instance. -
currentTask
The task currently being worked on, if any. -
pendingTaskIds
The ids of tasks that are pending (queued but not yet started). -
pendingMessages
The messages that clients sent withAutonomousAgentClient.sendMessage(AgentMessage)and that wait for the model, in arrival order. The status isMessageStatus.ForCurrentTaskorMessageStatus.Held, orMessageStatus.Unknownfor a status from a newer runtime. -
recentMessages
The most recent messages that clients sent withAutonomousAgentClient.sendMessage(AgentMessage)and that the agent consumed or dropped, oldest first. The status isMessageStatus.ConsumedorMessageStatus.Dropped, orMessageStatus.Unknownfor a status from a newer runtime. A retry with one of these ids gets this status.
-
AgentState(String, boolean, String, AutonomousAgent.TokenUsage, Optional, List, List, List).