Spaces:
Runtime error
Runtime error
Download tools/suggest_menu.py from mlops-pltf/AlfredAgent: direct link, hf CLI and curl.
- Browser
- Download file 850 Bytes
-
https://huggingface.co/spaces/mlops-pltf/AlfredAgent/resolve/main/tools/suggest_menu.py
- Command line
-
hf download hf://spaces/mlops-pltf/AlfredAgent/tools/suggest_menu.py
-
curl -L -o suggest_menu.py https://huggingface.co/spaces/mlops-pltf/AlfredAgent/resolve/main/tools/suggest_menu.py
850 Bytes
| 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 type of occasion for the party.'}} | |
| output_type = "string" | |
| def forward(self, occasion: str) -> str: | |
| """ | |
| Suggests a menu based on the occasion. | |
| Args: | |
| occasion: The type of occasion for the party. | |
| """ | |
| if "casual" in occasion.lower(): | |
| return "Pizza, snacks, and drinks." | |
| elif "formal" in occasion.lower(): | |
| return "3-course dinner with wine and dessert." | |
| elif "superhero" in occasion.lower(): | |
| return "Buffet with high-energy and healthy food." | |
| else: | |
| return "Custom menu for the butler." |