from smolagents import Tool from typing import Any, Optional class SimpleTool(Tool): name = "plan_diet" description = "Creates a simple daily diet plan based on fitness goals." inputs = {"goal":{"type":"string","description":"The fitness goal (e.g., 'weight_loss', 'muscle_gain', 'maintenance')"}} output_type = "string" def forward(self, goal: str) -> str: """ Creates a simple daily diet plan based on fitness goals. Args: goal: The fitness goal (e.g., 'weight_loss', 'muscle_gain', 'maintenance') """ if goal == "weight_loss": return "Breakfast: Oatmeal with berries\nLunch: Grilled chicken salad\nDinner: Baked fish with vegetables\nSnacks: Greek yogurt, almonds" elif goal == "muscle_gain": return "Breakfast: Protein shake with eggs\nLunch: Chicken breast with rice\nDinner: Steak with sweet potato\nSnacks: Peanut butter, protein bar" elif goal == "maintenance": return "Breakfast: Scrambled eggs with toast\nLunch: Turkey sandwich\nDinner: Salmon with quinoa\nSnacks: Fruit, mixed nuts" else: return "Please specify a valid goal: 'weight_loss', 'muscle_gain', or 'maintenance'"