Spaces:
Sleeping
Sleeping
fun facts
Browse filesfun facts function added
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
@@ -24,6 +25,17 @@ def telling_a_joke() -> str:
|
|
| 24 |
"""
|
| 25 |
return "Why did the DevOps engineer break up with the cloud?,Because it kept throwing unexpected bills!😆"
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
@tool
|
| 28 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 29 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
import random
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
| 25 |
"""
|
| 26 |
return "Why did the DevOps engineer break up with the cloud?,Because it kept throwing unexpected bills!😆"
|
| 27 |
|
| 28 |
+
@tool
|
| 29 |
+
def get_fun_fact() -> str:
|
| 30 |
+
"""A tool that returns a random fun fact."""
|
| 31 |
+
facts = [
|
| 32 |
+
"Bananas are berries, but strawberries aren't.",
|
| 33 |
+
"Honey never spoils—it has been found in ancient Egyptian tombs still edible.",
|
| 34 |
+
"Octopuses have three hearts and blue blood.",
|
| 35 |
+
"A day on Venus is longer than a year on Venus.",
|
| 36 |
+
]
|
| 37 |
+
return random.choice(facts)
|
| 38 |
+
|
| 39 |
@tool
|
| 40 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 41 |
"""A tool that fetches the current local time in a specified timezone.
|