from smolagents import Tool from typing import Any, Optional class SimpleTool(Tool): name = "plan_recovery" description = "Suggests recovery activities based on workout type." inputs = {"workout_type":{"type":"string","description":"Type of workout performed (e.g., 'strength', 'cardio', 'mixed')"}} output_type = "string" def forward(self, workout_type: str) -> str: """ Suggests recovery activities based on workout type. Args: workout_type: Type of workout performed (e.g., 'strength', 'cardio', 'mixed') """ if workout_type == "strength": return "Recovery Plan:\n- 10min light stretching\n- Foam rolling (15min)\n- Protein shake within 30min\n- 48hr muscle group rest" elif workout_type == "cardio": return "Recovery Plan:\n- 5min cool-down walk\n- Dynamic stretching (10min)\n- Electrolyte drink\n- 24hr light activity rest" elif workout_type == "mixed": return "Recovery Plan:\n- 10min full-body stretch\n- Foam rolling (10min)\n- Balanced meal within 1hr\n- 36hr moderate rest" else: return "Please specify workout type: 'strength', 'cardio', or 'mixed'"