Skip to content

Commit b3f7d05

Browse files
committed
fix: errors for earlier versions of pydantic-ai
1 parent 262c6c1 commit b3f7d05

File tree

1 file changed

+6
-10
lines changed
  • sentry_sdk/integrations/pydantic_ai/patches

1 file changed

+6
-10
lines changed

sentry_sdk/integrations/pydantic_ai/patches/tools.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def _patch_tool_execution():
4040
original_call_tool = ToolManager._call_tool
4141

4242
@wraps(original_call_tool)
43-
async def wrapped_call_tool(
44-
self, call, *, allow_partial, wrap_validation_errors, approved
45-
):
46-
# type: (Any, Any, bool, bool, bool) -> Any
43+
async def wrapped_call_tool(self, call, *args, **kwargs):
44+
# type: (Any, Any, *Any, **Any) -> Any
4745

4846
# Extract tool info before calling original
4947
name = call.tool_name
@@ -76,9 +74,8 @@ async def wrapped_call_tool(
7674
result = await original_call_tool(
7775
self,
7876
call,
79-
allow_partial=allow_partial,
80-
wrap_validation_errors=wrap_validation_errors,
81-
approved=approved,
77+
*args,
78+
**kwargs,
8279
)
8380
update_execute_tool_span(span, result)
8481
return result
@@ -90,9 +87,8 @@ async def wrapped_call_tool(
9087
return await original_call_tool(
9188
self,
9289
call,
93-
allow_partial=allow_partial,
94-
wrap_validation_errors=wrap_validation_errors,
95-
approved=approved,
90+
*args,
91+
**kwargs,
9692
)
9793

9894
ToolManager._call_tool = wrapped_call_tool

0 commit comments

Comments
 (0)