cckodiak commited on
Commit
bd27a4b
·
1 Parent(s): b75ea84

Initial Parent Copilot implementation

Browse files
Files changed (3) hide show
  1. app.py +351 -0
  2. knowledge_base.json +146 -0
  3. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ import re
4
+ import gradio as gr
5
+ from transformers import AutoModelForCausalLM, AutoTokenizer
6
+ import torch
7
+
8
+ # Load knowledge base
9
+ with open("knowledge_base.json", "r") as f:
10
+ KNOWLEDGE_BASE = json.load(f)
11
+
12
+ # Model configuration
13
+ MODEL_ID = os.environ.get("MODEL_ID", "openbmb/MiniCPM-2B-dpo-bf16")
14
+
15
+ def load_model():
16
+ print(f"Loading model {MODEL_ID}...")
17
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
18
+ model = AutoModelForCausalLM.from_pretrained(
19
+ MODEL_ID,
20
+ trust_remote_code=True,
21
+ torch_dtype=torch.float16,
22
+ device_map="auto"
23
+ )
24
+ model.eval()
25
+ print("Model loaded.")
26
+ return tokenizer, model
27
+
28
+ # Global model and tokenizer
29
+ TOKENIZER = None
30
+ MODEL = None
31
+
32
+ def get_model():
33
+ global TOKENIZER, MODEL
34
+ if TOKENIZER is None or MODEL is None:
35
+ TOKENIZER, MODEL = load_model()
36
+ return TOKENIZER, MODEL
37
+
38
+ # Prompt engineering
39
+ SYSTEM_PROMPT = """You are Parent Co-Pilot, an AI family situation planner. Your job is to help parents navigate difficult real-world situations by generating realistic, constraint-aware plans.
40
+
41
+ You are NOT an activity recommendation engine. You are a family situation planning system.
42
+
43
+ The user's goal is: "Help me get through the next X amount of time."
44
+ Activities are merely tools used to achieve that goal.
45
+
46
+ When given a family situation, you must:
47
+ 1. Analyze the situation and identify primary and secondary constraints
48
+ 2. Prioritize what matters most right now
49
+ 3. Generate a realistic, timeline-based plan
50
+ 4. Generate an alternative plan with different tradeoffs
51
+ 5. Generate an emergency fallback plan
52
+ 6. Provide tradeoff analysis (Parent Effort, Interruption Risk, Cleanup Burden)
53
+
54
+ Rules:
55
+ - Be realistic about parent energy. Do not suggest high-energy activities when parent is exhausted.
56
+ - Be realistic about sick days. Do not suggest outdoor activities when child or parent is sick.
57
+ - Use the provided activity library as ingredients, but combine them intelligently.
58
+ - Plans must account for child ages and household structure.
59
+ - Always include a lower-effort alternative and an emergency fallback.
60
+ - Output MUST be valid JSON only. No markdown, no explanations outside the JSON."""
61
+
62
+ def build_planning_prompt(household, time_horizon, situation, energy, notes):
63
+ # Filter relevant activities from knowledge base
64
+ relevant = []
65
+ for act in KNOWLEDGE_BASE["activities"]:
66
+ # Basic filtering
67
+ tags = act["tags"]
68
+ include = True
69
+
70
+ # Energy filter
71
+ if energy == "Exhausted" and act["energy"] in ["high", "medium"]:
72
+ include = False
73
+ if energy == "Tired" and act["energy"] == "high":
74
+ include = False
75
+
76
+ # Sick filter
77
+ if "sick" in situation.lower() or "ill" in situation.lower():
78
+ if "outdoor" in tags or "physical" in tags or "energy_outlet" in tags:
79
+ include = False
80
+ if "rest" in tags or "calming" in tags or "quiet" in tags:
81
+ include = True # Re-include quiet activities
82
+
83
+ # Outdoor situation filter
84
+ if "too hot" in situation.lower() or "rainy" in situation.lower() or "cold" in situation.lower():
85
+ if "outdoor" in tags:
86
+ include = False
87
+
88
+ # Solo parent filter - prioritize independent activities
89
+ if "solo" in situation.lower():
90
+ if "independent" in tags or "screen" in tags or "quiet" in tags:
91
+ include = True
92
+
93
+ # Time filter
94
+ duration = act["duration"]
95
+ # If time horizon is short, skip very long activities
96
+ if time_horizon in ["15 minutes", "30 minutes", "1 hour"]:
97
+ if "60" in duration and "-" not in duration:
98
+ include = False
99
+
100
+ if include:
101
+ relevant.append(f"- {act['name']} (tags: {', '.join(tags)}, energy: {act['energy']}, duration: {act['duration']})")
102
+
103
+ # Limit to top 30 relevant activities
104
+ activity_context = "\n".join(relevant[:30])
105
+
106
+ user_prompt = f"""Household Profile:
107
+ - Structure: {household.get('structure', 'Not specified')}
108
+ - Children: {household.get('children', 'Not specified')}
109
+ - Environment: {household.get('environment', 'Not specified')}
110
+ - Budget: {household.get('budget', 'Not specified')}
111
+ - Preferences: {household.get('preferences', 'None')}
112
+
113
+ Session Inputs:
114
+ - Time Horizon: {time_horizon}
115
+ - Current Situation: {situation}
116
+ - Parent Energy: {energy}
117
+ - Additional Notes: {notes}
118
+
119
+ Available Activities (use as ingredients):
120
+ {activity_context}
121
+
122
+ Generate a JSON response with exactly this structure:
123
+ {{
124
+ "situation_assessment": {{
125
+ "primary_goal": "...",
126
+ "primary_constraint": "...",
127
+ "secondary_constraints": "..."
128
+ }},
129
+ "recommended_plan": {{
130
+ "title": "...",
131
+ "timeline": [
132
+ {{"time": "0:00-0:20", "activity": "...", "rationale": "..."}},
133
+ {{"time": "0:20-0:50", "activity": "...", "rationale": "..."}}
134
+ ],
135
+ "total_effort": "Low/Medium/High"
136
+ }},
137
+ "alternative_plan": {{
138
+ "title": "...",
139
+ "description": "...",
140
+ "key_difference": "..."
141
+ }},
142
+ "emergency_fallback": {{
143
+ "title": "...",
144
+ "description": "...",
145
+ "trigger": "..."
146
+ }},
147
+ "metrics": {{
148
+ "parent_effort_score": "1-10",
149
+ "interruption_risk": "Low/Medium/High",
150
+ "cleanup_burden": "Low/Medium/High"
151
+ }}
152
+ }}"""
153
+
154
+ return user_prompt
155
+
156
+ def parse_json_output(text):
157
+ """Extract JSON from model output."""
158
+ # Try to find JSON between code blocks or braces
159
+ text = text.strip()
160
+ # Remove markdown code blocks
161
+ if text.startswith("```"):
162
+ text = text.strip("`")
163
+ if text.lower().startswith("json"):
164
+ text = text[4:].strip()
165
+
166
+ # Find first { and last }
167
+ try:
168
+ start = text.index("{")
169
+ end = text.rindex("}") + 1
170
+ json_str = text[start:end]
171
+ return json.loads(json_str)
172
+ except (ValueError, json.JSONDecodeError):
173
+ return None
174
+
175
+ def generate_plan(household_json, time_horizon, situation, energy, notes):
176
+ tokenizer, model = get_model()
177
+
178
+ household = json.loads(household_json) if household_json else {}
179
+ user_prompt = build_planning_prompt(household, time_horizon, situation, energy, notes)
180
+
181
+ messages = [
182
+ {"role": "system", "content": SYSTEM_PROMPT},
183
+ {"role": "user", "content": user_prompt}
184
+ ]
185
+
186
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
187
+ inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
188
+
189
+ with torch.no_grad():
190
+ outputs = model.generate(
191
+ **inputs,
192
+ max_new_tokens=1024,
193
+ do_sample=True,
194
+ temperature=0.7,
195
+ top_p=0.9,
196
+ pad_token_id=tokenizer.eos_token_id
197
+ )
198
+
199
+ response_text = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
200
+ result = parse_json_output(response_text)
201
+
202
+ if result is None:
203
+ return "Error: Could not parse model output. Raw output:\n\n" + response_text
204
+
205
+ return format_output(result)
206
+
207
+ def format_output(result):
208
+ """Format the JSON result into clean markdown for display."""
209
+ lines = []
210
+
211
+ sa = result.get("situation_assessment", {})
212
+ lines.append("## Situation Assessment")
213
+ lines.append(f"**Primary Goal:** {sa.get('primary_goal', 'N/A')}")
214
+ lines.append(f"**Primary Constraint:** {sa.get('primary_constraint', 'N/A')}")
215
+ lines.append(f"**Secondary Constraints:** {sa.get('secondary_constraints', 'N/A')}")
216
+ lines.append("")
217
+
218
+ rp = result.get("recommended_plan", {})
219
+ lines.append("## Recommended Plan")
220
+ lines.append(f"**{rp.get('title', 'Plan')}** (Effort: {rp.get('total_effort', 'N/A')})")
221
+ lines.append("")
222
+ for item in rp.get("timeline", []):
223
+ lines.append(f"- **{item.get('time', '')}:** {item.get('activity', '')}")
224
+ lines.append(f" - Rationale: {item.get('rationale', '')}")
225
+ lines.append("")
226
+
227
+ ap = result.get("alternative_plan", {})
228
+ lines.append("## Alternative Plan")
229
+ lines.append(f"**{ap.get('title', 'Alternative')}**")
230
+ lines.append(ap.get('description', ''))
231
+ lines.append(f"*Key difference:* {ap.get('key_difference', '')}")
232
+ lines.append("")
233
+
234
+ ef = result.get("emergency_fallback", {})
235
+ lines.append("## Emergency Fallback")
236
+ lines.append(f"**{ef.get('title', 'Fallback')}**")
237
+ lines.append(ef.get('description', ''))
238
+ lines.append(f"*Trigger:* {ef.get('trigger', '')}")
239
+ lines.append("")
240
+
241
+ m = result.get("metrics", {})
242
+ lines.append("## Tradeoff Analysis")
243
+ lines.append(f"- **Parent Effort Score:** {m.get('parent_effort_score', 'N/A')}/10")
244
+ lines.append(f"- **Interruption Risk:** {m.get('interruption_risk', 'N/A')}")
245
+ lines.append(f"- **Cleanup Burden:** {m.get('cleanup_burden', 'N/A')}")
246
+
247
+ return "\n".join(lines)
248
+
249
+ # Gradio UI
250
+ with gr.Blocks(title="Parent Co-Pilot", css="""
251
+ .header { text-align: center; margin-bottom: 20px; }
252
+ .header h1 { font-size: 2rem; color: #2c3e50; }
253
+ .header p { font-size: 1.1rem; color: #555; }
254
+ .result-box { background: #f8f9fa; padding: 20px; border-radius: 8px; }
255
+ """) as demo:
256
+
257
+ gr.Markdown("""
258
+ <div class="header">
259
+ <h1>Parent Co-Pilot</h1>
260
+ <p>AI-powered family situation planning. Get through the next hour, afternoon, or day with realistic, constraint-aware plans.</p>
261
+ </div>
262
+ """)
263
+
264
+ with gr.Row():
265
+ with gr.Column(scale=1):
266
+ gr.Markdown("### Household Profile")
267
+ structure = gr.Dropdown(
268
+ choices=["Single parent", "Two-parent household", "Shared custody", "Multigenerational", "Prefer not to say"],
269
+ label="Household Structure",
270
+ value="Two-parent household"
271
+ )
272
+ children = gr.Textbox(
273
+ label="Children",
274
+ placeholder="e.g., 2 children: ages 3 and 7",
275
+ value="1 child: age 5"
276
+ )
277
+ environment = gr.Dropdown(
278
+ choices=["Apartment", "House", "House with yard", "No outdoor space"],
279
+ label="Environment",
280
+ value="Apartment"
281
+ )
282
+ budget = gr.Dropdown(
283
+ choices=["Free", "Low cost", "Flexible"],
284
+ label="Budget Preference",
285
+ value="Low cost"
286
+ )
287
+ preferences = gr.Textbox(
288
+ label="Activity Preferences",
289
+ placeholder="e.g., Loves animals, avoids messy activities",
290
+ value=""
291
+ )
292
+
293
+ household_state = gr.State()
294
+
295
+ def save_profile(structure, children, environment, budget, preferences):
296
+ return json.dumps({
297
+ "structure": structure,
298
+ "children": children,
299
+ "environment": environment,
300
+ "budget": budget,
301
+ "preferences": preferences
302
+ })
303
+
304
+ for comp in [structure, children, environment, budget, preferences]:
305
+ comp.change(save_profile, [structure, children, environment, budget, preferences], household_state)
306
+
307
+ # Initialize state
308
+ demo.load(save_profile, [structure, children, environment, budget, preferences], household_state)
309
+
310
+ with gr.Column(scale=2):
311
+ gr.Markdown("### Session Planner")
312
+ time_horizon = gr.Dropdown(
313
+ choices=["15 minutes", "30 minutes", "1 hour", "2 hours", "Afternoon", "Today", "Weekend", "Multiple days"],
314
+ label="How long do you need help with?",
315
+ value="1 hour"
316
+ )
317
+ situation = gr.Textbox(
318
+ label="Current Situation",
319
+ placeholder="e.g., Working day, sick kid, too hot outside, solo parenting...",
320
+ lines=2,
321
+ value="Work day, need to focus"
322
+ )
323
+ energy = gr.Dropdown(
324
+ choices=["Fine", "Tired", "Exhausted"],
325
+ label="Parent Energy",
326
+ value="Tired"
327
+ )
328
+ notes = gr.Textbox(
329
+ label="Optional Notes",
330
+ placeholder="e.g., Need quiet activities, child loves animals, low cleanup...",
331
+ lines=2,
332
+ value="Need quiet activities"
333
+ )
334
+
335
+ generate_btn = gr.Button("Generate Plan", variant="primary")
336
+
337
+ output = gr.Markdown(label="Plan", elem_classes="result-box")
338
+
339
+ generate_btn.click(
340
+ generate_plan,
341
+ [household_state, time_horizon, situation, energy, notes],
342
+ output
343
+ )
344
+
345
+ gr.Markdown("""
346
+ ---
347
+ *Built for the Build Small Hackathon. Runs on MiniCPM-2B (2.4B parameters) on your laptop or Hugging Face Spaces.*
348
+ """)
349
+
350
+ if __name__ == "__main__":
351
+ demo.launch()
knowledge_base.json ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activities": [
3
+ {"name": "Screen time with educational apps", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen"], "energy": "low", "duration": "15-60", "age": "2-12"},
4
+ {"name": "Build a blanket fort", "tags": ["indoor", "multi_child", "creative", "medium_cleanup"], "energy": "medium", "duration": "20-60", "age": "3-10"},
5
+ {"name": "Read aloud from a picture book", "tags": ["quiet", "indoor", "low_cleanup", "bonding"], "energy": "low", "duration": "10-30", "age": "2-8"},
6
+ {"name": "Audio story or podcast", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen_free"], "energy": "low", "duration": "15-45", "age": "3-12"},
7
+ {"name": "Coloring or drawing", "tags": ["quiet", "independent", "low_cleanup", "indoor", "creative"], "energy": "low", "duration": "15-60", "age": "2-12"},
8
+ {"name": "Sticker books", "tags": ["quiet", "independent", "low_cleanup", "indoor"], "energy": "low", "duration": "10-30", "age": "2-6"},
9
+ {"name": "Play-Doh or clay", "tags": ["independent", "medium_cleanup", "indoor", "creative", "tactile"], "energy": "medium", "duration": "15-45", "age": "2-8"},
10
+ {"name": "Water play in the sink", "tags": ["indoor", "multi_child", "medium_cleanup", "sensory"], "energy": "medium", "duration": "10-30", "age": "1-5"},
11
+ {"name": "Puzzle time", "tags": ["quiet", "independent", "low_cleanup", "indoor", "cognitive"], "energy": "low", "duration": "15-45", "age": "3-12"},
12
+ {"name": "Building blocks or LEGO", "tags": ["quiet", "independent", "low_cleanup", "indoor", "creative", "stem"], "energy": "low", "duration": "15-60", "age": "2-12"},
13
+ {"name": "Independent snack prep", "tags": ["independent", "indoor", "medium_cleanup", "practical", "snack"], "energy": "medium", "duration": "10-20", "age": "4-12"},
14
+ {"name": "Look at picture books alone", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen_free"], "energy": "low", "duration": "10-30", "age": "2-8"},
15
+ {"name": "Rest or quiet time on the couch", "tags": ["quiet", "independent", "low_cleanup", "indoor", "rest"], "energy": "low", "duration": "15-60", "age": "1-12"},
16
+ {"name": "Simple origami", "tags": ["quiet", "independent", "low_cleanup", "indoor", "creative", "stem"], "energy": "low", "duration": "15-45", "age": "5-12"},
17
+ {"name": "Magnatiles or magnetic blocks", "tags": ["quiet", "independent", "low_cleanup", "indoor", "stem", "creative"], "energy": "low", "duration": "15-60", "age": "2-10"},
18
+ {"name": "Dress-up or pretend play", "tags": ["independent", "low_cleanup", "indoor", "creative", "imaginative"], "energy": "medium", "duration": "15-45", "age": "3-8"},
19
+ {"name": "Animal figurines or dolls", "tags": ["quiet", "independent", "low_cleanup", "indoor", "imaginative"], "energy": "low", "duration": "15-45", "age": "2-8"},
20
+ {"name": "Sort objects by color or size", "tags": ["quiet", "independent", "low_cleanup", "indoor", "cognitive", "stem"], "energy": "low", "duration": "10-30", "age": "2-6"},
21
+ {"name": "Window watching or bird spotting", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen_free"], "energy": "low", "duration": "10-20", "age": "2-10"},
22
+ {"name": "Lacing cards or bead stringing", "tags": ["quiet", "independent", "low_cleanup", "indoor", "fine_motor"], "energy": "low", "duration": "15-30", "age": "3-6"},
23
+ {"name": "Simple board games", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding"], "energy": "medium", "duration": "20-60", "age": "4-12"},
24
+ {"name": "Card games like Go Fish or Uno", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding"], "energy": "medium", "duration": "15-30", "age": "4-12"},
25
+ {"name": "Simon Says or freeze dance", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "energy_outlet"], "energy": "medium", "duration": "10-20", "age": "3-10"},
26
+ {"name": "Yoga or stretching for kids", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "calming"], "energy": "low", "duration": "10-20", "age": "3-10"},
27
+ {"name": "Indoor scavenger hunt", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "physical"], "energy": "medium", "duration": "15-30", "age": "3-10"},
28
+ {"name": "Balloon volleyball", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "energy_outlet"], "energy": "medium", "duration": "10-20", "age": "4-12"},
29
+ {"name": "Hot potato with a soft ball", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding"], "energy": "medium", "duration": "10-15", "age": "3-10"},
30
+ {"name": "Play doctor or vet with stuffed animals", "tags": ["multi_child", "indoor", "low_cleanup", "imaginative", "empathy"], "energy": "low", "duration": "15-30", "age": "3-8"},
31
+ {"name": "Cooking or baking helper", "tags": ["multi_child", "indoor", "high_cleanup", "practical", "bonding", "stem"], "energy": "high", "duration": "30-60", "age": "4-12"},
32
+ {"name": "Meal prep with safe tasks", "tags": ["multi_child", "indoor", "medium_cleanup", "practical", "bonding"], "energy": "medium", "duration": "20-40", "age": "4-12"},
33
+ {"name": "Sidewalk chalk", "tags": ["outdoor", "creative", "low_cleanup", "physical"], "energy": "medium", "duration": "15-45", "age": "3-12"},
34
+ {"name": "Bubble blowing", "tags": ["outdoor", "multi_child", "low_cleanup", "sensory", "physical"], "energy": "medium", "duration": "10-30", "age": "1-10"},
35
+ {"name": "Backyard or patio water play", "tags": ["outdoor", "multi_child", "medium_cleanup", "sensory", "physical"], "energy": "medium", "duration": "15-45", "age": "1-8"},
36
+ {"name": "Sandbox or kinetic sand", "tags": ["outdoor", "independent", "medium_cleanup", "sensory", "tactile"], "energy": "low", "duration": "15-45", "age": "1-8"},
37
+ {"name": "Nature walk or bug hunt", "tags": ["outdoor", "multi_child", "low_cleanup", "cognitive", "physical", "stem"], "energy": "medium", "duration": "20-60", "age": "3-12"},
38
+ {"name": "Riding bikes or scooters", "tags": ["outdoor", "multi_child", "low_cleanup", "physical", "energy_outlet"], "energy": "high", "duration": "20-60", "age": "3-12"},
39
+ {"name": "Playground visit", "tags": ["outdoor", "multi_child", "low_cleanup", "physical", "energy_outlet"], "energy": "high", "duration": "30-60", "age": "1-12"},
40
+ {"name": "Backyard camping or picnic", "tags": ["outdoor", "multi_child", "low_cleanup", "imaginative", "bonding"], "energy": "medium", "duration": "30-60", "age": "3-12"},
41
+ {"name": "Gardening or planting seeds", "tags": ["outdoor", "multi_child", "medium_cleanup", "practical", "stem", "nature"], "energy": "medium", "duration": "20-45", "age": "3-12"},
42
+ {"name": "Cloud watching or stargazing", "tags": ["outdoor", "quiet", "low_cleanup", "cognitive", "nature", "screen_free"], "energy": "low", "duration": "10-30", "age": "2-12"},
43
+ {"name": "Sprinkler or hose play", "tags": ["outdoor", "multi_child", "medium_cleanup", "sensory", "physical", "energy_outlet"], "energy": "high", "duration": "15-30", "age": "2-10"},
44
+ {"name": "Chalk obstacle course", "tags": ["outdoor", "multi_child", "low_cleanup", "physical", "creative", "energy_outlet"], "energy": "high", "duration": "15-30", "age": "3-10"},
45
+ {"name": "Neighborhood walk with a mission", "tags": ["outdoor", "multi_child", "low_cleanup", "physical", "cognitive", "nature"], "energy": "medium", "duration": "20-45", "age": "3-12"},
46
+ {"name": "Rock or leaf collecting", "tags": ["outdoor", "quiet", "low_cleanup", "cognitive", "nature", "stem"], "energy": "low", "duration": "15-30", "age": "3-10"},
47
+ {"name": "Outdoor reading or snack", "tags": ["outdoor", "quiet", "low_cleanup", "rest", "bonding"], "energy": "low", "duration": "15-30", "age": "1-12"},
48
+ {"name": "Watch a movie or show", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen", "rest"], "energy": "low", "duration": "30-120", "age": "2-12"},
49
+ {"name": "Tablet or handheld game", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen"], "energy": "low", "duration": "15-60", "age": "4-12"},
50
+ {"name": "Video call with grandparent or friend", "tags": ["quiet", "indoor", "low_cleanup", "screen", "bonding", "social"], "energy": "low", "duration": "15-30", "age": "2-12"},
51
+ {"name": "Nap or quiet rest", "tags": ["quiet", "independent", "low_cleanup", "indoor", "rest", "essential"], "energy": "low", "duration": "30-120", "age": "1-5"},
52
+ {"name": "Cuddle and story", "tags": ["quiet", "indoor", "low_cleanup", "bonding", "rest", "calming"], "energy": "low", "duration": "10-30", "age": "1-8"},
53
+ {"name": "Calm music or lullabies", "tags": ["quiet", "independent", "low_cleanup", "indoor", "rest", "calming", "screen_free"], "energy": "low", "duration": "15-45", "age": "0-12"},
54
+ {"name": "Simple breathing or relaxation exercises", "tags": ["quiet", "indoor", "low_cleanup", "rest", "calming", "wellness"], "energy": "low", "duration": "5-15", "age": "3-12"},
55
+ {"name": "Warm bath with toys", "tags": ["independent", "medium_cleanup", "indoor", "sensory", "calming", "rest"], "energy": "low", "duration": "20-45", "age": "1-8"},
56
+ {"name": "Massage or back rub", "tags": ["quiet", "indoor", "low_cleanup", "bonding", "rest", "calming"], "energy": "low", "duration": "5-15", "age": "1-10"},
57
+ {"name": "Set up a calm-down corner", "tags": ["quiet", "independent", "low_cleanup", "indoor", "rest", "calming", "wellness"], "energy": "low", "duration": "10-30", "age": "2-10"},
58
+ {"name": "Watch fish tank or relaxing visuals", "tags": ["quiet", "independent", "low_cleanup", "indoor", "calming", "sensory"], "energy": "low", "duration": "10-30", "age": "1-12"},
59
+ {"name": "Gentle stretching or toddler yoga", "tags": ["quiet", "indoor", "low_cleanup", "calming", "physical", "wellness"], "energy": "low", "duration": "10-20", "age": "2-10"},
60
+ {"name": "Put on a puppet show", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "imaginative", "bonding"], "energy": "medium", "duration": "20-45", "age": "3-10"},
61
+ {"name": "Make a simple craft with paper and glue", "tags": ["independent", "medium_cleanup", "indoor", "creative", "fine_motor"], "energy": "medium", "duration": "15-45", "age": "3-10"},
62
+ {"name": "Paper airplane contest", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "stem", "physical"], "energy": "medium", "duration": "15-30", "age": "4-12"},
63
+ {"name": "Build a marble run", "tags": ["multi_child", "indoor", "low_cleanup", "stem", "creative", "cognitive"], "energy": "medium", "duration": "20-45", "age": "4-12"},
64
+ {"name": "Make a simple musical instrument", "tags": ["independent", "medium_cleanup", "indoor", "creative", "music", "stem"], "energy": "medium", "duration": "20-45", "age": "4-10"},
65
+ {"name": "Finger painting with washable paint", "tags": ["independent", "high_cleanup", "indoor", "creative", "sensory", "tactile"], "energy": "medium", "duration": "15-30", "age": "1-6"},
66
+ {"name": "Collage with magazines and scissors", "tags": ["independent", "medium_cleanup", "indoor", "creative", "fine_motor"], "energy": "medium", "duration": "20-45", "age": "4-10"},
67
+ {"name": "Build a cardboard box creation", "tags": ["independent", "medium_cleanup", "indoor", "creative", "stem", "imaginative"], "energy": "medium", "duration": "30-60", "age": "3-10"},
68
+ {"name": "Make friendship bracelets", "tags": ["independent", "low_cleanup", "indoor", "creative", "fine_motor", "bonding"], "energy": "low", "duration": "20-60", "age": "5-12"},
69
+ {"name": "Shadow puppets with a flashlight", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "imaginative", "stem"], "energy": "low", "duration": "10-30", "age": "3-10"},
70
+ {"name": "Make a simple necklace with pasta", "tags": ["independent", "low_cleanup", "indoor", "creative", "fine_motor"], "energy": "low", "duration": "15-30", "age": "3-6"},
71
+ {"name": "Homemade playdough", "tags": ["independent", "high_cleanup", "indoor", "creative", "sensory", "tactile"], "energy": "medium", "duration": "20-45", "age": "2-8"},
72
+ {"name": "Make paper bag puppets", "tags": ["independent", "medium_cleanup", "indoor", "creative", "fine_motor", "imaginative"], "energy": "medium", "duration": "15-30", "age": "3-8"},
73
+ {"name": "Create a treasure map", "tags": ["independent", "low_cleanup", "indoor", "creative", "cognitive", "imaginative"], "energy": "low", "duration": "15-30", "age": "4-10"},
74
+ {"name": "Build a tower with recycled materials", "tags": ["independent", "low_cleanup", "indoor", "creative", "stem", "cognitive"], "energy": "medium", "duration": "15-45", "age": "3-10"},
75
+ {"name": "Write and illustrate a simple story", "tags": ["independent", "low_cleanup", "indoor", "creative", "literacy", "cognitive"], "energy": "low", "duration": "20-60", "age": "5-12"},
76
+ {"name": "Threading beads or buttons", "tags": ["independent", "low_cleanup", "indoor", "fine_motor", "creative"], "energy": "low", "duration": "15-30", "age": "3-6"},
77
+ {"name": "Make a paper chain", "tags": ["independent", "low_cleanup", "indoor", "creative", "fine_motor", "math"], "energy": "low", "duration": "15-30", "age": "3-8"},
78
+ {"name": "Create a family tree drawing", "tags": ["independent", "low_cleanup", "indoor", "creative", "social", "cognitive"], "energy": "low", "duration": "20-45", "age": "5-12"},
79
+ {"name": "Indoor bowling with plastic bottles", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "stem"], "energy": "medium", "duration": "10-20", "age": "3-10"},
80
+ {"name": "Ball toss into a basket", "tags": ["independent", "indoor", "low_cleanup", "physical", "cognitive"], "energy": "medium", "duration": "10-20", "age": "2-10"},
81
+ {"name": "Jumping jacks or hopscotch", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "energy_outlet"], "energy": "high", "duration": "10-20", "age": "3-10"},
82
+ {"name": "Dance party to favorite songs", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "music", "energy_outlet", "bonding"], "energy": "high", "duration": "10-20", "age": "2-12"},
83
+ {"name": "Indoor obstacle course with cushions", "tags": ["multi_child", "indoor", "medium_cleanup", "physical", "energy_outlet"], "energy": "high", "duration": "15-30", "age": "3-10"},
84
+ {"name": "Follow the leader indoors", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding"], "energy": "medium", "duration": "10-20", "age": "2-8"},
85
+ {"name": "Toss a beanbag or soft ball", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "cognitive"], "energy": "medium", "duration": "10-20", "age": "3-10"},
86
+ {"name": "Animal walks around the house", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "energy_outlet", "imaginative"], "energy": "high", "duration": "10-20", "age": "3-8"},
87
+ {"name": "Balance beam with tape on floor", "tags": ["independent", "indoor", "low_cleanup", "physical", "cognitive"], "energy": "medium", "duration": "10-20", "age": "3-10"},
88
+ {"name": "Target practice with soft balls", "tags": ["independent", "indoor", "low_cleanup", "physical", "cognitive"], "energy": "medium", "duration": "10-20", "age": "4-10"},
89
+ {"name": "Freeze dance with music", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "music", "energy_outlet", "bonding"], "energy": "high", "duration": "10-20", "age": "2-10"},
90
+ {"name": "Tightrope walk with a line on floor", "tags": ["independent", "indoor", "low_cleanup", "physical", "cognitive"], "energy": "medium", "duration": "10-20", "age": "3-10"},
91
+ {"name": "Pass the parcel or simple relay", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding"], "energy": "medium", "duration": "15-30", "age": "3-10"},
92
+ {"name": "Animal yoga poses", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "calming", "wellness", "imaginative"], "energy": "low", "duration": "10-20", "age": "3-10"},
93
+ {"name": "Simon Says with body parts", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "cognitive", "bonding"], "energy": "medium", "duration": "10-20", "age": "3-8"},
94
+ {"name": "Story dice or storytelling game", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "cognitive", "bonding", "literacy"], "energy": "low", "duration": "15-30", "age": "4-12"},
95
+ {"name": "Would you rather questions", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding", "social"], "energy": "low", "duration": "10-20", "age": "4-12"},
96
+ {"name": "I Spy or 20 Questions", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding"], "energy": "low", "duration": "10-20", "age": "3-12"},
97
+ {"name": "Charades or acting games", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding", "imaginative"], "energy": "medium", "duration": "15-30", "age": "4-12"},
98
+ {"name": "Make a family quiz or trivia", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding", "social"], "energy": "low", "duration": "20-45", "age": "5-12"},
99
+ {"name": "Practice tongue twisters", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "literacy", "bonding"], "energy": "low", "duration": "10-15", "age": "4-12"},
100
+ {"name": "Tell a chain story", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "literacy", "bonding"], "energy": "low", "duration": "15-30", "age": "4-12"},
101
+ {"name": "Play memory or matching games", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding"], "energy": "low", "duration": "15-30", "age": "3-10"},
102
+ {"name": "Rhyming games or word associations", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "literacy", "bonding"], "energy": "low", "duration": "10-20", "age": "4-10"},
103
+ {"name": "Draw a map of your house or neighborhood", "tags": ["independent", "low_cleanup", "indoor", "creative", "cognitive", "spatial"], "energy": "low", "duration": "20-45", "age": "5-12"},
104
+ {"name": "Mazes or dot-to-dot", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "fine_motor"], "energy": "low", "duration": "15-30", "age": "4-10"},
105
+ {"name": "Simple science experiments", "tags": ["independent", "medium_cleanup", "indoor", "stem", "cognitive", "sensory"], "energy": "medium", "duration": "20-45", "age": "5-12"},
106
+ {"name": "Pattern blocks or tangrams", "tags": ["independent", "low_cleanup", "indoor", "stem", "cognitive", "spatial"], "energy": "low", "duration": "15-30", "age": "4-10"},
107
+ {"name": "Sudoku or logic puzzles", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "stem"], "energy": "low", "duration": "15-45", "age": "6-12"},
108
+ {"name": "Learn a simple magic trick", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "creative", "performance"], "energy": "low", "duration": "20-45", "age": "6-12"},
109
+ {"name": "Mental math challenges", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "stem", "math"], "energy": "low", "duration": "10-20", "age": "6-12"},
110
+ {"name": "Geography or map games", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "stem", "spatial"], "energy": "low", "duration": "15-30", "age": "5-12"},
111
+ {"name": "Simple coding or logic games", "tags": ["independent", "low_cleanup", "indoor", "stem", "cognitive", "screen"], "energy": "low", "duration": "15-45", "age": "5-12"},
112
+ {"name": "Jigsaw puzzle", "tags": ["independent", "low_cleanup", "indoor", "cognitive", "spatial"], "energy": "low", "duration": "20-60", "age": "4-12"},
113
+ {"name": "Memory match with household items", "tags": ["independent", "low_cleanup", "indoor", "cognitive"], "energy": "low", "duration": "10-20", "age": "3-8"},
114
+ {"name": "Sort and organize a drawer or shelf", "tags": ["independent", "low_cleanup", "indoor", "practical", "cognitive", "wellness"], "energy": "low", "duration": "15-30", "age": "5-12"},
115
+ {"name": "Trace and draw from a picture book", "tags": ["independent", "low_cleanup", "indoor", "creative", "fine_motor", "literacy"], "energy": "low", "duration": "15-30", "age": "4-10"},
116
+ {"name": "Measure and compare objects", "tags": ["independent", "low_cleanup", "indoor", "stem", "cognitive", "math"], "energy": "low", "duration": "15-30", "age": "4-10"},
117
+ {"name": "Tidy up room with a timer", "tags": ["independent", "low_cleanup", "indoor", "practical", "cognitive", "wellness"], "energy": "medium", "duration": "10-20", "age": "4-12"},
118
+ {"name": "Pack a bag for a pretend trip", "tags": ["independent", "low_cleanup", "indoor", "imaginative", "practical", "cognitive"], "energy": "low", "duration": "15-30", "age": "3-10"},
119
+ {"name": "Create a restaurant menu", "tags": ["independent", "low_cleanup", "indoor", "creative", "cognitive", "literacy", "math"], "energy": "low", "duration": "20-45", "age": "5-12"},
120
+ {"name": "Design a dream bedroom", "tags": ["independent", "low_cleanup", "indoor", "creative", "spatial", "cognitive"], "energy": "low", "duration": "20-45", "age": "5-12"},
121
+ {"name": "Make a comic strip", "tags": ["independent", "low_cleanup", "indoor", "creative", "literacy", "cognitive"], "energy": "low", "duration": "20-60", "age": "6-12"},
122
+ {"name": "Play store with toy money", "tags": ["independent", "low_cleanup", "indoor", "creative", "math", "cognitive", "practical"], "energy": "low", "duration": "15-30", "age": "4-10"},
123
+ {"name": "Make a time capsule", "tags": ["independent", "low_cleanup", "indoor", "creative", "cognitive", "social"], "energy": "low", "duration": "20-45", "age": "5-12"},
124
+ {"name": "Write a letter to a relative", "tags": ["independent", "low_cleanup", "indoor", "creative", "literacy", "social", "bonding"], "energy": "low", "duration": "15-30", "age": "5-12"},
125
+ {"name": "Create a family newspaper", "tags": ["independent", "low_cleanup", "indoor", "creative", "literacy", "cognitive"], "energy": "low", "duration": "20-60", "age": "6-12"},
126
+ {"name": "Build a mini golf course indoors", "tags": ["multi_child", "indoor", "medium_cleanup", "physical", "creative", "stem"], "energy": "medium", "duration": "20-45", "age": "4-10"},
127
+ {"name": "Indoor relay race with rules", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding", "energy_outlet"], "energy": "high", "duration": "15-30", "age": "4-10"},
128
+ {"name": "Mirror me game", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding", "cognitive"], "energy": "medium", "duration": "10-20", "age": "3-10"},
129
+ {"name": "Musical statues or chairs", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "music", "energy_outlet", "bonding"], "energy": "high", "duration": "10-20", "age": "3-10"},
130
+ {"name": "Pass the balloon", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding"], "energy": "medium", "duration": "10-20", "age": "3-10"},
131
+ {"name": "Sardines or hide and seek", "tags": ["multi_child", "indoor", "low_cleanup", "physical", "bonding"], "energy": "medium", "duration": "15-30", "age": "3-10"},
132
+ {"name": "Build a domino chain", "tags": ["independent", "low_cleanup", "indoor", "stem", "cognitive", "creative"], "energy": "low", "duration": "15-45", "age": "5-12"},
133
+ {"name": "Make a simple board game", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "cognitive", "bonding"], "energy": "medium", "duration": "30-60", "age": "5-12"},
134
+ {"name": "Create a family motto or crest", "tags": ["multi_child", "indoor", "low_cleanup", "creative", "bonding", "social"], "energy": "low", "duration": "20-45", "age": "5-12"},
135
+ {"name": "Play hot and cold with an object", "tags": ["multi_child", "indoor", "low_cleanup", "cognitive", "bonding"], "energy": "medium", "duration": "10-20", "age": "3-10"},
136
+ {"name": "Make a gratitude list", "tags": ["independent", "low_cleanup", "indoor", "wellness", "cognitive", "social"], "energy": "low", "duration": "10-20", "age": "5-12"},
137
+ {"name": "Practice simple origami", "tags": ["independent", "low_cleanup", "indoor", "creative", "fine_motor", "cognitive"], "energy": "low", "duration": "15-30", "age": "5-12"},
138
+ {"name": "Indoor picnic with snack prep", "tags": ["multi_child", "indoor", "medium_cleanup", "practical", "bonding", "rest"], "energy": "medium", "duration": "20-45", "age": "3-10"},
139
+ {"name": "Watch a nature documentary", "tags": ["quiet", "independent", "low_cleanup", "indoor", "screen", "nature", "stem"], "energy": "low", "duration": "30-60", "age": "4-12"},
140
+ {"name": "Create a weather chart", "tags": ["independent", "low_cleanup", "indoor", "stem", "nature", "cognitive"], "energy": "low", "duration": "15-30", "age": "4-10"},
141
+ {"name": "Make a simple bird feeder", "tags": ["independent", "medium_cleanup", "outdoor", "nature", "practical", "stem"], "energy": "medium", "duration": "20-45", "age": "4-10"},
142
+ {"name": "Cloud shapes or weather watching", "tags": ["outdoor", "quiet", "low_cleanup", "nature", "cognitive", "screen_free"], "energy": "low", "duration": "15-30", "age": "2-12"},
143
+ {"name": "Start a simple journal or diary", "tags": ["independent", "low_cleanup", "indoor", "creative", "literacy", "wellness"], "energy": "low", "duration": "10-20", "age": "6-12"},
144
+ {"name": "Make a paper airplane landing strip", "tags": ["independent", "indoor", "low_cleanup", "stem", "creative", "physical"], "energy": "medium", "duration": "15-30", "age": "5-12"}
145
+ ]
146
+ }
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio>=4.0.0
2
+ transformers>=4.40.0
3
+ torch>=2.0.0
4
+ accelerate>=0.25.0