8000 fix: creating tool should not affect function that is being wrapped by njbrake · Pull Request #1203 · huggingface/smolagents · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: creating tool should not affect function that is being wrapped #1203

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 3 commits into from
Apr 16, 2025

Conversation

njbrake
Copy link
Contributor
@njbrake njbrake commented Apr 15, 2025

This PR addresses the bug where calling tool(a_function) was editing the function signature of the the function that was passed in. Instead of this, the function should be wrapped so that the smolagents code doesn't affect the function that was provided.

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 addressing this issue!

Could you please add a test to cover this change? It would help ensure we don't regress in the future.

@njbrake njbrake changed the title Update tools.py fix: creating tool should not affect function that is being wrapped Apr 16, 2025
@njbrake njbrake requested a review from albertvillanova April 16, 2025 12:35
@njbrake
Copy link
Contributor Author
njbrake commented Apr 16, 2025

Thanks @albertvillanova! I've added a unit test that should take care of your concerns 👍 .

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.

Thank you. I think you forgot to check the code quality:

make style

@njbrake njbrake requested a review from albertvillanova April 16, 2025 13:45
@albertvillanova albertvillanova linked an issue Apr 16, 2025 that may be closed by this pull request
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.

Great catch! Thanks for spotting and fixing this!

@albertvillanova albertvillanova merged commit 073cfeb into huggingface:main Apr 16, 2025
3 checks passed
@njbrake njbrake deleted the patch-1 branch April 16, 2025 14:12
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.

Smolagents replacing function signature of an imported tool
2 participants
0