Skip to content

Commit

Permalink
Merge pull request #178 from baturyilmaz/fix/retrieval-agents-doc
Browse files Browse the repository at this point in the history
fix: correct CodeAgent usage in retrieval_agents.md
  • Loading branch information
burtenshaw authored Jan 16, 2025
2 parents 34f73f0 + 08aba6b commit a4ed3a4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 8_agents/retrieval_agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Traditional RAG has key limitations - it only performs a single retrieval step a
Let's start by building a simple agent that can search the web using DuckDuckGo. This agent will be able to answer questions by retrieving relevant information and synthesizing responses.

```python
from smolagents import CodeAgent
from smolagents.tools import DuckDuckGoSearch
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel

# Initialize the search tool
search_tool = DuckDuckGoSearch()
search_tool = DuckDuckGoSearchTool()

# Initialize the model
model = HfApiModel()

# Create an agent with memory
agent = CodeAgent(
name="research_assistant",
description="I help find and synthesize information from the web",
model = model,
tools=[search_tool]
)

Expand Down

0 comments on commit a4ed3a4

Please sign in to comment.