By definition, single_turn is one user question followed by one agent response (possibly with multiple ReAct / reasoning steps internally). It makes sense to add min_tool_calls to SingleTurnAgentBuilder - the agent could decide to conclude after just 1 tool call if it thinks it has enough information. A min_tool_calls for single-turn could force it to call more , which would be desirable for certain scenarios
- Ensure richer training data with more tool usage examples
- Prevent the agent from taking shortcuts on complex scenarios
Current single-turn flow:
With min_tool_calls, it would continue the ReAct loop until that minimum is met, similar to how multi-turn prevents early conclusion. Implementation would be straightforward - in SingleTurnAgentBuilder.generate() around line 256, where it checks if step.is_final or not step.tool_calls, you'd add a check like:
total_tool_calls = sum(len(s.tool_calls) for s in all_steps)
if (step.is_final or not step.tool_calls) and total_tool_calls >= self.config.min_tool_calls:
break
By definition,
single_turnis one user question followed by one agent response (possibly with multiple ReAct / reasoning steps internally). It makes sense to addmin_tool_callstoSingleTurnAgentBuilder- the agent could decide to conclude after just 1 tool call if it thinks it has enough information. A min_tool_calls for single-turn could force it to call more , which would be desirable for certain scenariosCurrent single-turn flow:
With min_tool_calls, it would continue the ReAct loop until that minimum is met, similar to how multi-turn prevents early conclusion. Implementation would be straightforward - in
SingleTurnAgentBuilder.generate()around line 256, where it checks if step.is_final or not step.tool_calls, you'd add a check like: