Skip to content

fix(core): support positional-only function tool args - #8340

Open
Junpei Zhang (pei711) wants to merge 1 commit into
microsoft:mainfrom
pei711:fix/functiontool-positional-only-args
Open

Junpei Zhang (pei711) wants to merge 1 commit into
microsoft:mainfrom
pei711:fix/functiontool-positional-only-args

Conversation

@pei711

Copy link
Copy Markdown

Why are these changes needed?

FunctionTool.run currently sends every validated argument as a keyword. Python rejects keyword calls for parameters declared positional-only, so otherwise valid run_json() calls raise TypeError. Preserve each parameter's calling convention for both sync and async functions, including positional-only cancellation-token injection.

Related issue number

Closes #8319

Checks

Local verification: autogen-core/tests/test_tools.py (43 passed), Ruff check, Ruff format check, and git diff --check.

@pei711

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FunctionTool raises TypeError for positional-only parameters after successful schema validation

1 participant