Releases: huggingface/smolagents
Releases · huggingface/smolagents
v1.23.0
Improvements ✨
- Update final answer checks to accept the agent instance by @Zoe14 in #1648
- Dialog mode CLI by @aymeric-roucher in #1540
- Add Blaxel support for remote code execution by @Joffref in #1791
- Proposition: Add exponential backoff with jitter for retries by @suryabdev in #1829
- Cut generation at stop sequence post generation by @aymeric-roucher in #1802
- Move executor type validation to python executor creation by @Lrakotoson in #1800
- Support custom Python code executor in CodeAgent by @albertvillanova in #1707
- Retry on rate limit errors by @aymeric-roucher in #1801
- Change default InferenceClient model to Qwen/Qwen3-Next-80B-A3B-Thinking by @suryabdev in #1813
- Remove 'Server' from model names in doc by @aymeric-roucher in #1812
- Optimize comprehension evaluation with generator-based approach in LocalPythonExecutor by @albertvillanova in #1824
- LocalPythonExecutor: Add support for nested dictcomp and setcomp by @suryabdev in #1823
- Support parsing
anyOffrom MCP tools by @duguyue100 in #1708 - Add Modal as sandbox option to docs front page by @sandcat100 in #1865
- make additional_args nullable for managed agents by @nflo in #1827
- vLLM: Move from guided_options_request to structured_outputs by @suryabdev in #1805
Fixes 🛠️
- Fix agent logs: logging "None" and simplify the logic by @albertvillanova in #1788
- Fix dict(message) bug in AgentMemory.replay for ChatMessage objects by @Flakes342 in #1763
- Fix LocalPythonExecutor support for Enum and other metaclasses by @colesmcintosh in #1797
- Handle
Nonecontent in stop-sequence trimming by @chahn in #1826 - Fix minor benchmark script bugs by @suryabdev in #1822
- Fix YAML scanner error when building documentation by @albertvillanova in #1841
- Pin huggingface-hub <1.0.0 to fix failed to build tokenizers by @albertvillanova in #1844
- Fixed SyntaxError format: keep exception type and message on same line (#835) by @balazsthomay in #1864
- Fix CLI Tool.from_space() call by auto-generating name and description (#1535) by @balazsthomay in #1859
- Add gpt-5.1 support by @suryabdev in #1868
- bug: role not converted back to enum by @njbrake in #1833
- Parallel tool calls lose OpenTelemetry context: tool spans not nested under agent step by @Barcavin in #1840
Documentation 📚
- Bump dev version: v1.23.0.dev0 by @albertvillanova in #1787
- 🌐 [i18n-KO] Translated memory.md to Korean by @HyunZ118 in #1793
- 🌐 [i18n-KO] Translated
using_different_models.mdto Korean by @FacerAin in #1772 - 🌐 [i18n-KO] Translated
guided_tour.mdto Korean by @FacerAin in #1711 - 🌐 [i18n-KO] Translated
async_agent.mdto Korean by @FacerAin in #1749 - 🌐 [i18n-KO] Translated
agents.mdto Korean by @Kim-Ju-won in #1720 - 🌐 [i18n-KO] Translated
rag.mdto Korean by @Kim-Ju-won in #1646 - Documentation: Minor fixes by @suryabdev in #1809
- 🌐 [i18n-KO] Translated
web_browser.mdto Korean by @FacerAin in #1748 - [i18n-es] Translating docs to spanish by @1-echo in #1806
- 🌐 [i18n-KO] Translated
plan_customization.mdto Korean by @FacerAin in #1771 - 🌐 [i18n-KO] Translated
inspect_runs.mdto Korean by @FacerAin in #1747 - Build PR documentation for all languages by @albertvillanova in #1842
Full Changelog: v1.22.0...v1.23.0
v1.22.0
What's Changed
- Bump dev version: v1.22.0.dev0 by @albertvillanova in #1657
- refactor(PythonExecutor): inherit from ABC and declare abstract methods by @HairlessVillager in #1654
- Fix error for GPT-5 not supporting the
stopparameter by @Xmader in #1662 - Enable return_full_result directly in run method by @aymeric-roucher in #1658
- Make RunResult json serializable by @aymeric-roucher in #1659
- Change truncation to remove end rather than middle by @aymeric-roucher in #1665
- Document that model kwargs are forwarded to model completion call by @albertvillanova in #1679
- Fix missing kwargs forward to vLLM model generate call by @albertvillanova in #1680
- Raise RuntimeError with LiteLLM response details if no choices by @albertvillanova in #1683
- Fix AmazonBedrockModel with reasoning/thinking content by @albertvillanova in #1681
- Fix installation command in README by quoting extra by @shahgahmed in #1685
- CI hotfix: Pin openai < 1.100.0 for litellm extra by @albertvillanova in #1693
- Support openai 1.100 for litellm extra by @albertvillanova in #1698
- Pin telemetry extra >=0.1.15 to use new TokenUsage structure by @albertvillanova in #1699
- Add AGENTS.md by @albertvillanova in #1701
- Test telemetry extra by @albertvillanova in #1700
- Replace slim with bullseye base image in Docker executor by @albertvillanova in #1702
- fix: error missing f-string by @njbrake in #1691
- Support custom Dockerfile in DockerExecutor by @albertvillanova in #1705
- Support MCP structured output and output schema by @chahn in #1663
- Improve agent image handling by @aaron-ang in #1601
- 🌐 [i18n-KO] Translated
multiagents.mdto Korean by @pyapyapya in #1644 - Fix CI 403 error for Wikipedia page in test_visit_webpage by @albertvillanova in #1716
- fix typos in the system prompt by @Frame17 in #1710
- Fix pip install commands by quoting extras by @albertvillanova in #1690
- Fix deprecation warning about parameter messages by @albertvillanova in #1718
- Fix warning about parameter max_new_tokens by @albertvillanova in #1721
- Adds Modal Remote Executor by @thomasjpfan in #1722
- Fix formatting of title in translation section of documentation by @albertvillanova in #1727
- Remove untranslated sections from the documentation by @albertvillanova in #1729
- fix: add ipykernel in dockerfile of prebuilt docker executor by @cyyeh in #1731
- Fix E2BExecutor by pinning e2b-code-interpreter to < 2 by @albertvillanova in #1733
- Fix DockerExecutor connection reset error with server readiness check by @benoriol in #1684
- [i18n-KO] Translated building_good_agents.md to Korean by @FacerAin in #1714
- 🌐 [i18n-KO] Translated installation.md to Korean by @FacerAin in #1647
- Support e2b-code-interpreter v2 by @August-murr in #1751
- Fix token count initialization when plan_message.token_usage is None by @satwikkansal in #1752
- Support user-configurable parameter override for model completion parameters by @albertvillanova in #1678
- Fix error for grok-4/grok-3-mini not supporting the stop parameter by @suryabdev in #1766
- Replace DockerExecutor Dockerfile with file object by @albertvillanova in #1738
- Update documentation to clarify
instructionsare appended by @chahn in #1709 - 🌐 [i18n-KO] Translated
react.mdto Korean by @nsbg in #1666 - Pass tools_to_call_from to TransformersModel._prepare_completion_kwargs by @albertvillanova in #1782
- 🌐 [i18n-KO] Translated
models.mdto Korean by @Kim-Ju-won in #1776 - Fix AttributeError when trying to log a None by @albertvillanova in #1786
- fix(agent): remove unused get_variable_names function by @keli-wen in #1784
- Fix XPath injection in search_item_ctrl_f by @albertvillanova in #1768
- Use context manager for per-operation websocket connection in DockerExecutor by @albertvillanova in #1750
New Contributors
- @Xmader made their first contribution in #1662
- @shahgahmed made their first contribution in #1685
- @aaron-ang made their first contribution in #1601
- @pyapyapya made their first contribution in #1644
- @Frame17 made their first contribution in #1710
- @cyyeh made their first contribution in #1731
- @satwikkansal made their first contribution in #1752
- @suryabdev made their first contribution in #1766
- @Kim-Ju-won made their first contribution in #1776
- @keli-wen made their first contribution in #1784
Full Changelog: v1.21.3...v1.22.0
v1.21.3
Bug Fixes 🐛
- Fix E2BExecutor by pinning e2b-code-interpreter to < 2 by @albertvillanova in #1733
Full Changelog: v1.21.2...v1.21.3
v1.21.2
Bug Fixes 🐛
- Pin telemetry extra >=0.1.15 to use new TokenUsage structure by @albertvillanova in #1699
Full Changelog: v1.21.1...v1.21.2
v1.21.1
Bug Fixes 🐛
Full Changelog: v1.21.0...v1.21.1
v1.21.0
Enhancements ✨
-
Tool & Model Improvements
- Add Tool to_code_prompt and to_tool_calling_prompt by @albertvillanova in #1599
- Improve function body extraction in tools by @HairlessVillager in #1627
- Support passing model_kwargs to TransformersModel by @albertvillanova in #1608
- Support dict messages as direct input to models by @albertvillanova in #1570
-
Executor Improvements
- Enhance
LocalPythonExecutorsecurity by blocking dunder calls by @nnfrog in #1551 - Fix
continuesemantics ofLocalPythonExecutorby @adaminsky in #1645 - Fix
GeneratorExpinLocalPythonExecutorto returnGeneratorinstead oflistby @albertvillanova in #1650
- Enhance
-
Gradio & UI
- Reset agent memory on GradioUI clear button by @albertvillanova in #1611
- Use
gr.Numberfor mapping integer and number type components inlaunch_gradio_demoby @karenwky in #1320
Bug Fixes 🐛
- Fix: Prevent empty additional_args from being added to agent prompt by @jokokojote in #1566
- Fix SyntaxError in generated Gradio app due to 'class' attribute by @albertvillanova in #1615
- Fix serialization inconsistency in MultiStepAgent.to_dict/from_dict for managed_agents by @hazrmard in #1577
- Fix a kwargs error in LocalPythonExecutor by @aymeric-roucher in #1583
- Fix structured outputs by @MicrosoftJames in #1642
- Fix bug where
AmazonBedrockServerModelcrashes in thinking mode by @benoriol in #1632 - Fix: Remove duplicate line in
tool_calling_agentprompt by @yusuf-eren in #1636 - Fix:
RemotePythonExecutorshould not send variables if none exist by @thomasjpfan in #1605 - Disable parallel tool calls for final answer by @aymeric-roucher in #1539
Documentation 📚
- Improve Installation docs with uv option by @albertvillanova in #1550
- Fix and improve MCP server security warnings in docs by @albertvillanova in #1549
- DOC: Fix image link for docs (secure_code_execution.md) by @FacerAin in #1582
- Update title of page "What are agents" by @aymeric-roucher in #1546
- Enable multilingual docs by @albertvillanova in #1633
- 🌐 [i18n-KO] Translated
index.mdto Korean by @FacerAin in #1581 - 🌐 [i18n-KO] Translated
text_to_sql.mdto Korean by @nsbg in #1603
CI / Dependency Updates 🧪
- Pin mcpadapt to support image/audio content by @albertvillanova in #1558
- Temporarily skip wrongly implemented tests by @albertvillanova in #1571
- CI hotfix: Pin mlx < 0.26.5 by @albertvillanova in #1586
- Support mlx-0.26.5 by @albertvillanova in #1589
- CI hotfix: Pin transformers < 4.54.0 by @albertvillanova in #1620
- Support transformers 4.54.0 by @albertvillanova in #1625
- Fix CI PytestUnknownMarkWarning: Unknown pytest.mark.timeout by @albertvillanova in #1630
- Fix CI quality: remove trailing whitespace by @albertvillanova in #1617
Deprecations & Cleanups 🧹
- Replace deprecated ast.Num and ast.Str with ast.Constant in tool validation by @WilliamRabuel in #1594
- Remove deprecated
grammarparameter by @albertvillanova in #1651 - Remove deprecated token count attributes by @albertvillanova in #1652
- Remove deprecated agent
logsattribute by @albertvillanova in #1653 - Remove mention of deprecated
ManagedAgentfrom docs by @albertvillanova in #1655 - Remove deprecated default
ssetransport by @albertvillanova in #1656 - Replace duckduckgo_search with ddgs to address package rename warning by @WilliamRabuel in #1593
- Remove unused is_same_item function by @albertvillanova in #1631
- Remove unnecessary import by @rahul-1729 in #1639
- Simplify _is_package_available by @albertvillanova in #1641
Miscellaneous 🔧
- Add support for Amazon Bedrock API Keys by @colesmcintosh in #1612
- Factorize create_agent_gradio_app_template function by @albertvillanova in #1616
- Fix: Allow passing integers for floats by @aymeric-roucher in #1623
- Fix Tool.forward to raise NotImplementedError instead of returning by @HairlessVillager in #1628
- Make validate_tool_arguments raise instead of returning error string by @albertvillanova in #1634
- Remove mention of python in additional args by @aymeric-roucher in #1584
- ToolCallingAgent: remove unnecessary addition to
model_outputby @aymeric-roucher in #1622 - Minor fix in toolCallingAgentPrompt by @rahul-1729 in #1574
Maintenance 🏗️
- Bump dev version: v1.21.0.dev0 by @albertvillanova in #1544
- Remove empty issue template by @albertvillanova in #1562
- Improve issue templates by @albertvillanova in #1563
- Add issue template for documentation improvements by @albertvillanova in #1564
- Add uv option to CONTRIBUTING by @albertvillanova in #1561
New Contributors
- @jokokojote made their first contribution in #1566
- @rahul-1729 made their first contribution in #1574
- @WilliamRabuel made their first contribution in #1594
- @FacerAin made their first contribution in #1582
- @thomasjpfan made their first contribution in #1605
- @hazrmard made their first contribution in #1577
- @HairlessVillager made their first contribution in #1628
- @benoriol made their first contribution in #1632
- @yusuf-eren made their first contribution in #1636
- @nnfrog made their first contribution in #1551
- @nsbg made their first contribution in #1603
- @karenwky made their first contribution in #1320
- @MicrosoftJames made their first contribution in #1642
- @adaminsky made their first contribution in #1645
Full Changelog: v1.20.0...v1.21.0
v1.20.0
New Features ✨
-
Remote Execution:
- Implement remote Python WasmExecutor by @albertvillanova in #1261
-
Callbacks:
- Support callbacks after planning step by @albertvillanova in #1445
- Support multiple callbacks per step type in step_callbacks dict by @albertvillanova in #1517
Enhancements 🛠️
-
Models:
- Implement rate limiting in all API models by @albertvillanova in #1516
-
Tools:
- Implement exception mechanism for final answer in remote executors by @tobiasofsn in #1429
- Set default api_key_name in ApiWebSearchTool by @albertvillanova in #1507
- Implement rate limit mechanism in ApiWebSearchTool by @albertvillanova in #1508
- Implement rate limit mechanism in DuckDuckGoSearchTool by @albertvillanova in #1515
- Enable image output for Tool.from_space by @aymeric-roucher in #1510
- Add adapter_kwargs parameter to MCPClient by @LucasDltg in #1528
-
Validation of Tool Arguments:
- Support multiple types in tool arguments validation by @duguyue100 in #1505
- Fix input type validation when input schema has multiple types by @duguyue100 in #1530
- Fix optional args toolcalling by @aymeric-roucher in #1538
-
Agent Output Formatting:
- Implement CodeOutput as analog to ToolOutput by @albertvillanova in #1496
- Allow markdown or custom formatting for code blocks by @aymeric-roucher in #1493
-
Other:
Bug Fixes 🐛
- Fix
KeyErrorwhen agent reaches max steps with image input by @robin-ede in #1525 - Fix when
response.usageisNonefor some OpenRouter models by @sentienthouseplant in #1402 - Fix incorrect token counting in streaming TransformersModel by @albertvillanova in #1503
- Minor fix nested quotes that prevent execution by @vinoo-ganesh-keru in #1497
- Fix ChatMessage attribute access after replacing dict with dataclass by @albertvillanova in #1534
- Fix access of
contentfield inChatMessageby @mdr223 in #1533 - Fix parallel final answers handling by @aymeric-roucher in #1482
Documentation Improvements 📚
-
Examples & Tutorials:
- Add complete Plan Customization example by @albertvillanova in #1506
- Add Async App with Agent example by @albertvillanova in #1509
- Improve Plan Customization example with Human-in-the-Loop by @albertvillanova in #1513
-
API References:
- Fix docstring of WikipediaSearchTool by @albertvillanova in #1521
- Explain rate_limit in tools docstrings by @albertvillanova in #1519
- Fix Examples in AmazonBedrockServerModel docstring by @albertvillanova in #1522
- Split Built-in Tools from Tools in Reference docs by @albertvillanova in #1520
-
Other:
- Update Langfuse tracing documentation to SDK v3 by @jannikmaierhoefer in #1447
- Fix use of context manager agent in docs by @albertvillanova in #1502
Maintenance 🏗️
- Fix CI LiteLLM test_call_different_providers_without_key by @albertvillanova in #1527
- Fix test_send_tools_with_default_wikipedia_search_tool by @albertvillanova in #1494
- Fix DockerExecutor tests with final_answer by calling send_tools by @albertvillanova in #1495
- Bump dev version: v1.20.0.dev0 by @albertvillanova in #1477
New Contributors
- @sentienthouseplant made their first contribution in #1402
- @daavoo made their first contribution in #1479
- @duguyue100 made their first contribution in #1505
- @vinoo-ganesh-keru made their first contribution in #1497
- @robin-ede made their first contribution in #1525
- @LucasDltg made their first contribution in #1528
- @mdr223 made their first contribution in #1533
Full Changelog: v1.19.0...v1.20.0
v1.19.0
Enhancements 🛠️
-
Agent Upgrades:
- Support managed agents in ToolCallingAgent by @albertvillanova in #1456
- Support context managers for agent cleanup by @tobiasofsn in #1422
- Change code tags to xml by @aymeric-roucher in #1442
-
UI Improvements:
-
Streaming Refactor:
- Transfer aggregation of streaming events off the Model class by @aymeric-roucher in #1449
-
Agent Output Tracking:
- Store CodeAgent code outputs in ActionStep by @aymeric-roucher in #1463
Bug Fixes 🐛
- Fix Agent update planning logic by @Zoe14 in #1417
- Remove plural from named argument return_full_results in examples by @vladlen32230 in #1434
- Fix and refactor final answer checks by @aymeric-roucher in #1448
- Fix logging of Docker build logs by @tobiasofsn in #1421
- Add a mention of additional_args in the manager agent's prompt by @aymeric-roucher in #1441
- Fix missing mentions of additional_args in manager agent prompts by @albertvillanova in #1459
- Fix:
__new__method only accepts class object, remove **args and **kw… by @abdulhakkeempa in #1462 - Do not wrap types in safer_func by @albertvillanova in #1475
- Match multiline final answers in remote executors by @albertvillanova in #1444
- Revert removal of the last message from memory_messages during planning by @Zoe14 in #1454
Documentation Improvements 📚
-
Quickstart Enhancements:
- Add simple tool usage in doc quickstart by @aymeric-roucher in #1470
- Add open-colab link to Quickstart docs by @albertvillanova in #1472
-
Reference Docs:
- Add AgentMemory to Reference docs by @albertvillanova in #1473
- Add docstrings to GradioUI by @albertvillanova in #1451
-
Fixes & Formatting:
- Correct broken link in documentation homepage by @johntony366 in #1468
- Rename docs files from .mdx to .md by @albertvillanova in #1471
Maintenance 🏗️
- Bump dev version: v1.19.0.dev0 by @albertvillanova in #1427
New Contributors
- @Zoe14 made their first contribution in #1417
- @vladlen32230 made their first contribution in #1434
- @JakeBx made their first contribution in #1420
- @abdulhakkeempa made their first contribution in #1462
- @johntony366 made their first contribution in #1468
Full Changelog: v1.18.0...v1.19.0
v1.18.0
New Features ✨
- Multiple Parallel Tool Calls: ToolCallingAgent can now handle multiple tool calls in parallel, significantly enhancing performance for complex tasks.
- Support multiple tool calls in parallel in ToolCallingAgent by @albertvillanova in #1412
- Streaming Output for ToolCallingAgent: ToolCallingAgent now supports streaming outputs, improving responsiveness and user experience during multi-step tool interactions
- Streaming outputs for ToolCallingAgent 🚀 by @aymeric-roucher in #1409
- API Web Search Tool: Introduced a new ApiWebSearchTool, enabling structured web search capabilities via API.
- Create API web search tool by @albertvillanova in #1400
Enhancements 🛠️
- Update prompts to avoid confusion: search -> web_search and wiki -> wiki_search by @SrzStephen in #1403
- Make Agent.system_prompt read only by @albertvillanova in #1399
- Support configurable tool_choice in prepare_completion_kwargs by @albertvillanova in #1392
- Support passing additional params to MLXModel load and tokenizer.apply_chat_template by @albertvillanova in #1406
- Support custom headers/params for ApiWebSearchTool by @albertvillanova in #1411
Bug Fixes 🐛
- Fix: Support custom inputs execution for custom Final Answer Tool by @Lrakotoson in #1383
- Fix @tool decorator for remote Python executor by @tobiasofsn in #1334
- Always pass add_generation_prompt=True to apply_chat_template by @albertvillanova in #1416
Documentation Improvements 📚
- Make docs neutral about agent types by @julien-c in #1376
- Add MCP tools doc section by @aymeric-roucher in #1394
- Update ToolCollection.from_mcp docstring examples by @neonwatty in #1398
- Document better final_answer_checks by @albertvillanova in #1407
- Fix typo in secure code execution documentation by @chahn in #1414
- Add chat server demo to examples by @albertvillanova in #1415
- Fix VLM model in web_browser example docs by @albertvillanova in #1424
- Fix ValueError on Guided Tour docs by @albertvillanova in #1425
- Explain agent types better in Guided tour docs by @albertvillanova in #1426
- Add Quickstart page to docs by @albertvillanova in #1413
Maintenance 🏗️
- Bump dev version: v1.18.0.dev0 by @albertvillanova in #1390
New Contributors
- @Lrakotoson made their first contribution in #1383
- @neonwatty made their first contribution in #1398
- @SrzStephen made their first contribution in #1403
- @chahn made their first contribution in #1414
Full Changelog: v1.17.0...v1.18.0
v1.17.0
New Features ✨
- Structured Generation in CodeAgent: Add optional support for structured outputs in
CodeAgent, enabling more reliable and consistent generation patterns- Adding optional structured generation to CodeAgent by @akseljoonas in #1346
- Support for Streamable HTTP MCP Servers: Expand compatibility with new server types to support streamable HTTP MCP implementations
- Support Streamable HTTP MCP servers by @albertvillanova in #1384
- Run Results from
Agent.run(): TheAgent.run()method can now return aRunResultobject, providing richer metadata on agent execution- Agent.run() can return RunResult object by @aymeric-roucher in #1337
Security Enhancements 🔒
- Safer LocalPythonExecutor: Prevent indirect submodule access via attribute resolution, mitigating potential security risks in user-defined code
- Prevent submodules through indirect attribute access in LocalPythonExecutor by @albertvillanova in #1375
Enhancements 🛠️
- LocalPythonExecutor Enhancements:
- Support annotated assignments within class definition in LocalPythonExecutor by @albertvillanova in #1355
- Fix evaluate_class_def for Assign Attribute target in LocalPythonExecutor by @albertvillanova in #1357
- Support 'pass' statement in class definition in LocalPythonExecutor by @albertvillanova in #1358
- Refactor tests of LocalPythonExecutor by @albertvillanova in #1356
- Improve LaTeX rendering in GradioUI with extended delimiter support by @albertvillanova in #1387
Bug Fixes 🐛
- Streaming fixes
- Fix live streaming when generating planning steps by @FlorianVal in #1348
- Stop streaming if LiteLLM provide a finish_reason by @FlorianVal in #1350
- add api_base and api_keys to preparation of kwargs for generate stream by @FlorianVal in #1344
- Fix WebSearchTool validation error by @albertvillanova in #1367
- Fix smolagents benchmark by @aymeric-roucher in #1377
Documentation Improvements 📚
- Add example docs about using OpenRouter models by @albertvillanova in #1364
- Fix Llama model name in docs example by @SaiDunoyer in #1379
- fix typo in docstring in mcp_client.py by @grll in #1380
- Document use_structured_outputs_internally with version added by @albertvillanova in #1388
- Fix rendering of version added in docs by @albertvillanova in #1389
- Fix broken link in agentic RAG examples page by @vksx in #1363
Maintenance 🏗️
- Bump dev version: v1.17.0.dev0 by @albertvillanova in #1336
- Remove deprecated from_hf_api methods by @albertvillanova in #1351
New Contributors
- @FlorianVal made their first contribution in #1344
- @vksx made their first contribution in #1363
- @akseljoonas made their first contribution in #1346
- @SaiDunoyer made their first contribution in #1379
Full Changelog: v1.16.1...v1.17.0