File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -961,7 +961,10 @@ async def _check_for_final_output_from_tools(
961961 context_wrapper : RunContextWrapper [TContext ],
962962 config : RunConfig ,
963963 ) -> ToolsToFinalOutputResult :
964- """Returns (i, final_output)."""
964+ """Determine if tool results should produce a final output.
965+ Returns:
966+ ToolsToFinalOutputResult: Indicates whether final output is ready, and the output value.
967+ """
965968 if not tool_results :
966969 return _NOT_FINAL_OUTPUT
967970
Original file line number Diff line number Diff line change @@ -205,8 +205,9 @@ class Agent(AgentBase, Generic[TContext]):
205205 This lets you configure how tool use is handled.
206206 - "run_llm_again": The default behavior. Tools are run, and then the LLM receives the results
207207 and gets to respond.
208- - "stop_on_first_tool": The output of the first tool call is used as the final output. This
209- means that the LLM does not process the result of the tool call.
208+ - "stop_on_first_tool": The output from the first tool call is treated as the final result.
209+ In other words, it isn’t sent back to the LLM for further processing but is used directly
210+ as the final output.
210211 - A StopAtTools object: The agent will stop running if any of the tools listed in
211212 `stop_at_tool_names` is called.
212213 The final output will be the output of the first matching tool call.
You can’t perform that action at this time.
0 commit comments