Commit Graph

89 Commits

Author SHA1 Message Date
Aymeric Roucher 8b02821ac2
Open Deep Research (#317)
* Create an open Deep Research

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>

---------

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>
2025-02-04 17:13:21 +01:00
Aymeric Roucher d69ae028fa
Simplify managed agents (#484)
* Simplify managed agents
2025-02-03 21:19:54 +01:00
Albert Villanova del Moral 183869de04
Fix SpeechToTextTool new instance (#478)
* Test SpeechToTextTool new instance

* Fix SpeechToTextTool new method
2025-02-03 11:42:03 +01:00
Albert Villanova del Moral cedf63cde7
Test get_clean_message_list (#448)
* Test get_clean_message_list

* Test get_clean_message_list
2025-01-31 13:47:02 +01:00
Aymeric Roucher f1a9b83443
Improve code execution logs in case of error by showing print outputs (#446)
* Improve code execution logs in case of error by still showing print outputs
* Improve action step testing
* Number steps starting at 1
2025-01-31 12:34:32 +01:00
Antoine Jeannot 10407813e8
Fix get safe module (#405)
* expose get_safe_module lazy loading issue

* fix get_safe_module lazy imports

* add six as explicit tests dependency

* log dangerous attributes

* refactor get_safe_module test
2025-01-31 08:25:22 +01:00
Albert Villanova del Moral 181a500c5d
Fix and test MemoryStep (#432)
* Test MemoryStep
* Remove unused MemoryStep.raw attribute
2025-01-30 21:24:39 +01:00
Albert Villanova del Moral 42d97716fe
Fix MultiStepAgent.planning_step message content (#437)
* Fix MultiStepAgent.planning_step message content
2025-01-30 21:18:30 +01:00
Aymeric Roucher fa1f8d0154
Add CLI for smolagents (#431)
---------

Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
2025-01-30 15:56:50 +01:00
Albert Villanova del Moral 595781b82d
Test memory (#428)
* Test memory

* Add memory tests to CI
2025-01-30 13:51:18 +01:00
Aymeric Roucher 20383f0914
Fix regressions, refactor logging and improve replay function (#419)
* Refactor logging and improve replay function

* Fix test

* Remode unnecessary dict method

* Remove logger import

---------

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>
2025-01-30 11:32:28 +01:00
Julien Chaumond d3912c70cf
Support third-party Inference providers in `HfApiModel` (#422)
* Add `provider` param to `HfApiModel `, update guided_tour.md

---------

Co-authored-by: Aymeric <aymeric.roucher@gmail.com>
2025-01-30 01:03:09 +01:00
Clémentine Fourrier c6eb9526f1
Untangling Logging (#316)
* Deep refacto that disentangled logging logic between logging (informing the user via console outputs) and memory (storing what happened in the agent).

---------

Co-authored-by: benediktstroebl <50178209+benediktstroebl@users.noreply.github.com>
Co-authored-by: Aymeric <aymeric.roucher@gmail.com>
2025-01-29 16:27:04 +01:00
Aymeric Roucher 7a2f300b2a
Add test for DDGS Tool kwargs (#387) 2025-01-28 11:02:21 +01:00
Aymeric Roucher ad5f84b101
Fix blocking of os in authorized imports (#386) 2025-01-28 11:00:43 +01:00
Aymeric Roucher a4f89b68b2
Add tool saving test (#389)
* Add tool saving test

* Format
2025-01-28 10:58:53 +01:00
Albert Villanova del Moral cc21135188
Test import without extras (#370)
* Test import without extras

* Add import test to CI

* Use uv run
2025-01-28 10:57:14 +01:00
Aymeric Roucher 49c34f625c
Gradio chatbot: step duration, number, token count, support nested thoughts (#384)
* Add enhanced Gradio UI with nested agents calls, execution-logs, errors
- Add virtual separation between steps
- Highlight final answer as required in internal discussion
- Show step numbers and token counts
- Include step duration tracking
- Improve message display structure
---------

Co-authored-by: Yuvraj Sharma <48665385+yvrjsharma@users.noreply.github.com>
2025-01-28 09:24:13 +01:00
Aymeric Roucher 4579a6f7cc
TransformersModel auto-detects VLMs (#378)
* TransformersModel auto-detects VLMs
2025-01-27 20:09:14 +01:00
Merve Noyan 408b52abec
Add VLM support (#220)
* vlm initial commit

* transformers integration for vlms

* Add webbrowser example and make it work 🥳🥳

* Refactor image support

* Allow modifying agent attributes in callback

* Improve vlm browser example

* time.sleep(0.5) before screenshot to let js animations happen

* test to validate internal workflow for passing images

* Update test_agents.py

* Improve error logging

* Switch to OpenAIServerModel

* Improve the example

* Format

* add docs about steps, callbacks & co

* Add precisions in doc

* Improve browser

* Tiny prompting update

* Fix style

* fix/add test

* refactor

* Fix write_inner_memory_from_logs for OpenAI format

* Add back summary mode

* Make it work with TransformersModel

* Fix test

* Fix loop

* Fix quality

* Fix mutable default argument

* Rename tool_response_message to error_message and append it

* Working browser with firefox

* Use flatten_messages_as_text passed to TransformersModel

* Fix quality

* Document flatten_messages_as_text in docstring

* Working ctrl + f in browser

* Make style

* Fix summary_mode type hint and add to docstring

* Move image functions to tools

* Update docstrings

* Fix type hint

* Fix typo

* Fix type hints

* Make callback call compatible with old single-argument functions

* Revert update_metrics to have a single arg

* Pass keyword args instead of args to callback

* Update webbrowser

* fix for single message case where final message list is empty

* forgot debugger lol

* accommodate VLM-like chat template and fix tests

* Improve example wording

* Style fixes

* clarify naming and fix tests

* test fix

* Fix style

* Add bm25 to fix one of the doc tests

* fix mocking in VL test

* fix bug in fallback

* add transformers model

* remove chrome dir from helium

* Update Transformers example with flatten_messages_as_text

* Add doc for flatten_messages_as_text

* Fix merge error

---------

Co-authored-by: Merve Noyan <mervenoyan@Merve-MacBook-Pro.local>
Co-authored-by: Aymeric <aymeric.roucher@gmail.com>
Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>
2025-01-24 17:01:35 +01:00
Albert Villanova del Moral 0ead477263
Refactor evaluate_augassign and test all operators (#313)
* Test all augassign operators

* Refactor evaluate_augassign
2025-01-22 14:59:09 +01:00
Antoine Jeannot 6196958deb
Fix: source code inspection in interactive shells (#281)
* Support interactive shells for source inspection
* Add tool save e2e tests
2025-01-22 13:43:16 +01:00
Aymeric Roucher 43904f32c7
Support any and none tool types (#280)
* Support any and none tool types
2025-01-22 12:47:05 +01:00
Nicholas Broad ec45d6766a
minor fix for console in AgentLogger (#303)
* minor fix for console in AgentLogger
2025-01-22 10:41:05 +01:00
Albert Villanova del Moral 0e0d73b096
Try first dunder method in evaluate_augassign (#285)
* Test evaluate_augassign
2025-01-21 10:41:25 +01:00
Albert Villanova del Moral a2b37caff1
Fix CI quality (#286) 2025-01-21 10:40:15 +01:00
tandiapa a4612c98dc
Fix (interpreter security): builtins functions passed as tools enable the use of compile, eval, exec (#274) 2025-01-20 17:06:47 +01:00
Aymeric Roucher 7a91123729
Improve python executor's error logging (#275)
* Improve python executor's error logging
2025-01-20 15:57:16 +01:00
Aymeric Roucher 3c18d4d588
Python interpreter: improve suggestions for possible mappings (#266) 2025-01-20 11:40:43 +01:00
Lucain d19ebc7a48
Make import time faster (optional deps + delay imports) (#253)
* adapt docs

* optional in pyproject.toml

* get rid of some transformers imports

* optional transformers in models.py

* gradio, transformers, litellm

* small refacto AgentType

* merge conflicts

* mouaif

* fix tests

* AgentText no longer a str

* Add back AgentType as str/Image

* fixed for good
2025-01-20 10:59:43 +01:00
Lucain 3178b18aab
Remove unused and undocumented parameter (#273) 2025-01-20 10:45:55 +01:00
Aymeric Roucher 0abd91cf72
Improve tool call argument parsing (#267)
* Improve tool call argument parsing
2025-01-20 10:44:40 +01:00
Lucain 6e1373a324
Add linter rules + apply make style (#255)
* Add linter rules + apply make style
2025-01-18 19:01:15 +01:00
Aymeric Roucher e3ae1800e2
Fixes before release (#254)
* Fixes before release
2025-01-17 20:20:28 +01:00
Guillaume Raille a4d029da88
add support for MCP Servers tools as `ToolCollection` (#232)
* add support for tool collection from mcp servers

* add forgotten documentation

* fix link missing in documentation

* fix linting in CI, bumpruff to use modern version

* mcpadapt added as optional dependencies

* use classmethod for from_hub and from_mcp to better reflect the fact that they return a ToolCollection

* Update src/smolagents/tools.py

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>

* Update src/smolagents/tools.py

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>

* Test ToolCollection.from_mcp

* Rename to mcp extra

* Add mcp extra to test extra

* add a test for from_mcp

* fix typo

* fix tests

* Test ToolCollection.from_mcp

(cherry picked from commit 9284d9ea8cf24d3c934e35a38dfe34f3ce31cef3)

* Make all pytest tests

---------

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>
2025-01-17 19:41:43 +01:00
Albert Villanova del Moral 58b18f5655
Remove dependency on _is_package_available from transformers (#247) 2025-01-17 18:38:33 +01:00
Edward Beeching fabc59aa08
Fix missing python modules in CodeAgent system prompt (#226)
* fix modules in system prompt + test
2025-01-17 11:59:30 +01:00
Aymeric Roucher c255c1ff84
Fix subpackage import vulnerability (#238)
* Fix subpackage import vulnerability
2025-01-17 11:40:49 +01:00
Aymeric Roucher b4091cb5ce
Allow passing kwargs to all models (#222)
* Allow passing kwargs to all models
2025-01-16 23:03:38 +01:00
Aymeric Roucher e5c054cc5b
Pre-release fixes (#207) 2025-01-15 16:56:12 +01:00
Aymeric Roucher 06aca55be6
Fix import from ChatMessage in test_monitoring (#202) 2025-01-15 14:03:41 +01:00
NeverLucky a22c221fa7
call.func parameter (#194) 2025-01-15 13:58:52 +01:00
Aymeric Roucher 450934ce79
Add support for OpenTelemetry instrumentation 📊 (#200) 2025-01-15 12:10:52 +01:00
Aymeric Roucher ce1cd6d906
Support pandas' iloc indexer (#191) 2025-01-14 19:27:07 +01:00
Aymeric Roucher 5f32373551
Make default tools more robust (#186) 2025-01-14 14:57:11 +01:00
Aymeric 1d846072eb Improve GradioUI file upload system 2025-01-13 19:46:36 +01:00
Aymeric Roucher c611dfc7e5
Clean local python interpreter: propagate imports (#175) 2025-01-13 17:23:03 +01:00
Aymeric Roucher eca83800e3
Halve import time by removing torch dependency (#147)
* Halve import time by removing torch dependency
2025-01-10 15:00:28 +01:00
Aymeric Roucher 5c33130fa4
Vastly simplify Model class (#146)
* Vastly simplify Model class by making only one __call__ method 
2025-01-10 12:30:59 +01:00
Aymeric Roucher cb9830a554
Support OpenTelemetry (#136)
* Support OpenTelemetry
2025-01-09 23:08:17 +01:00