Skip to content

Commit 0f8ba07

Browse files
committed
docs: revise docs to align with updated semantics
1 parent 81a4aab commit 0f8ba07

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ except UsageLimitExceeded as e:
618618

619619
##### Capping tool calls
620620

621-
If you need a precise guardrail on the number of tool invocations within a single run (including retries that actually re-execute the tool), use `tool_calls_limit`:
621+
If you need a limit on the number of successful tool invocations within a single run, use `tool_calls_limit`:
622622

623623
```py
624624
from pydantic_ai import Agent
@@ -640,7 +640,7 @@ except UsageLimitExceeded as e:
640640
```
641641

642642
!!! note
643-
- 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 exact number of successful tool executions within a run.
643+
- 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.
644644
- These limits are enforced at the final stage before the LLM is called. If your limits are stricter than your retry settings, the usage limit will be reached before all retries are attempted.
645645

646646
#### Model (Run) Settings

docs/tools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,8 +1036,8 @@ When a model returns multiple tool calls in one response, Pydantic AI schedules
10361036

10371037
Async functions are run on the event loop, while sync functions are offloaded to threads. To get the best performance, _always_ use an async function _unless_ you're doing blocking I/O (and there's no way to use a non-blocking library instead) or CPU-bound work (like `numpy` or `scikit-learn` operations), so that simple functions are not offloaded to threads unnecessarily.
10381038

1039-
!!! note "Limiting exact tool executions"
1040-
You can cap the exact number of tool executions within a run using `UsageLimits(tool_calls_limit=...)`. The counter increments after each successful tool invocation. Note that output tools (used for structured output) are not counted in the `tool_calls` metric.
1039+
!!! note "Limiting tool executions"
1040+
You can cap tool executions within a run using `UsageLimits(tool_calls_limit=...)`. The counter increments only after a successful tool invocation. Output tools (used for structured output) are not counted in the `tool_calls` metric.
10411041

10421042
## Third-Party Tools
10431043

0 commit comments

Comments
 (0)