8000 Support `Literal` type annotations in `@tool` for defining enums by stephanlensky · Pull Request #1195 · huggingface/smolagents · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support Literal type annotations in @tool for defining enums #1195

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

stephanlensky
Copy link
Contributor
@stephanlensky stephanlensky commented Apr 14, 2025

Allows defining enum choices with @tool using native Literal type annotations instead of via docstring.

Closes #1194.

This is my first contribution, so let me know if there is anything I can improve, thank you! 🙂

  • make quality passes
  • make tests passes
  • ✅ New tests added for the functionality

Copy link
Member
@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution and for taking the time to ensure quality and test coverage: much appreciated! 🤗

Everything looks great on my end. Looking forward to more contributions from you! 🙌

@albertvillanova albertvillanova merged commit a8f72aa into huggingface:main Apr 15, 2025
3 checks passed
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.

Support Literal type annotations in @tool for defining enums
2 participants
0