Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for pydantic tool calling with a single argument #13522

Merged
merged 1 commit into from
May 15, 2024

Conversation

logan-markewich
Copy link
Collaborator

Pydantic classes/tools will not work with positional arguments, so we need some kind of fallback to handle this case.

Fixes #13518

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 15, 2024
Copy link
Contributor

@nerdai nerdai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Only thing I wonder is if there is a specific Exception we can catch that leads to trying with "kwargs" execution.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 15, 2024
@logan-markewich
Copy link
Collaborator Author

logan-markewich commented May 15, 2024

I think there could be a specific pydantic error to catch, but I casted a wider net to ensure bases were covered beyond pydantic 😅

@nerdai
Copy link
Contributor

nerdai commented May 15, 2024

Makes sense to me. Thanks!

@logan-markewich logan-markewich merged commit e5ca11f into main May 15, 2024
8 checks passed
@logan-markewich logan-markewich deleted the logan/fix_pydantic_tool_call_single_arg branch May 15, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Parameter mismatch in _get_function_tool.<locals>.model_fn()
2 participants