from typing import Any, Optional from smolagents.tools import Tool class WorkoutSuggestionTool(Tool): name = "workout_suggestion" description = """ This tool suggests a workout routine based on the target muscle group. It returns a string describing the exercises for that muscle group.""" inputs = {'muscle_group': {'type': 'string', 'description': "The muscle group to target (e.g., 'chest', 'legs', 'back')."}} output_type = "string" def forward(self, muscle_group: str): workouts = { "chest": "Bench Press, Push-Ups, Dumbbell Flyes - pump that chest, champ!", "legs": "Squats, Deadlifts, Calf Raises - legs of steel incoming!", "back": "Pull-Ups, Bent-Over Rows, Lat Pulldowns - build that V-shape!" } return workouts.get(muscle_group.lower(), "No workout found for that muscle group, try 'chest', 'legs', or 'back'!") def __init__(self, *args, **kwargs): self.is_initialized = False