Skip to content

Commit 9a7ab83

Browse files
committed
fix: allow 'functools.partial' as tool func
Closes #2787.
1 parent 8f28c34 commit 9a7ab83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pydantic_ai_slim/pydantic_ai/_function_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def function_schema( # noqa: C901
9999
errors: list[str] = []
100100

101101
try:
102-
sig = signature(function)
102+
sig = signature(function, follow_wrapped=False)
103103
except ValueError as e:
104104
errors.append(str(e))
105105
sig = signature(lambda: None)
@@ -244,7 +244,7 @@ def _takes_ctx(function: TargetFunc[P, R]) -> TypeIs[WithCtx[P, R]]:
244244
`True` if the function takes a `RunContext` as first argument, `False` otherwise.
245245
"""
246246
try:
247-
sig = signature(function)
247+
sig = signature(function, follow_wrapped=False)
248248
except ValueError: # pragma: no cover
249249
return False # pragma: no cover
250250
try:

0 commit comments

Comments
 (0)