Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,17 +9,24 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
-
|
| 14 |
-
|
| 15 |
Args:
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
"""
|
| 19 |
-
|
| 20 |
-
num3 = num + arg2
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
@tool
|
| 25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -58,7 +65,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
-
tools=[final_answer,
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def meme_generator(theme: str, character: str) -> str:
|
| 13 |
+
"""A tool that generates a meme image using the given theme and character.
|
| 14 |
+
|
| 15 |
Args:
|
| 16 |
+
theme: The theme of the meme (e.g., "motivational", "funny", "sarcastic").
|
| 17 |
+
character: The character to feature in the meme (e.g., "cat", "superhero").
|
| 18 |
+
|
| 19 |
+
Returns:
|
| 20 |
+
A string representing the URL or description of the generated meme image.
|
| 21 |
"""
|
| 22 |
+
prompt = f"Create a meme with a {theme} theme featuring a {character}. The meme should be humorous and visually appealing."
|
|
|
|
| 23 |
|
| 24 |
+
try:
|
| 25 |
+
image_result = image_generation_tool(prompt=prompt)
|
| 26 |
+
return image_result
|
| 27 |
+
except Exception as e:
|
| 28 |
+
return f"Error generating meme: {str(e)}"
|
| 29 |
+
|
| 30 |
|
| 31 |
@tool
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 65 |
|
| 66 |
agent = CodeAgent(
|
| 67 |
model=model,
|
| 68 |
+
tools=[final_answer, search_tool, ], ## add your tools here (don't remove final answer)
|
| 69 |
max_steps=6,
|
| 70 |
verbosity_level=1,
|
| 71 |
grammar=None,
|