Spaces:
Sleeping
Sleeping
Download tool.py from felipe93/party_theme_tool: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/felipe93/party_theme_tool/resolve/main/tool.py
- Command line
-
hf download hf://spaces/felipe93/party_theme_tool/tool.py
-
curl -L -o tool.py https://huggingface.co/spaces/felipe93/party_theme_tool/resolve/main/tool.py
1.21 kB
| from typing import Any, Optional | |
| from smolagents.tools import Tool | |
| class SuperheroPartyThemeTool(Tool): | |
| name = "superhero_party_theme_generator" | |
| description = """ | |
| This tool suggest creative superhero-themed party ideas based on a category. | |
| It returns a unique party theme idea. | |
| """ | |
| inputs = {'category': {'type': 'string', 'description': "The type of superhero party (e.g., 'classic heroes', 'villain masquerade', 'futuristic Gotham')."}} | |
| output_type = "string" | |
| def forward(self, category: str): | |
| themes = { | |
| "classic heroes": "Justice League Gala: Guests come dressed as their favorite DC heroes with themed cocktails like 'The Kryptonite Punch'.", | |
| "villain masquerade": "Gotham Rogues' Ball: A mysterious masquerade where guests dress as classic Batman villains.", | |
| "futuristic Gotham": "Neo-Gotham Night: A cyberpunk-style party inspired by Batman Beyond, with neon decorations and futuristic gadgets." | |
| } | |
| return themes.get(category.lower(), "Themed party idea not found. Try 'classic heroes', 'villain masquerade', or 'futuristic Gotham'.") | |
| def __init__(self, *args, **kwargs): | |
| self.is_initialized = False | |