food-choice-tool / tool.py
amaniopia's picture
Upload tool
619f151 verified
raw
history blame contribute delete
966 Bytes
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