Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,18 +34,18 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
#
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
|
50 |
|
51 |
final_answer = FinalAnswerTool()
|
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
|
37 |
+
@tool
|
38 |
+
def generate_image(prompt: str) -> str:
|
39 |
+
"""Generates an image based on the given text prompt.
|
40 |
+
Args:
|
41 |
+
prompt: A detailed description of the image to generate
|
42 |
+
"""
|
43 |
+
try:
|
44 |
+
# Call the loaded image generation tool
|
45 |
+
image_result = image_generation_tool(prompt=prompt)
|
46 |
+
return f"Image generated successfully: {image_result}"
|
47 |
+
except Exception as e:
|
48 |
+
return f"Error generating image: {str(e)}"
|
49 |
|
50 |
|
51 |
final_answer = FinalAnswerTool()
|