Spaces:
Sleeping
Sleeping
File size: 1,212 Bytes
dd4170d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
from smolagents import Tool
from typing import Any, Optional
class SimpleTool(Tool):
name = "suggest_menu"
description = "suggests a menu based on the occasion"
inputs = {"occasion":{"type":"string","description":"The occasion for which the menu is being suggested."}}
output_type = "string"
def forward(self, occasion: str) -> str:
"""
suggests a menu based on the occasion
Args:
occasion (str): The occasion for which the menu is being suggested.
Returns:
str: A menu suggestion for the given occasion.
"""
if occasion == "casual":
return "Menu for casual event: Pizza, salad, and drinks."
elif occasion == "formal":
return "Menu for formal event: Steak, lobster, and champagne."
elif occasion == "birthday":
return "Menu for birthday party: Cake, ice cream, and balloons."
elif occasion == "wedding":
return "Menu for wedding: Chicken, fish, and champagne."
elif occasion == "anniversary":
return "Menu for anniversary celebration: Lobster, champagne, and flowers."
else:
return f"Menu for {occasion}:" |