File tree Expand file tree Collapse file tree
docs-website/reference/haystack-api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,6 +351,10 @@ Process messages and execute tools until an exit condition is met.
351351- "token_usage": Aggregated token usage from every LLM call in the run, summed from each LLM message's
352352 ` meta["usage"] ` .
353353- "tool_call_counts": Mapping of tool name to the number of times that tool was invoked.
354+ - "exit_reason": Why the Agent stopped, useful for routing the output downstream (e.g. with a
355+ ` ConditionalRouter ` ). One of: ` "text" ` (the model returned a reply with no tool calls), the name of
356+ the tool that satisfied a tool exit condition (in which case ` last_message ` is that tool's result),
357+ or ` "max_agent_steps" ` (the Agent hit ` max_agent_steps ` before meeting an exit condition).
354358- Any additional keys defined in the ` state_schema ` .
355359
356360#### run_async
@@ -399,6 +403,10 @@ if available.
399403- "token_usage": Aggregated token usage from every LLM call in the run, summed from each LLM message's
400404 ` meta["usage"] ` .
401405- "tool_call_counts": Mapping of tool name to the number of times that tool was invoked.
406+ - "exit_reason": Why the Agent stopped, useful for routing the output downstream (e.g. with a
407+ ` ConditionalRouter ` ). One of: ` "text" ` (the model returned a reply with no tool calls), the name of
408+ the tool that satisfied a tool exit condition (in which case ` last_message ` is that tool's result),
409+ or ` "max_agent_steps" ` (the Agent hit ` max_agent_steps ` before meeting an exit condition).
402410- Any additional keys defined in the ` state_schema ` .
403411
404412## state/state
You can’t perform that action at this time.
0 commit comments