Skip to content

Commit 9b4db7a

Browse files
Remove await from usage.incr() in tool manager
The incr() method is synchronous (uses threading.Lock), not async, so we should not await it.
1 parent 70cb245 commit 9b4db7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydantic_ai_slim/pydantic_ai/_tool_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ async def _call_function_tool(
234234
) as span:
235235
try:
236236
tool_result = await self._call_tool(call, allow_partial, wrap_validation_errors)
237-
await usage.incr(RunUsage(tool_calls=1))
237+
usage.incr(RunUsage(tool_calls=1))
238238

239239
except ToolRetryError as e:
240240
part = e.tool_retry

0 commit comments

Comments
 (0)