Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
@@ -119,6 +121,10 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 119 |
|
| 120 |
|
| 121 |
final_answer = FinalAnswerTool()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
# 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:
|
| 124 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
@@ -139,7 +145,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 139 |
|
| 140 |
agent = CodeAgent(
|
| 141 |
model=model,
|
| 142 |
-
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, get_random_cocktail, search_dad_jokes, text_to_speech_kokoro], ## add your tools here (don't remove final answer)
|
| 143 |
max_steps=6,
|
| 144 |
verbosity_level=1,
|
| 145 |
grammar=None,
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 8 |
+
from tools.visit_webpage import VisitWebpageTool
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
|
|
|
|
| 121 |
|
| 122 |
|
| 123 |
final_answer = FinalAnswerTool()
|
| 124 |
+
web_search_tool = DuckDuckGoSearchTool()
|
| 125 |
+
visit_webpage_tool = VisitWebpageTool()
|
| 126 |
+
|
| 127 |
+
|
| 128 |
|
| 129 |
# 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:
|
| 130 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 145 |
|
| 146 |
agent = CodeAgent(
|
| 147 |
model=model,
|
| 148 |
+
tools=[visit_webpage_tool, web_search_tool, final_answer, image_generation_tool, get_current_time_in_timezone, get_random_cocktail, search_dad_jokes, text_to_speech_kokoro], ## add your tools here (don't remove final answer)
|
| 149 |
max_steps=6,
|
| 150 |
verbosity_level=1,
|
| 151 |
grammar=None,
|