Skip to content

Commit

Permalink
fix tool example with additional args (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandJAAI authored Jan 16, 2025
1 parent a4ec1e5 commit a1d8f3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/en/tutorials/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ And voilà, here's your image! 🏖️

<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/sunny_beach.webp">

Then you can use this tool just like any other tool. For example, let's improve the prompt `a rabbit wearing a space suit` and generate an image of it.
Then you can use this tool just like any other tool. For example, let's improve the prompt `a rabbit wearing a space suit` and generate an image of it. This example also shows how you can pass additional arguments to the agent.

```python
from smolagents import CodeAgent, HfApiModel
Expand All @@ -140,7 +140,7 @@ model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct")
agent = CodeAgent(tools=[image_generation_tool], model=model)

agent.run(
"Improve this prompt, then generate an image of it.", prompt='A rabbit wearing a space suit'
"Improve this prompt, then generate an image of it.", additional_args={'user_prompt': 'A rabbit wearing a space suit'}
)
```

Expand Down

0 comments on commit a1d8f3c

Please sign in to comment.