8000 Clarify tool usage in agent step tutorial by albertvillanova · Pull Request #1175 · huggingface/smolagents · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Clarify tool usage in agent step tutorial #1175

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 11, 2025

Conversation

albertvillanova
Copy link
Member
@albertvillanova albertvillanova commented Apr 11, 2025

Clarify tool usage in agent step tutorial.

I would consider this as a hotfix needed to have the docs aligned with the code implementation. However, I think we should simplify the procedure.

Fix #1170.

Also related to:

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@@ -118,6 +118,8 @@ This will also let you update the memory on each step.
from smolagents import HfApiModel, CodeAgent, ActionStep, TaskStep

agent = CodeAgent(tools=[], model=HfApiModel(), verbosity_level=1)
# If tools are provided, you need to send them to the Python executor using `send_tools`.
# agent.python_executor.send_tools({**agent.tools})
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be uncommented I think?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right! 😅

@aymeric-roucher
Copy link
Collaborator

Thank you! Indeed it would be nice to simplify the procedure.
The idea of send_tools is to be able to update tools in case they've been modified in-between calls to agent.run() : so maybe we could include this send_tools method in agent.run()?

@albertvillanova albertvillanova merged commit d00ef7c into huggingface:main Apr 11, 2025
4 checks passed
@albertvillanova albertvillanova deleted the fix-1170 branch April 11, 2025 11:34
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.

[BUG] Step by Step vs run in tool use.
3 participants
0