Skip to content

Commit 268e23c

Browse files
HaystackBotsjrl
andauthored
docs: sync Haystack API reference on Docusaurus (#12091)
Co-authored-by: sjrl <10526848+sjrl@users.noreply.github.com>
1 parent a6fa8c8 commit 268e23c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs-website/reference/haystack-api/agents_api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)