You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ limitations under the License.
38
38
39
39
🌐 **Support for any LLM**: it supports models hosted on the Hub loaded in their `transformers` version or through our inference API, but also supports models from OpenAI, Anthropic and many others via our [LiteLLM](https://www.litellm.ai/) integration.
40
40
41
+
Full documentation can be found [here](https://huggingface.co/docs/smolagents/index).
42
+
41
43
> [!NOTE]
42
44
> Check the our [launch blog post](https://huggingface.co/blog/smolagents) to learn more about `smolagents`!
Copy file name to clipboardExpand all lines: docs/source/en/examples/multiagents.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,10 +48,10 @@ Run the line below to install the required dependencies:
48
48
49
49
Let's login in order to call the HF Inference API:
50
50
51
-
```py
52
-
from huggingface_hub importnotebook_login
51
+
```
52
+
from huggingface_hub import login
53
53
54
-
notebook_login()
54
+
login()
55
55
```
56
56
57
57
⚡️ Our agent will be powered by [Qwen/Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct) using `HfApiModel` class that uses HF's Inference API: the Inference API allows to quickly and easily run any OS model.
Copy file name to clipboardExpand all lines: docs/source/en/guided_tour.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,8 +113,7 @@ The Python interpreter also doesn't allow imports by default outside of a safe l
113
113
You can authorize additional imports by passing the authorized modules as a list of strings in argument `additional_authorized_imports` upon initialization of your [`CodeAgent`]:
agent.run("Could you get me the title of the page at url 'https://huggingface.co/blog'?")
120
119
```
@@ -161,15 +160,15 @@ When the agent is initialized, the tool attributes are used to generate a tool d
161
160
Transformers comes with a default toolbox for empowering agents, that you can add to your agent upon initialization with argument `add_base_tools = True`:
162
161
163
162
-**DuckDuckGo web search***: performs a web search using DuckDuckGo browser.
164
-
-**Python code interpreter**: runs your the LLM generated Python code in a secure environment. This tool will only be added to [`ToolCallingAgent`] if you initialize it with `add_base_tools=True`, since code-based agent can already natively execute Python code
163
+
-**Python code interpreter**: runs your LLM generated Python code in a secure environment. This tool will only be added to [`ToolCallingAgent`] if you initialize it with `add_base_tools=True`, since code-based agent can already natively execute Python code
165
164
-**Transcriber**: a speech-to-text pipeline built on Whisper-Turbo that transcribes an audio to text.
166
165
167
-
You can manually use a tool by calling the [`load_tool`] function and a task to perform.
166
+
You can manually use a tool by calling it with its arguments.
168
167
169
168
```python
170
-
from smolagents importload_tool
169
+
from smolagents importDuckDuckGoSearchTool
171
170
172
-
search_tool =load_tool("web_search")
171
+
search_tool =DuckDuckGoSearchTool()
173
172
print(search_tool("Who's the current president of Russia?"))
Copy file name to clipboardExpand all lines: docs/source/en/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ rendered properly in your Markdown viewer.
15
15
16
16
# `smolagents`
17
17
18
-
This library is the simplest framework out there to build powerful agents! By the way, wtf are "agents"? We provide our definition [in this page](conceptual_guides/intro_agents), whe're you'll also find tips for when to use them or not (spoilers: you'll often be better off without agents).
18
+
This library is the simplest framework out there to build powerful agents! By the way, wtf are "agents"? We provide our definition [in this page](conceptual_guides/intro_agents), where you'll also find tips for when to use them or not (spoilers: you'll often be better off without agents).
Copy file name to clipboardExpand all lines: docs/source/en/tutorials/secure_code_execution.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Code is just a better way to express actions on a computer. It has better:
30
30
-**Composability:** could you nest JSON actions within each other, or define a set of JSON actions to re-use later, the same way you could just define a python function?
31
31
-**Object management:** how do you store the output of an action like `generate_image` in JSON?
32
32
-**Generality:** code is built to express simply anything you can do have a computer do.
33
-
-**Representation in LLM training corpuses:** why not leverage this benediction of the sky that plenty of quality actions have already been included in LLM training corpuses?
33
+
-**Representation in LLM training corpus:** why not leverage this benediction of the sky that plenty of quality actions have already been included in LLM training corpus?
34
34
35
35
This is illustrated on the figure below, taken from [Executable Code Actions Elicit Better LLM Agents](https://huggingface.co/papers/2402.01030).
> Beware of not adding too many tools to an agent: this can overwhelm weaker LLM engines.
203
203
204
204
205
-
Use the `agent.toolbox.update_tool()` method to replace an existing tool in the agent's toolbox.
206
-
This is useful if your new tool is a one-to-one replacement of the existing tool because the agent already knows how to perform that specific task.
207
-
Just make sure the new tool follows the same API as the replaced tool or adapt the system prompt template to ensure all examples using the replaced tool are updated.
208
-
209
-
210
205
### Use a collection of tools
211
206
212
207
You can leverage tool collections by using the ToolCollection object, with the slug of the collection you want to use.
0 commit comments