AgentStatus

org.llm4s.agent.AgentStatus

How an agent's turn ended, or why it is waiting.

Attributes

Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

final case class Blocked(guardrail: String, reason: String)

A guardrail refused the turn: guardrail is the first failing guardrail's name, reason every failure's error. An input block stores nothing of the turn; an output block removes it - the query, any tool calls and the answer - so messages is the history from before the turn. Usage keeps the turn's model calls. The thread is usable, and the next turn runs normally.

A guardrail refused the turn: guardrail is the first failing guardrail's name, reason every failure's error. An input block stores nothing of the turn; an output block removes it - the query, any tool calls and the answer - so messages is the history from before the turn. Usage keeps the turn's model calls. The thread is usable, and the next turn runs normally.

Attributes

final case class Completed(answer: String)

The active agent gave a final answer; answer is its content.

The active agent gave a final answer; answer is its content.

Attributes

The turn used the active agent's maxSteps model calls without a final answer.

The turn used the active agent's maxSteps model calls without a final answer.

Attributes

final case class Suspended(approvals: Vector[(InterruptId, ApprovalRequest)], questions: Vector[(InterruptId, ToolQuestionRequest)], middlewareQuestions: Vector[(InterruptId, MiddlewareQuestionRequest)], breakpoints: Vector[(InterruptId, BreakpointRequest)], delegated: Vector[(InterruptId, DelegatedRequest)])

The turn is parked on tool approvals, tool questions, middleware questions and static breakpoints, each keyed by its interrupt id. Answer them - any non-empty subset at a time - with AgentResult.approve, AgentResult.reject and AgentResult.edit (approvals), AgentResult.reply (a tool's or a middleware's question, with its answer type) and AgentResult.proceed (breakpoints), and continue with Agent.resume; unanswered ones stay pending.

The turn is parked on tool approvals, tool questions, middleware questions and static breakpoints, each keyed by its interrupt id. Answer them - any non-empty subset at a time - with AgentResult.approve, AgentResult.reject and AgentResult.edit (approvals), AgentResult.reply (a tool's or a middleware's question, with its answer type) and AgentResult.proceed (breakpoints), and continue with Agent.resume; unanswered ones stay pending.

delegated lists the interrupts of suspended subagents (design 4.46), flattened: each child interrupt under the composite id <parent interrupt>~<child interrupt> (a grandchild's p~c~g), with the child run that waits. The same helpers answer them by that id, encoding the answer the child expects, and Agent.resume routes each to its child through the parent. A task call waiting on its child is listed only here, never in questions.

Attributes

The run used its token budget (RunBudgets.maxTokens) without a final answer: at the budget the turn ended before the next model call. The call in flight when the budget was crossed was not interrupted, so usage can exceed the budget by one call. Like StepLimitReached, a completed turn: the next turn, with its own budget, runs normally.

The run used its token budget (RunBudgets.maxTokens) without a final answer: at the budget the turn ended before the next model call. The call in flight when the budget was crossed was not interrupted, so usage can exceed the budget by one call. Like StepLimitReached, a completed turn: the next turn, with its own budget, runs normally.

Attributes