abakirci commited on
Commit
fec468d
·
verified ·
1 Parent(s): ae7a494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -6
app.py CHANGED
@@ -8,15 +8,47 @@ from tools.final_answer import FinalAnswerTool
8
  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 my_custom_tool(arg1:str, arg2:int)-> 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 does nothing yet
15
  Args:
16
- arg1: the first argument
17
- arg2: the second argument
18
  """
19
- return "What magic will you build ?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
 
8
  from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
+
12
  @tool
13
+ def generate_motivational_quote(mood: str, goal: str) -> str:
14
+ """A tool that generates a custom motivational quote based on the user's mood and goal.
 
15
  Args:
16
+ mood: The user's current mood (e.g., 'happy', 'stressed', 'excited').
17
+ goal: The user's current goal or focus (e.g., 'finish a project', 'learn something new').
18
  """
19
+ import random
20
+
21
+ # Define mood-based phrases
22
+ mood_phrases = {
23
+ "happy": ["Keep shining!", "Your positivity is contagious!", "The world is brighter with you in it!"],
24
+ "stressed": ["Take a deep breath.", "You're stronger than you think.", "This too shall pass."],
25
+ "excited": ["The sky's the limit!", "Your enthusiasm is inspiring!", "Go chase your dreams!"],
26
+ "tired": ["Rest, but don't quit.", "You're making progress, even if it feels slow.", "Tomorrow is a new day."],
27
+ "focused": ["You're in the zone!", "Stay sharp, you're unstoppable!", "Great things are coming your way!"],
28
+ }
29
+
30
+ # Define goal-based phrases
31
+ goal_phrases = {
32
+ "finish a project": ["You're almost there!", "The finish line is in sight!", "One step at a time."],
33
+ "learn something new": ["Every expert was once a beginner.", "Knowledge is power!", "Keep curious!"],
34
+ "start a new habit": ["Small steps lead to big changes.", "Consistency is key!", "You're building a better you!"],
35
+ "exercise": ["Your body will thank you!", "Sweat now, shine later!", "You're getting stronger every day!"],
36
+ "relax": ["You deserve this break.", "Recharge and come back stronger.", "Peace begins with a moment of rest."],
37
+ }
38
+
39
+ # Default fallback phrases
40
+ default_phrases = [
41
+ "You're capable of amazing things!",
42
+ "Every day is a new opportunity.",
43
+ "Believe in yourself!",
44
+ ]
45
+
46
+ # Get mood and goal phrases
47
+ mood_quote = random.choice(mood_phrases.get(mood.lower(), default_phrases))
48
+ goal_quote = random.choice(goal_phrases.get(goal.lower(), default_phrases))
49
+
50
+ # Combine into a motivational quote
51
+ return f"🌟 {mood_quote} 🌟 {goal_quote}"
52
 
53
  @tool
54
  def get_current_time_in_timezone(timezone: str) -> str: