CoolFace
Apppublic

rmorris-code/AlfredAgent

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
suggest_menu.py23 linesDownload Raw Back to tools
1from smolagents import Tool2from typing import Any, Optional3 4class SimpleTool(Tool):5    name = "suggest_menu"6    description = "Suggests a menu based on the occasion."7    inputs = {"occasion":{"type":"string","description":"The type of occasion for the party."}}8    output_type = "string"9 10    def forward(self, occasion: str) -> str:11        """12        Suggests a menu based on the occasion.13        Args:14            occasion: The type of occasion for the party.15        """16        if occasion == "casual":17            return "Pizza, snacks, and drinks."18        elif occasion == "formal":19            return "3-course dinner with wine and dessert."20        elif occasion == "superhero":21            return "Buffet with high-energy and healthy food."22        else:23            return "Custom menu for the butler."