Spaces:
Sleeping
Sleeping
added visit webpage tool and updated the get_user_input 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
|
@@ -44,11 +44,12 @@ def get_user_input(user_input: str) -> str:
|
|
44 |
# Process the input
|
45 |
return user_input
|
46 |
except EOFError:
|
47 |
-
|
48 |
|
49 |
|
50 |
final_answer = FinalAnswerTool()
|
51 |
web_search = DuckDuckGoSearchTool()
|
|
|
52 |
|
53 |
|
54 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
@@ -70,7 +71,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
70 |
|
71 |
agent = CodeAgent(
|
72 |
model=model,
|
73 |
-
|
74 |
max_steps=6,
|
75 |
verbosity_level=1,
|
76 |
grammar=None,
|
|
|
1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, VisitWebpageTool, HfApiModel,load_tool,tool
|
2 |
import datetime
|
3 |
import requests
|
4 |
import pytz
|
|
|
44 |
# Process the input
|
45 |
return user_input
|
46 |
except EOFError:
|
47 |
+
print("End of input reached.")
|
48 |
|
49 |
|
50 |
final_answer = FinalAnswerTool()
|
51 |
web_search = DuckDuckGoSearchTool()
|
52 |
+
visit_webpage = VisitWebpageTool()
|
53 |
|
54 |
|
55 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
71 |
|
72 |
agent = CodeAgent(
|
73 |
model=model,
|
74 |
+
tools=[final_answer, web_search, get_current_time_in_timezone, visit_, get_user_input], ## add your tools here (don't remove final answer)
|
75 |
max_steps=6,
|
76 |
verbosity_level=1,
|
77 |
grammar=None,
|