Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,46 +9,14 @@ 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 |
-
A tool that
|
| 15 |
-
a one-of-a-kind motivational nudge.
|
| 16 |
-
|
| 17 |
Args:
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
Returns:
|
| 22 |
-
A string that fuses throwback references with forward-looking advice on the given topic.
|
| 23 |
"""
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
retro_quotes = [
|
| 27 |
-
"Crank up that boombox and tune out the haters!",
|
| 28 |
-
"Keep on truckin’—just remember to pack your laser gun for the future.",
|
| 29 |
-
"We built skyscrapers to touch the sky; now we’ve got to prep for Mars!"
|
| 30 |
-
]
|
| 31 |
-
|
| 32 |
-
vibe_twist = {
|
| 33 |
-
"optimistic": "You’ve got the power to make it happen—like a Walkman jam on full blast!",
|
| 34 |
-
"no-nonsense": "All right, pal, enough daydreaming—let’s push forward, no excuses!",
|
| 35 |
-
"bold": "No guts, no glory! Hammer pants optional, results mandatory.",
|
| 36 |
-
"chill": "Relax, keep it cool—like a John Hughes teen who knows it’ll all work out."
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
# Pick a random retro quote:
|
| 40 |
-
import random
|
| 41 |
-
chosen_quote = random.choice(retro_quotes)
|
| 42 |
-
|
| 43 |
-
# Get the vibe snippet or a default if vibe not found.
|
| 44 |
-
vibe_snippet = vibe_twist.get(vibe.lower(), "Stay rad and step forward—there’s no time like now.")
|
| 45 |
-
|
| 46 |
-
# Combine them into a single zinger.
|
| 47 |
-
return (
|
| 48 |
-
f"Topic: {topic}\n"
|
| 49 |
-
f"{chosen_quote} {vibe_snippet}\n"
|
| 50 |
-
"Forward-thinking tip: Keep an eye on emerging AI and tech trends—they’re the new frontier."
|
| 51 |
-
)
|
| 52 |
|
| 53 |
@tool
|
| 54 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def my_custom_tool(current_time:str, president_name:str)-> str: #it's import to specify the return type
|
| 13 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
"""A tool that gives the meaning of life
|
|
|
|
|
|
|
| 15 |
Args:
|
| 16 |
+
current_time: the current time
|
| 17 |
+
president_name: the name of the current president of the USA
|
|
|
|
|
|
|
|
|
|
| 18 |
"""
|
| 19 |
+
return f"42 : {president_name} - {current_time}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|