From 59eb951d4f28c3ec9768175c14f67e433d01f168 Mon Sep 17 00:00:00 2001 From: Surya Balakrishnan Date: Wed, 15 Oct 2025 06:01:50 +0000 Subject: [PATCH 1/5] Fix 'ChatMessage' object is not iterable --- examples/smolagents_benchmark/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/smolagents_benchmark/run.py b/examples/smolagents_benchmark/run.py index 424ed4a77..3fa221e1e 100644 --- a/examples/smolagents_benchmark/run.py +++ b/examples/smolagents_benchmark/run.py @@ -158,7 +158,7 @@ def answer_single_question(example, model, answers_file, action_type): # Run agent 🚀 answer = str(agent.run(augmented_question)) token_counts = agent.monitor.get_total_token_counts() - intermediate_steps = [dict(message) for message in agent.write_memory_to_messages()] + intermediate_steps = [message.dict() for message in agent.write_memory_to_messages()] end_time = time.time() except Exception as e: From c9f7068d1a86d28997e249c97d5813c15b279274 Mon Sep 17 00:00:00 2001 From: Surya Balakrishnan Date: Wed, 15 Oct 2025 06:28:00 +0000 Subject: [PATCH 2/5] Remove additional_authorized_imports from ToolCallingAgent --- examples/smolagents_benchmark/run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/smolagents_benchmark/run.py b/examples/smolagents_benchmark/run.py index 3fa221e1e..baa074933 100644 --- a/examples/smolagents_benchmark/run.py +++ b/examples/smolagents_benchmark/run.py @@ -137,7 +137,6 @@ def answer_single_question(example, model, answers_file, action_type): agent = ToolCallingAgent( tools=[GoogleSearchTool(provider="serper"), VisitWebpageTool(), PythonInterpreterTool()], model=model, - additional_authorized_imports=["numpy", "sympy"], max_steps=10, ) From 9387a66e7a65dafc53e8de47eaf7461b04b07ab0 Mon Sep 17 00:00:00 2001 From: Surya Balakrishnan Date: Wed, 15 Oct 2025 08:52:00 +0000 Subject: [PATCH 3/5] Remove default InferenceClient provider --- examples/smolagents_benchmark/run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/smolagents_benchmark/run.py b/examples/smolagents_benchmark/run.py index baa074933..b66d01f3d 100644 --- a/examples/smolagents_benchmark/run.py +++ b/examples/smolagents_benchmark/run.py @@ -60,7 +60,6 @@ def parse_arguments(): parser.add_argument( "--provider", type=str, - default="hf-inference", help="The provider for InferenceClientModel - will not be used for LiteLLMModel", ) parser.add_argument( From fddf812b8018da367e423203e69734cc81870b60 Mon Sep 17 00:00:00 2001 From: Surya Balakrishnan Date: Wed, 15 Oct 2025 08:58:06 +0000 Subject: [PATCH 4/5] Fix datetime import error --- examples/smolagents_benchmark/score.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/smolagents_benchmark/score.ipynb b/examples/smolagents_benchmark/score.ipynb index d81906481..42b8a89b1 100644 --- a/examples/smolagents_benchmark/score.ipynb +++ b/examples/smolagents_benchmark/score.ipynb @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ "import string\n", "import warnings\n", "from concurrent.futures import ThreadPoolExecutor, as_completed\n", - "from datetime import datetime\n", + "import datetime\n", "\n", "import numpy as np\n", "from tqdm import tqdm\n", From 7c59cee6e16df06672af47f1c06a86ec633b60d8 Mon Sep 17 00:00:00 2001 From: Surya Balakrishnan Date: Thu, 16 Oct 2025 04:34:10 +0000 Subject: [PATCH 5/5] Add authorized_imports to ToolCallingAgent's PythonInterpreterTool --- examples/smolagents_benchmark/run.py | 6 +++++- examples/smolagents_benchmark/score.ipynb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/smolagents_benchmark/run.py b/examples/smolagents_benchmark/run.py index b66d01f3d..aa8e48570 100644 --- a/examples/smolagents_benchmark/run.py +++ b/examples/smolagents_benchmark/run.py @@ -134,7 +134,11 @@ def answer_single_question(example, model, answers_file, action_type): ) elif action_type == "tool-calling": agent = ToolCallingAgent( - tools=[GoogleSearchTool(provider="serper"), VisitWebpageTool(), PythonInterpreterTool()], + tools=[ + GoogleSearchTool(provider="serper"), + VisitWebpageTool(), + PythonInterpreterTool(authorized_imports=["numpy", "sympy"]), + ], model=model, max_steps=10, ) diff --git a/examples/smolagents_benchmark/score.ipynb b/examples/smolagents_benchmark/score.ipynb index 42b8a89b1..7d8709498 100644 --- a/examples/smolagents_benchmark/score.ipynb +++ b/examples/smolagents_benchmark/score.ipynb @@ -49,11 +49,11 @@ "metadata": {}, "outputs": [], "source": [ + "import datetime\n", "import re\n", "import string\n", "import warnings\n", "from concurrent.futures import ThreadPoolExecutor, as_completed\n", - "import datetime\n", "\n", "import numpy as np\n", "from tqdm import tqdm\n",