Spaces:
Sleeping
Sleeping
Update app.py
Browse filesadd comic_strip_generator tool
app.py
CHANGED
|
@@ -33,6 +33,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
@tool
|
| 37 |
+
def comic_strip_generator(scene_description: str) -> str:
|
| 38 |
+
"""Generates a comic strip from a scene description using image generation.
|
| 39 |
+
Args:
|
| 40 |
+
scene_description: A creative, descriptive text outlining a scene or story.
|
| 41 |
+
"""
|
| 42 |
+
try:
|
| 43 |
+
# Call the existing image generation tool with the input
|
| 44 |
+
result = image_generation_tool(scene_description)
|
| 45 |
+
return f"Here's your comic scene: {result}"
|
| 46 |
+
except Exception as e:
|
| 47 |
+
return f"Error generating comic: {str(e)}"
|
| 48 |
+
|
| 49 |
|
| 50 |
final_answer = FinalAnswerTool()
|
| 51 |
|