Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ from Gradio_UI import GradioUI
|
|
14 |
@tool
|
15 |
def my_custom_tool(arg1:str, img: bool)-> Any: #it's import to specify the return type
|
16 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
17 |
-
"""A tool that uses 'DuckDuckGoSearchTool' tool to answer any query.
|
18 |
Args:
|
19 |
arg1: string query to be used to search answer via given search tool.
|
20 |
img: boolean value in TRUE/FALSE if TRUE then use 'arg1' as prompt for 'image_generation_tool'.
|
@@ -61,14 +61,14 @@ custom_role_conversions=None,
|
|
61 |
|
62 |
|
63 |
# # Import tool from Hub
|
64 |
-
|
65 |
|
66 |
with open("prompts.yaml", 'r') as stream:
|
67 |
prompt_templates = yaml.safe_load(stream)
|
68 |
|
69 |
agent = CodeAgent(
|
70 |
model=model,
|
71 |
-
tools=[final_answer,my_custom_tool,get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
72 |
max_steps=6,
|
73 |
verbosity_level=1,
|
74 |
grammar=None,
|
|
|
14 |
@tool
|
15 |
def my_custom_tool(arg1:str, img: bool)-> Any: #it's import to specify the return type
|
16 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
17 |
+
"""A tool that uses 'DuckDuckGoSearchTool' tool to answer any query and 'image_generation_tool' tool to generate image.
|
18 |
Args:
|
19 |
arg1: string query to be used to search answer via given search tool.
|
20 |
img: boolean value in TRUE/FALSE if TRUE then use 'arg1' as prompt for 'image_generation_tool'.
|
|
|
61 |
|
62 |
|
63 |
# # Import tool from Hub
|
64 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
65 |
|
66 |
with open("prompts.yaml", 'r') as stream:
|
67 |
prompt_templates = yaml.safe_load(stream)
|
68 |
|
69 |
agent = CodeAgent(
|
70 |
model=model,
|
71 |
+
tools=[final_answer,my_custom_tool,image_generation_tool,get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
72 |
max_steps=6,
|
73 |
verbosity_level=1,
|
74 |
grammar=None,
|