Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
-
from smolagents.agent_types import AgentImage
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
@@ -21,17 +20,6 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 21 |
"""
|
| 22 |
return "What magic will you build ?"
|
| 23 |
|
| 24 |
-
@tool
|
| 25 |
-
def image_generator(prompt: str) -> AgentImage:
|
| 26 |
-
"""
|
| 27 |
-
Generate an image from a text prompt.
|
| 28 |
-
|
| 29 |
-
Args:
|
| 30 |
-
prompt: A detailed text description of the image to generate.
|
| 31 |
-
"""
|
| 32 |
-
img = image_generation_tool(prompt)
|
| 33 |
-
return AgentImage(img)
|
| 34 |
-
|
| 35 |
@tool
|
| 36 |
def web_search(query: str) -> str:
|
| 37 |
"""Search the web using DuckDuckGo and return relevant results.
|
|
@@ -94,7 +82,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 94 |
|
| 95 |
agent = CodeAgent(
|
| 96 |
model=model,
|
| 97 |
-
tools=[final_answer, web_search, get_current_time_in_timezone,
|
| 98 |
max_steps=6,
|
| 99 |
verbosity_level=1,
|
| 100 |
grammar=None,
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
| 20 |
"""
|
| 21 |
return "What magic will you build ?"
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
@tool
|
| 24 |
def web_search(query: str) -> str:
|
| 25 |
"""Search the web using DuckDuckGo and return relevant results.
|
|
|
|
| 82 |
|
| 83 |
agent = CodeAgent(
|
| 84 |
model=model,
|
| 85 |
+
tools=[final_answer, web_search, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 86 |
max_steps=6,
|
| 87 |
verbosity_level=1,
|
| 88 |
grammar=None,
|