Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,23 +9,25 @@ 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 |
-
|
| 16 |
-
|
| 17 |
-
speed: A float representing the speed.
|
| 18 |
"""
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
@tool
|
| 31 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -64,7 +66,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 64 |
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
-
tools=[final_answer,
|
| 68 |
max_steps=6,
|
| 69 |
verbosity_level=1,
|
| 70 |
grammar=None,
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def generate_quote() -> str:
|
| 13 |
+
"""A tool that generates a random inspirational quote from Bruce Lee, 'The Art of War', or samurai philosophy.
|
| 14 |
+
|
| 15 |
+
Returns:
|
| 16 |
+
A string containing an inspirational quote.
|
|
|
|
| 17 |
"""
|
| 18 |
+
quotes = [
|
| 19 |
+
"Knowing is not enough; we must apply. Wishing is not enough; we must do. - Bruce Lee",
|
| 20 |
+
"The successful warrior is the average man, with laser-like focus. - Bruce Lee",
|
| 21 |
+
"In the midst of chaos, there is also opportunity. - Sun Tzu, The Art of War",
|
| 22 |
+
"All warfare is based on deception. - Sun Tzu, The Art of War",
|
| 23 |
+
"The ultimate aim of martial arts is not having to use them. - Miyamoto Musashi, Samurai Philosopher",
|
| 24 |
+
"A samurai should be as swift as a bird and as strong as a lion. - Unknown Samurai",
|
| 25 |
+
"It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change. - Charles Darwin (often quoted in samurai philosophy)",
|
| 26 |
+
"The sword is a weapon of the mind. - Unknown Samurai",
|
| 27 |
+
"To know your Enemy, you must become your Enemy. - Sun Tzu, The Art of War",
|
| 28 |
+
"The mind is everything. What you think you become. - Buddha (often referenced in samurai teachings)"
|
| 29 |
+
]
|
| 30 |
+
return random.choice(quotes)
|
| 31 |
|
| 32 |
@tool
|
| 33 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 66 |
|
| 67 |
agent = CodeAgent(
|
| 68 |
model=model,
|
| 69 |
+
tools=[final_answer, generate_quote, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 70 |
max_steps=6,
|
| 71 |
verbosity_level=1,
|
| 72 |
grammar=None,
|