-
Notifications
You must be signed in to change notification settings - Fork 31.3k
Tool calling: support more types #35776
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
Conversation
7229894 to
b4b319a
Compare
|
However setting NoneType to @Rocketknight1 I noticed some of your chat templates are missing the handling of |
|
Seconding @CISC's comment, I don't think we can use |
|
That's updated @Rocketknight1 ! Thanks to you and @CISC for your feedback! 🤗 |
Rocketknight1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…on-schema-types' into tool-calling-add-json-schema-types
* Tool calling: support NoneType for function return type
* Tool calling: support NoneType for function return type
What does this PR do?
Adds more supported types in chat templates.
Why not use an empty type for "any"?
=> Sometimes users want to specify a type hint like this:
=> In that case, I think it makes it more explicit to have the type hint being precised in the json schema as "any" rather than left empty as is currently the case.
I don't know if these changes are compatible with the current usage of chat template in transformers (in particular, maybe some models are trained with the convention to let the type for 'Any' blank), but they allow finer definition of inputs which is useful for using transformers chat templates in
smolagents. Let me know if this is an appropriate change @Rocketknight1!