Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,43 +8,52 @@ from tools.final_answer import FinalAnswerTool
|
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
@tool
|
11 |
-
def
|
12 |
-
"""A
|
13 |
Args:
|
14 |
-
question: The question
|
15 |
-
asker_name: The
|
16 |
"""
|
17 |
-
|
18 |
-
f"
|
19 |
-
"
|
20 |
-
f"{asker_name},
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
|
27 |
-
"
|
28 |
-
"
|
29 |
-
"
|
30 |
-
"
|
31 |
-
"
|
32 |
-
"The
|
33 |
-
|
34 |
-
"
|
35 |
-
"The
|
36 |
-
"
|
37 |
-
f"
|
38 |
]
|
39 |
|
40 |
-
#
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
@tool
|
45 |
def get_current_time_in_timezone(timezone: str) -> str:
|
46 |
"""A tool that fetches the current local time in a specified timezone.
|
47 |
-
|
48 |
Args:
|
49 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
50 |
"""
|
@@ -74,7 +83,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
74 |
|
75 |
agent = CodeAgent(
|
76 |
model=model,
|
77 |
-
tools=[get_current_time_in_timezone,
|
78 |
max_steps=6,
|
79 |
verbosity_level=1,
|
80 |
grammar=None,
|
|
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
@tool
|
11 |
+
def quantum_fortune_llama(question: str, asker_name: str) -> str:
|
12 |
+
"""A Quantum Fortune Llama that spits cryptic, hilarious, and oddly specific predictions from across the multiverse.
|
13 |
Args:
|
14 |
+
question: The question the user dares to ask this majestic beast (it might ignore it entirely).
|
15 |
+
asker_name: The brave soul who summoned the Llama’s cosmic spit.
|
16 |
"""
|
17 |
+
llama_spits = [
|
18 |
+
f"{asker_name}, the Llama peers through the 7th dimension: ‘You’ll invent a sandwich that screams on Thursdays.’",
|
19 |
+
"With a majestic bleat, it prophesies: ‘Your socks will unionize and demand better lint rights.’",
|
20 |
+
f"Spit lands from a parallel timeline—‘{asker_name}, a disco-loving squid will propose next Tuesday.’",
|
21 |
+
"The Llama’s third eye winks: ‘Your Wi-Fi will gain sentience and ghost you for fun.’",
|
22 |
+
f"{asker_name}, the Quantum Llama snorts: ‘A rogue pickle will challenge you to a duel at dawn.’",
|
23 |
+
"From the void, it bleats: ‘You’ll sneeze glitter for 3 days straight. Plan accordingly.’",
|
24 |
+
"The Llama chews on your fate: ‘A sentient cloud will adopt you as its emotional support human.’",
|
25 |
+
f"{asker_name}, it spits a vision: ‘You’ll star in a reality show judged by feral raccoons.’",
|
26 |
+
"Quantum drool reveals: ‘Your shadow will elope with a streetlamp. Send a postcard.’",
|
27 |
+
"The Llama tap-dances across time: ‘Your breakfast will stage a coup. Toast leads the charge.’",
|
28 |
+
f"Behold, {asker_name}! ‘A penguin in flip-flops will deliver your next big idea.’",
|
29 |
+
"The Llama’s cosmic burp decrees: ‘You’ll accidentally join a cult of overly polite pigeons.’",
|
30 |
+
"Spit swirls in 4D: ‘Your left shoe will write a bestselling memoir. Spoiler: it hates laces.’",
|
31 |
+
f"{asker_name}, the Llama grins: ‘A time-traveling toaster will sue you for emotional damages.’",
|
32 |
+
"The prophecy drips: ‘You’ll wake up fluent in Dolphin but only for karaoke night.’",
|
33 |
+
"With a cosmic headbutt, it declares: ‘Your next pet rock will demand a corner office.’",
|
34 |
+
f"{asker_name}, the Llama spits glitter: ‘A rogue kazoo will haunt your dreams with polka.’",
|
35 |
+
"The Quantum Llama howls: ‘Your fridge will start a podcast about existential cheese.’",
|
36 |
+
"A multiversal hoof-stomp reveals: ‘You’ll befriend a cloud shaped like a judgmental cat.’",
|
37 |
+
f"Spit lands with sass, {asker_name}: ‘Your future smells like burnt popcorn and ambition.’",
|
38 |
]
|
39 |
|
40 |
+
# Add a random "Llama Action" for extra flair and engagement
|
41 |
+
llama_actions = [
|
42 |
+
"The Llama does a backflip and spits twice for emphasis.",
|
43 |
+
"It waggles its eyebrows and teleports three seconds into the future.",
|
44 |
+
"The Llama moonwalks across a rainbow, leaving hoofprints of chaos.",
|
45 |
+
"It dons sunglasses and bleats your fortune in a funky rhythm.",
|
46 |
+
"The Llama chews on a quantum carrot, muttering about your alternate lives.",
|
47 |
+
]
|
48 |
+
|
49 |
+
# Randomly select response and action
|
50 |
+
fortune = random.choice(llama_spits)
|
51 |
+
action = random.choice(llama_actions)
|
52 |
+
return f"🦙 *The Quantum Fortune Llama turns its majestic gaze to {asker_name}*...\n{fortune}\n*{action}*"
|
53 |
|
54 |
@tool
|
55 |
def get_current_time_in_timezone(timezone: str) -> str:
|
56 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
57 |
Args:
|
58 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
59 |
"""
|
|
|
83 |
|
84 |
agent = CodeAgent(
|
85 |
model=model,
|
86 |
+
tools=[get_current_time_in_timezone, quantum_fortune_llama, DuckDuckGoSearchTool(), final_answer], # Replaced cosmic_fizz_oracle with quantum_fortune_llama
|
87 |
max_steps=6,
|
88 |
verbosity_level=1,
|
89 |
grammar=None,
|