Spaces:
Runtime error
Runtime error
| from smolagents import Tool | |
| from typing import Any, Optional | |
| class SimpleTool(Tool): | |
| name = "give_celebrity_advice" | |
| description = "Give a web search term based on a vague party description to find a suitable celebrity." | |
| inputs = {"party_description":{"type":"string","description":"A vague description of the party."}} | |
| output_type = "string" | |
| def forward(self, party_description: str) -> str: | |
| """ | |
| Give a web search term based on a vague party description to find a suitable celebrity. | |
| Args: | |
| party_description: A vague description of the party. | |
| """ | |
| if "hero" in party_description: | |
| return "Someone who became very famous in the last year for doing a selfless act" | |
| elif "villain" in party_description: | |
| return "Someone who is currently the most famous dark metal rock star" | |
| else: | |
| return "Someone who has recently become famous for a very funny reason" |