Spaces:
Runtime error
Runtime error
Added website view tool
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -22,6 +22,9 @@ os.environ["HUGGINGFACE_API_TOKEN"] = os.getenv("HUGGINGFACE_API_KEY", "")
|
|
| 22 |
ddg_search_tool = DuckDuckGoSearchTool(max_results=10) # Default is 10 results
|
| 23 |
# google_search_tool = GoogleSearchTool()
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
#@weave.op()
|
| 26 |
def tracked_perplexity_call(prompt: str, system_messages: str, model_name: str = "sonar-pro", assistant_meta: bool = False):
|
| 27 |
"""Enhanced Perplexity API call with explicit model tracking."""
|
|
@@ -388,7 +391,8 @@ agent = CodeAgent(
|
|
| 388 |
get_current_time_in_timezone,
|
| 389 |
image_generation_tool,
|
| 390 |
Dataset_Creator_Tool,
|
| 391 |
-
Check_Dataset_Validity
|
|
|
|
| 392 |
],
|
| 393 |
max_steps=6,
|
| 394 |
verbosity_level=1,
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, VisitWebpageTool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 22 |
ddg_search_tool = DuckDuckGoSearchTool(max_results=10) # Default is 10 results
|
| 23 |
# google_search_tool = GoogleSearchTool()
|
| 24 |
|
| 25 |
+
# Initialize the VisitWebpageTool
|
| 26 |
+
visit_webpage_tool = VisitWebpageTool()
|
| 27 |
+
|
| 28 |
#@weave.op()
|
| 29 |
def tracked_perplexity_call(prompt: str, system_messages: str, model_name: str = "sonar-pro", assistant_meta: bool = False):
|
| 30 |
"""Enhanced Perplexity API call with explicit model tracking."""
|
|
|
|
| 391 |
get_current_time_in_timezone,
|
| 392 |
image_generation_tool,
|
| 393 |
Dataset_Creator_Tool,
|
| 394 |
+
Check_Dataset_Validity,
|
| 395 |
+
visit_webpage_tool, # Added webpage visiting capability
|
| 396 |
],
|
| 397 |
max_steps=6,
|
| 398 |
verbosity_level=1,
|