diff --git a/docs-website/reference/haystack-api/agents_api.md b/docs-website/reference/haystack-api/agents_api.md index 39982df2b8..5de221c5bf 100644 --- a/docs-website/reference/haystack-api/agents_api.md +++ b/docs-website/reference/haystack-api/agents_api.md @@ -351,6 +351,10 @@ Process messages and execute tools until an exit condition is met. - "token_usage": Aggregated token usage from every LLM call in the run, summed from each LLM message's `meta["usage"]`. - "tool_call_counts": Mapping of tool name to the number of times that tool was invoked. +- "exit_reason": Why the Agent stopped, useful for routing the output downstream (e.g. with a + `ConditionalRouter`). One of: `"text"` (the model returned a reply with no tool calls), the name of + the tool that satisfied a tool exit condition (in which case `last_message` is that tool's result), + or `"max_agent_steps"` (the Agent hit `max_agent_steps` before meeting an exit condition). - Any additional keys defined in the `state_schema`. #### run_async @@ -399,6 +403,10 @@ if available. - "token_usage": Aggregated token usage from every LLM call in the run, summed from each LLM message's `meta["usage"]`. - "tool_call_counts": Mapping of tool name to the number of times that tool was invoked. +- "exit_reason": Why the Agent stopped, useful for routing the output downstream (e.g. with a + `ConditionalRouter`). One of: `"text"` (the model returned a reply with no tool calls), the name of + the tool that satisfied a tool exit condition (in which case `last_message` is that tool's result), + or `"max_agent_steps"` (the Agent hit `max_agent_steps` before meeting an exit condition). - Any additional keys defined in the `state_schema`. ## state/state