Skip to content

Commit 318169e

Browse files
Replace DuckDuckGoSearchTool with WebSearchTool
1 parent e6c28e4 commit 318169e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

units/en/unit2/smolagents/code_agents.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ login()
8080

8181
### Selecting a Playlist for the Party Using `smolagents`
8282

83-
Music is an essential part of a successful party! Alfred needs some help selecting the playlist. Luckily, `smolagents` has got us covered! We can build an agent capable of searching the web using DuckDuckGo. To give the agent access to this tool, we include it in the tool list when creating the agent.
83+
Music is an essential part of a successful party! Alfred needs some help selecting the playlist. Luckily, `smolagents` has got us covered! We can build an agent capable of searching the web using our native `WebSearchTool` tool. To give the agent access to this tool, we include it in the tool list when creating the agent.
8484

8585
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/smolagents/alfred-playlist.jpg" alt="Alfred Playlist"/>
8686

@@ -89,9 +89,9 @@ For the model, we'll rely on `InferenceClientModel`, which provides access to Hu
8989
Running an agent is quite straightforward:
9090

9191
```python
92-
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel
92+
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel
9393

94-
agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=InferenceClientModel())
94+
agent = CodeAgent(tools=[WebSearchTool()], model=InferenceClientModel())
9595

9696
agent.run("Search for the best music recommendations for a party at the Wayne's mansion.")
9797
```
@@ -224,7 +224,7 @@ For example, the _AlfredAgent_ is available [here](https://huggingface.co/spaces
224224
You may be wondering—how did Alfred build such an agent using `smolagents`? By integrating several tools, he can generate an agent as follows. Don't worry about the tools for now, as we'll have a dedicated section later in this unit to explore that in detail:
225225

226226
```python
227-
from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, Tool, tool, VisitWebpageTool
227+
from smolagents import CodeAgent, WebSearchTool, FinalAnswerTool, InferenceClientModel, Tool, tool, VisitWebpageTool
228228

229229
@tool
230230
def suggest_menu(occasion: str) -> str:
@@ -290,7 +290,7 @@ class SuperheroPartyThemeTool(Tool):
290290
# Alfred, the butler, preparing the menu for the party
291291
agent = CodeAgent(
292292
tools=[
293-
DuckDuckGoSearchTool(),
293+
WebSearchTool(),
294294
VisitWebpageTool(),
295295
suggest_menu,
296296
catering_service_tool,

0 commit comments

Comments
 (0)