You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/agents.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -630,12 +630,12 @@ try:
630
630
agent.run_sync('Please call the tool twice', usage_limits=UsageLimits(tool_calls_limit=1))
631
631
except UsageLimitExceeded as e:
632
632
print(e)
633
-
#> The next tool call would exceed the tool_calls_limit of 1 (tool_calls=1)
633
+
#> The next tool call(s) would exceed the tool_calls_limit of 1 (tool_calls=2).
634
634
```
635
635
636
636
!!! note
637
637
- Usage limits are especially relevant if you've registered many tools. Use `request_limit` to bound the number of model turns, and `tool_calls_limit` to cap the number of successful tool executions within a run.
638
-
- These limits are enforced at the final stage before the LLM is called. If your limits are stricter than your retry settings, the usage limitwill be reached before all retries are attempted.
638
+
- The `tool_calls_limit` is checked before executing tool calls. If the model returns parallel tool calls that would exceed the limit, no tools will be executed.
0 commit comments