RobotJelly commited on
Commit
dc5e5b7
·
verified ·
1 Parent(s): b1b01b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -6,12 +6,13 @@ import yaml
6
  from tools.final_answer import FinalAnswerTool
7
  import PIL
8
  from PIL import Image
 
9
 
10
  from Gradio_UI import GradioUI
11
 
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
14
- def my_custom_tool(arg1:str, img: bool)-> str: #it's import to specify the return type
15
  #Keep this format for the description / args / args description but feel free to modify the tool
16
  """A tool that uses 'DuckDuckGoSearchTool' tool to answer any query.
17
  Args:
@@ -20,7 +21,7 @@ def my_custom_tool(arg1:str, img: bool)-> str: #it's import to specify the retur
20
  """
21
  try:
22
  if img:
23
- return Image.open(image_generation_tool(arg1)).convert('RGB')
24
  else:
25
  search_obj = DuckDuckGoSearchTool()
26
  answer = search_obj(arg1)
 
6
  from tools.final_answer import FinalAnswerTool
7
  import PIL
8
  from PIL import Image
9
+ from typing import Any, Optional
10
 
11
  from Gradio_UI import GradioUI
12
 
13
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
14
  @tool
15
+ def my_custom_tool(arg1:str, img: bool)-> str|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:
 
21
  """
22
  try:
23
  if img:
24
+ return image_generation_tool
25
  else:
26
  search_obj = DuckDuckGoSearchTool()
27
  answer = search_obj(arg1)