Saurabhbud commited on
Commit
b7d0423
·
verified ·
1 Parent(s): 8c5c24b

Update app.py

Browse files

Added new Kids activity tool

Files changed (1) hide show
  1. app.py +35 -0
app.py CHANGED
@@ -33,6 +33,41 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  final_answer = FinalAnswerTool()
38
 
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @tool
37
+ def kid_activity_tool(age: int, mood: str = "curious") -> str:
38
+ """
39
+ Suggests a creative home activity for a kid with explanation.
40
+
41
+ Args:
42
+ age (int): Kid's age
43
+ mood (str): Optional mood or theme ("energetic", "calm", "creative", etc.)
44
+
45
+ Returns:
46
+ str: Activity suggestion with explanation
47
+ """
48
+ if age <= 4:
49
+ activity = "Build a fort with pillows and blankets"
50
+ explanation = "This sparks imagination, builds motor skills, and provides cozy fun."
51
+ elif age <= 7:
52
+ activity = "DIY treasure hunt around the house"
53
+ explanation = "It encourages problem solving and turns ordinary spaces into adventure zones."
54
+ elif age <= 10:
55
+ activity = "Make homemade playdough and create sculptures"
56
+ explanation = "Hands-on crafting improves creativity and fine motor coordination."
57
+ else:
58
+ activity = "Design a comic strip together"
59
+ explanation = "Great for storytelling, art skills, and self-expression."
60
+
61
+ # Mood-based twist
62
+ if mood == "energetic":
63
+ activity += " — add a timed challenge for extra excitement!"
64
+ elif mood == "calm":
65
+ activity += " — set it up as a quiet corner activity."
66
+
67
+ return f"Activity: {activity}\nExplanation: {explanation}"
68
+
69
+
70
+
71
 
72
  final_answer = FinalAnswerTool()
73