ChockqOteewy commited on
Commit
0412ce8
·
verified ·
1 Parent(s): d989cfe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -5,15 +5,17 @@ import pandas as pd
5
 
6
  from smolagents.models import InferenceClientModel
7
  from smolagents.agents import ToolCallingAgent
 
8
 
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
 
11
  def create_agent():
12
- # Create the model object for Hugging Face inference API
13
  model = InferenceClientModel(repo_id="HuggingFaceH4/zephyr-7b-beta")
14
- # Compose the agent, registering tool names (do not import them directly)
 
 
15
  agent = ToolCallingAgent(
16
- tools=["wikipedia", "duckduckgo", "web_search"],
17
  model=model
18
  )
19
  return agent
 
5
 
6
  from smolagents.models import InferenceClientModel
7
  from smolagents.agents import ToolCallingAgent
8
+ from smolagents.tools import DuckDuckGoSearchTool, WebSearchTool, WikipediaSearchTool
9
 
10
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
11
 
12
  def create_agent():
 
13
  model = InferenceClientModel(repo_id="HuggingFaceH4/zephyr-7b-beta")
14
+ wiki_tool = WikipediaSearchTool()
15
+ duck_tool = DuckDuckGoSearchTool()
16
+ web_tool = WebSearchTool()
17
  agent = ToolCallingAgent(
18
+ tools=[wiki_tool, duck_tool, web_tool],
19
  model=model
20
  )
21
  return agent