Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from tools.final_answer import FinalAnswerTool
|
|
7 |
from tools.visit_webpage import VisitWebpageTool
|
8 |
import os
|
9 |
from Gradio_UI import GradioUI
|
10 |
-
|
11 |
from duckduckgo_search import DDGS
|
12 |
|
13 |
import datetime
|
@@ -15,15 +15,24 @@ import time
|
|
15 |
|
16 |
|
17 |
|
18 |
-
@tool
|
19 |
-
def
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
@tool
|
|
|
7 |
from tools.visit_webpage import VisitWebpageTool
|
8 |
import os
|
9 |
from Gradio_UI import GradioUI
|
10 |
+
import PIL
|
11 |
from duckduckgo_search import DDGS
|
12 |
|
13 |
import datetime
|
|
|
15 |
|
16 |
|
17 |
|
18 |
+
# @tool
|
19 |
+
# def show_image(image : smolagents.agent_types.AgentImage ): #it's import to specify the return type
|
20 |
+
# #Keep this format for the description / args / args description but feel free to modify the tool
|
21 |
+
# """A tool that shows image generated by image_generation_tool
|
22 |
+
# Args:
|
23 |
+
# image: the input image with the original type
|
24 |
+
# """
|
25 |
+
# # Assuming 'agent_image' is your smolagents.agent_types.AgentImage object
|
26 |
+
# if isinstance(image, Image.Image):
|
27 |
+
# pil_image = image
|
28 |
+
# elif hasattr(image, 'to_pil'):
|
29 |
+
# pil_image = agent_image.to_pil()
|
30 |
+
# elif hasattr(image, 'image') and isinstance(agent_image.image, Image.Image):
|
31 |
+
# pil_image = agent_image.image
|
32 |
+
# else:
|
33 |
+
# # If none of the above, you'll need to investigate further
|
34 |
+
# print("Could not directly convert. Check the object's attributes and methods.")
|
35 |
+
# # For example, print(dir(agent_image)) to see what's available
|
36 |
|
37 |
|
38 |
@tool
|