Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/fast_agent/agents/tool_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async def generate_impl(
tools = (await self.list_tools()).tools

iterations = 0
max_iterations = request_params.max_iterations if request_params and getattr(request_params, "max_iterations", None) is not None else DEFAULT_MAX_ITERATIONS

while True:
result = await super().generate_impl(
Expand All @@ -115,7 +116,7 @@ async def generate_impl(
break

iterations += 1
if iterations > DEFAULT_MAX_ITERATIONS:
if iterations > max_iterations:
logger.warning("Max iterations reached, stopping tool loop")
break
return result
Expand Down
Loading