Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,20 +10,28 @@ from Gradio_UI import GradioUI
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
def get_dad_jokes(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
Args:
|
| 16 |
-
arg1:
|
| 17 |
-
arg2:
|
|
|
|
|
|
|
|
|
|
| 18 |
"""
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
@tool
|
| 29 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
def get_dad_jokes(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 13 |
+
"""
|
| 14 |
+
A tool that returns a random dad joke from a hardcoded list.
|
| 15 |
+
|
| 16 |
Args:
|
| 17 |
+
arg1: The first argument (not used)
|
| 18 |
+
arg2: The second argument (used to select a joke index)
|
| 19 |
+
|
| 20 |
+
Returns:
|
| 21 |
+
A dad joke as a string.
|
| 22 |
"""
|
| 23 |
+
jokes = [
|
| 24 |
+
"Why don't skeletons fight each other? They don't have the guts.",
|
| 25 |
+
"I used to play piano by ear, but now I use my hands.",
|
| 26 |
+
"Why did the scarecrow win an award? Because he was outstanding in his field.",
|
| 27 |
+
"I only know 25 letters of the alphabet. I don't know y.",
|
| 28 |
+
"What do you call fake spaghetti? An impasta.",
|
| 29 |
+
"Why couldn't the bicycle stand up by itself? It was two-tired."
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
# Use modulo to safely loop through the jokes
|
| 33 |
+
index = arg2 % len(jokes)
|
| 34 |
+
return f"Dad Joke: {jokes[index]}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|