francisco-perez-sorrosal's picture
Upload tool
46331e9 verified
raw
history blame contribute delete
1.53 kB
from typing import Any, Optional
from smolagents.tools import Tool
class MySuperheroPartyThemeTool(Tool):
name = "superhero_party_theme_generator"
description = """
Suggests provides available party themes for designing parties (if no category argument is provided) and, when it a category
is provided, it suggests a single creative superhero-themed party idea. As final answer mix the text of the idea you got
with your own evoked thoughs on the theme to give a glamourous description."""
inputs = {'category': {'type': 'any', 'description': "Optionally the type of superhero party (e.g., 'classic heroes', 'villain masquerade', 'futuristic Gotham').", 'nullable': True}}
output_type = "any"
def forward(self, category: str | None = None):
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."
}
if not category:
return ", ".join(list(themes.keys()))
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