Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
| 15 |
agent = ToolCallingAgent(
|
| 16 |
-
tools=[
|
| 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
|