Spaces:
Sleeping
Sleeping
adding tools
Browse files
app.py
CHANGED
|
@@ -3,8 +3,11 @@ import datetime
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
-
|
| 7 |
-
from
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
@@ -36,6 +39,9 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 36 |
|
| 37 |
|
| 38 |
final_answer = FinalAnswerTool()
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# 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:
|
| 41 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
@@ -59,7 +65,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
from tools.visit_webpage import VisitWebpageTool
|
| 8 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 9 |
+
|
| 10 |
+
# from smolagents.default_tools import FinalAnswerTool
|
| 11 |
|
| 12 |
from Gradio_UI import GradioUI
|
| 13 |
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
final_answer = FinalAnswerTool()
|
| 42 |
+
visit_webpage = VisitWebpageTool()
|
| 43 |
+
web_search = DuckDuckGoSearchTool()
|
| 44 |
+
|
| 45 |
|
| 46 |
# 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:
|
| 47 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 65 |
|
| 66 |
agent = CodeAgent(
|
| 67 |
model=model,
|
| 68 |
+
tools=[final_answer, visit_webpage, web_search, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 69 |
max_steps=6,
|
| 70 |
verbosity_level=1,
|
| 71 |
grammar=None,
|