docs: document Agent run metadata, runtime exit_conditions, SearchableToolset notes, and MockChatGenerator#11873
Draft
julian-risch wants to merge 4 commits into
Draft
docs: document Agent run metadata, runtime exit_conditions, SearchableToolset notes, and MockChatGenerator#11873julian-risch wants to merge 4 commits into
julian-risch wants to merge 4 commits into
Conversation
…hatGenerator Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 5, 2026
…d state keys Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removed redundant wording and improved clarity in the overview section of MockChatGenerator documentation.
julian-risch
commented
Jul 7, 2026
| - `system_prompt`: A plain string or Jinja2 template used as the system message for every run. If the template contains Jinja2 variables, those variables become additional inputs to `run()`. | ||
| - `user_prompt`: A Jinja2 template appended to the user-provided messages on each run. Template variables become additional inputs to `run()`. Use `required_variables` to enforce which variables must be provided. | ||
| - `exit_conditions`: List of conditions that cause the agent to stop. Use `”text”` to stop when the LLM replies without a tool call, or a tool name to stop once that tool has been executed. Defaults to `[“text”]`. | ||
| - `exit_conditions`: List of conditions that cause the agent to stop. Use `”text”` to stop when the LLM replies without a tool call, or a tool name to stop once that tool has been executed. Defaults to `[“text”]`. Exit conditions are evaluated at runtime rather than validated at initialization, so a condition can name a tool that is only loaded later — for example, a tool passed at runtime via `run(tools=...)` or one discovered by a [`SearchableToolset`](../../tools/searchabletoolset.mdx). |
Member
Author
There was a problem hiding this comment.
The addition could also be left out.
julian-risch
commented
Jul 7, 2026
| `chat_generator` is the only mandatory parameter — an instance of a Chat Generator that supports tools. All other parameters are optional. | ||
|
|
||
| - `tools`: A list of tool or toolset instances the agent can call. Supported types: [`Tool`](../../tools/tool.mdx), [`ComponentTool`](../../tools/componenttool.mdx), [`PipelineTool`](../../tools/pipelinetool.mdx), [`MCPTool`](../../tools/mcptool.mdx), [`Toolset`](../../tools/toolset.mdx), [`MCPToolset`](../../tools/mcptoolset.mdx), [`SearchableToolset`](../../tools/searchabletoolset.mdx). | ||
| - `tools`: A list of tool or toolset instances the agent can call. Supported types: [`Tool`](../../tools/tool.mdx), [`ComponentTool`](../../tools/componenttool.mdx), [`PipelineTool`](../../tools/pipelinetool.mdx), [`MCPTool`](../../tools/mcptool.mdx), [`Toolset`](../../tools/toolset.mdx), [`MCPToolset`](../../tools/mcptoolset.mdx), [`SearchableToolset`](../../tools/searchabletoolset.mdx). Tool names must be unique; duplicate names are detected at the start of each agent step, before the chat generator is called. |
Member
Author
There was a problem hiding this comment.
The addition could also be left out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
step_count,token_usageandtool_call_countsin Agent'sState#11427Agentaround usingSearchableToolset#11557catalog=Toolset#11549Proposed Changes:
step_count,token_usageandtool_call_countsin Agent'sState#11427 —Agentdocs: the result dictionary now lists the auto-populatedstep_count,token_usage, andtool_call_countsoutputs, with a new "Run Metadata" section explaining that they are readable mid-run by tools viainputs_from_state, are outputs only, and are reservedstate_schemakeys. TheStatepage mentions "Reserved keys" covering all Agent-managed keys: the three run-metadata keys plus the hook-facingcontinue_run,tools, andhook_context.Agentaround usingSearchableToolset#11557 —Agent/SearchableToolsetdocs:exit_conditionsis now described as evaluated at runtime, so conditions can name tools loaded later . Duplicate tool names are detected at the start of each agent step, and a new "Warm-up" section on theSearchableToolsetpage notes that constructing anAgentno longer warms up the toolset (warm-up happens viaAgent.warm_up()or at run time).catalog=Toolset#11549 —SearchableToolsetdocs:warm_up()raises aValueErrorwhen the catalog contains tools with duplicate names. Folded into the new "Warm-up" section.MockChatGeneratorpage covering the four response modes (fixed, cycling,response_fn, echo default),model/meta/streaming_callbackparameters, and usage examples. Added to the sidebar and the Generators overview table.How did you test it?
token_usage/step_count/tool_call_countsoutput shapes were executed against thev3code.Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.🤖 Generated with Claude Code