Spaces:
Sleeping
Sleeping
from smolagents import Tool | |
from typing import Any, Optional | |
class SimpleTool(Tool): | |
name = "suggest_menu" | |
description = "Suggests a menu based on the occassion." | |
inputs = {"occassion":{"type":"string","description":"The type of occassion for the party."}} | |
output_type = "string" | |
def forward(self, occassion: str) -> str: | |
""" | |
Suggests a menu based on the occassion. | |
Args: | |
occassion: The type of occassion for the party. | |
""" | |
if occassion == "casual": | |
return "Pizza, snacks and drinks." | |
elif occassion == "formal": | |
return "3-course dinner with wine and dessert." | |
elif occassion == "superhero": | |
return "Buffet with high energy and healthy food." | |
else: | |
return "Custom menu for the bulter." |