Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from Gradio_UI import GradioUI
|
|
| 10 |
search_tool = DuckDuckGoSearchTool(max_results=10)
|
| 11 |
|
| 12 |
@tool
|
| 13 |
-
def
|
| 14 |
"""A tool that runs a DuckDuckGo search and returns a formatted result.
|
| 15 |
Args:
|
| 16 |
query: A string representing the query to search for.
|
|
@@ -59,7 +59,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
-
tools=[final_answer, get_current_time_in_timezone,
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|
|
@@ -69,6 +69,4 @@ agent = CodeAgent(
|
|
| 69 |
prompt_templates=prompt_templates
|
| 70 |
)
|
| 71 |
|
| 72 |
-
print(search_web("iPhone"))
|
| 73 |
-
|
| 74 |
GradioUI(agent).launch()
|
|
|
|
| 10 |
search_tool = DuckDuckGoSearchTool(max_results=10)
|
| 11 |
|
| 12 |
@tool
|
| 13 |
+
def search_web(query:str)-> str:
|
| 14 |
"""A tool that runs a DuckDuckGo search and returns a formatted result.
|
| 15 |
Args:
|
| 16 |
query: A string representing the query to search for.
|
|
|
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
+
tools=[final_answer, get_current_time_in_timezone, search_web], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|
|
|
|
| 69 |
prompt_templates=prompt_templates
|
| 70 |
)
|
| 71 |
|
|
|
|
|
|
|
| 72 |
GradioUI(agent).launch()
|