Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
from smolagents import CodeAgent, HfApiModel,load_tool, tool, DuckDuckGoSearchTool, Tool, VisitWebpageTool
|
| 2 |
# from smolagents.models import InferenceAPIModel #InferenceClientModel
|
| 3 |
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
-
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
|
@@ -101,6 +101,7 @@ class SuperheroPartyThemeTool(Tool):
|
|
| 101 |
final_answer = FinalAnswerTool()
|
| 102 |
web_search = DuckDuckGoSearchTool()
|
| 103 |
visit_webpage = VisitWebpageTool()
|
|
|
|
| 104 |
|
| 105 |
# 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:
|
| 106 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
@@ -123,7 +124,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 123 |
|
| 124 |
agent = CodeAgent(
|
| 125 |
model=model,
|
| 126 |
-
tools=[final_answer, image_generation_tool, my_custom_tool, get_current_time_in_timezone, web_search, visit_webpage,
|
| 127 |
suggest_menu, catering_service_tool, SuperheroPartyThemeTool()], ## add your tools here (don't remove final answer)
|
| 128 |
max_steps=10,
|
| 129 |
verbosity_level=1,
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, HfApiModel,load_tool, tool, DuckDuckGoSearchTool, Tool, VisitWebpageTool, GoogleSearchTool
|
| 2 |
# from smolagents.models import InferenceAPIModel #InferenceClientModel
|
| 3 |
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
|
|
|
| 101 |
final_answer = FinalAnswerTool()
|
| 102 |
web_search = DuckDuckGoSearchTool()
|
| 103 |
visit_webpage = VisitWebpageTool()
|
| 104 |
+
googl_search = GoogleSearchTool()
|
| 105 |
|
| 106 |
# 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:
|
| 107 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 124 |
|
| 125 |
agent = CodeAgent(
|
| 126 |
model=model,
|
| 127 |
+
tools=[final_answer, image_generation_tool, my_custom_tool, get_current_time_in_timezone, web_search, visit_webpage, googl_search,
|
| 128 |
suggest_menu, catering_service_tool, SuperheroPartyThemeTool()], ## add your tools here (don't remove final answer)
|
| 129 |
max_steps=10,
|
| 130 |
verbosity_level=1,
|