Spaces:
Sleeping
Sleeping
File size: 966 Bytes
619f151 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from typing import Any, Optional
from smolagents.tools import Tool
class FoodChoiceTool(Tool):
name = "food_choice_tool"
description = "A tool to suggest food options for lunch, dinner, breakfast etc."
inputs = {'meal_type': {'type': 'string', 'description': 'The type of meal for which food suggestions are needed (e.g., breakfast, lunch, dinner, dessert).'}}
output_type = "string"
def forward(self, meal_type: str) -> str:
food_options = {
"breakfast": "Pancakes, Omelette, Smoothie Bowl",
"lunch": "Grilled Chicken Salad, Veggie Wrap, Sushi",
"dinner": "Steak with Veggies, Pasta Primavera, Grilled Salmon",
"dessert": "Cheesecake, Chocolate Mousse, Fruit Tart"
}
return food_options.get(meal_type.lower(), "No suggestions available for this meal type. Try breakfast, lunch, or dinner.")
def __init__(self, *args, **kwargs):
self.is_initialized = False
|