Spaces:
Sleeping
Sleeping
File size: 1,231 Bytes
954a8ef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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'" |