Spaces:
Runtime error
Runtime error
Sandhya
commited on
Commit
·
ce38146
1
Parent(s):
ca6e1f5
First commit
Browse files
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from smolagents import CodeAgent,Tool,InferenceClientModel
|
| 2 |
+
class SuperheroPartyThemeTool(Tool):
|
| 3 |
+
name="Superhero_Party_Theme_generator"
|
| 4 |
+
description="""
|
| 5 |
+
This tool suggests creative superhero-themed party idea based on a category.
|
| 6 |
+
it returns a unique party theme idea.
|
| 7 |
+
"""
|
| 8 |
+
inputs={
|
| 9 |
+
"category":{
|
| 10 |
+
"type":"string",
|
| 11 |
+
'description':"The type of superhero party (e.g.,'classic heroes','villain masquerade','futuristic gotham')."
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
output_type="string"
|
| 15 |
+
def forward(self,category:str):
|
| 16 |
+
themes = {
|
| 17 |
+
"classic heroes": "Justice League Gala: Guests come dressed as their favorite DC heroes with themed cocktails like 'The Kryptonite Punch'.",
|
| 18 |
+
"villain masquerade": "Gotham Rogues' Ball: A mysterious masquerade where guests dress as classic Batman villains.",
|
| 19 |
+
"futuristic Gotham": "Neo-Gotham Night: A cyberpunk-style party inspired by Batman Beyond, with neon decorations and futuristic gadgets."
|
| 20 |
+
}
|
| 21 |
+
return themes.get(category.lower(),"Themed party idea not found .Try 'classic heroes','villain masquerade','futuristic gotham'")
|
| 22 |
+
|
| 23 |
+
tool=SuperheroPartyThemeTool()
|
| 24 |
+
agent=CodeAgent(tools=[tool],model=InferenceClientModel())
|
| 25 |
+
result=agent.run("What would be a good superhero party idea for a villain masquerade theme")
|
| 26 |
+
print(result)
|