8000 Change: expanded error exception for incorrect tool parameters by cgthayer · Pull Request #1099 · huggingface/smolagents · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Change: expanded error exception for incorrect tool parameters #1099

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

Conversation

cgthayer
Copy link
Contributor
@cgthayer cgthayer commented Mar 29, 2025

Previously, a bad version of forward() in a tool would report an exception like:

Exception: In tool 'user_input', 'forward' method should take 'self' as its first argument, then its next arguments should match the keys of tool attribute 'inputs'.

Now, I've explicitly included the expected and actual parameters. I also hope this made the code clearer.

Exception: In tool 'user_input', 'forward' method parameters were {'prompt'}, but expected {'question'}. It should take 'self' as its first argument, then its next arguments should match the keys of tool attribute 'inputs'.

The code passes make test and make quality fwiw.

Thanks!

/charles

make quality
ruff check examples src tests utils
All checks passed!
ruff format --check examples src tests utils
63 files already formatted
python utils/check_tests_in_ci.py
✅ All good!

@aymeric-roucher aymeric-roucher merged commit 64a688f into huggingface:main Apr 2, 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.

2 participants
0