-
Notifications
You must be signed in to change notification settings - Fork 77
feat: add MelleaTool.from_smolagents() for smolagents integration #430
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
feat: add MelleaTool.from_smolagents() for smolagents integration #430
Conversation
Implements loading of HuggingFace smolagents tools into Mellea's tool system. - Add from_huggingface() classmethod to MelleaTool - Uses smolagents' get_tool_json_schema() for OpenAI-compatible conversion - Wraps smolagents Tool.forward() method with proper error handling - Add smolagents as optional dependency in pyproject.toml - Update .gitignore to exclude AI agent config directories Related to generative-computing#411 Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Add comprehensive unit tests for the HuggingFace smolagents integration: - test_from_huggingface_basic: Tests basic tool loading and schema conversion - test_from_huggingface_multiple_inputs: Tests tools with multiple parameters - test_from_huggingface_invalid_tool: Tests error handling for invalid objects Tests follow existing patterns with try/except ImportError for graceful handling when smolagents is not installed. Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
- Add smolagents_example.py demonstrating MelleaTool.from_huggingface() - Update tools/README.md with smolagents example documentation - Add smolagents installation instructions to main README.md Related: generative-computing#411 Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
jakelorocco
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.
thank you! looks good to me; just one note on packages
Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
|
IIUC the following items are the remaining review and take-aways:
|
Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
|
I've addressed all current review and opened #453 for follow up work around |
psschwei
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
0471006
Misc PR
Type of PR
Description
Adds support for using HuggingFace smolagents tools with Mellea, enabling seamless integration with the smolagents ecosystem.
Testing