Spaces:
Sleeping
Sleeping
add websearch func
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
-
|
| 8 |
import utils
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
@@ -75,7 +75,7 @@ def get_weather(city: str) -> str:
|
|
| 75 |
|
| 76 |
|
| 77 |
final_answer = FinalAnswerTool()
|
| 78 |
-
|
| 79 |
# 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:
|
| 80 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 81 |
|
|
@@ -95,7 +95,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 95 |
|
| 96 |
agent = CodeAgent(
|
| 97 |
model=model,
|
| 98 |
-
tools=[final_answer, get_current_time_in_timezone, get_weather], ## add your tools here (don't remove final answer)
|
| 99 |
max_steps=6,
|
| 100 |
verbosity_level=1,
|
| 101 |
grammar=None,
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 8 |
import utils
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
final_answer = FinalAnswerTool()
|
| 78 |
+
web_search = DuckDuckGoSearchTool()
|
| 79 |
# 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:
|
| 80 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 81 |
|
|
|
|
| 95 |
|
| 96 |
agent = CodeAgent(
|
| 97 |
model=model,
|
| 98 |
+
tools=[final_answer, web_search, get_current_time_in_timezone, get_weather], ## add your tools here (don't remove final answer)
|
| 99 |
max_steps=6,
|
| 100 |
verbosity_level=1,
|
| 101 |
grammar=None,
|