From a1d8f3c398b4ae86a65ddbcbae6beb98c43c9b87 Mon Sep 17 00:00:00 2001 From: RolandJAAI <38503289+RolandJAAI@users.noreply.github.com> Date: Thu, 16 Jan 2025 23:00:11 +0100 Subject: [PATCH] fix tool example with additional args (#228) --- docs/source/en/tutorials/tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/en/tutorials/tools.md b/docs/source/en/tutorials/tools.md index 41556fa33..5e6ced36a 100644 --- a/docs/source/en/tutorials/tools.md +++ b/docs/source/en/tutorials/tools.md @@ -131,7 +131,7 @@ And voilà, here's your image! 🏖️ -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 @@ -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'} ) ```