Spaces:
Sleeping
Sleeping
Update
Browse files- app.py +5 -2
- tools/final_answer.py +0 -14
app.py
CHANGED
@@ -11,9 +11,12 @@ from smolagents import (
|
|
11 |
HfApiModel,
|
12 |
DuckDuckGoSearchTool,
|
13 |
WebSearchTool,
|
14 |
-
|
15 |
SpeechToTextTool
|
16 |
)
|
|
|
|
|
|
|
17 |
|
18 |
# (Keep Constants as is)
|
19 |
# --- Constants ---
|
@@ -34,7 +37,7 @@ class BasicAgent:
|
|
34 |
|
35 |
web_agent = ToolCallingAgent(
|
36 |
verbosity_level=1,
|
37 |
-
tools=[WebSearchTool(),
|
38 |
max_steps=5,
|
39 |
model=model,
|
40 |
name="web_search_agent"
|
|
|
11 |
HfApiModel,
|
12 |
DuckDuckGoSearchTool,
|
13 |
WebSearchTool,
|
14 |
+
VisitWebpageTool,
|
15 |
SpeechToTextTool
|
16 |
)
|
17 |
+
from dotenv import load_dotenv
|
18 |
+
# Load environment variables from .env file
|
19 |
+
load_dotenv()
|
20 |
|
21 |
# (Keep Constants as is)
|
22 |
# --- Constants ---
|
|
|
37 |
|
38 |
web_agent = ToolCallingAgent(
|
39 |
verbosity_level=1,
|
40 |
+
tools=[WebSearchTool(), VisitWebpageTool()],
|
41 |
max_steps=5,
|
42 |
model=model,
|
43 |
name="web_search_agent"
|
tools/final_answer.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
from typing import Any, Optional
|
2 |
-
from smolagents.tools import Tool
|
3 |
-
|
4 |
-
class FinalAnswerTool(Tool):
|
5 |
-
name = "final_answer"
|
6 |
-
description = "Provides a final answer to the given problem."
|
7 |
-
inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}
|
8 |
-
output_type = "any"
|
9 |
-
|
10 |
-
def forward(self, answer: Any) -> Any:
|
11 |
-
return answer
|
12 |
-
|
13 |
-
def __init__(self, *args, **kwargs):
|
14 |
-
self.is_initialized = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|