Skip to content

min_tool_calls should be added to single_turn #552

@lukehinds

Description

@lukehinds

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions