rathore11 commited on
Commit
a45a5b4
·
verified ·
1 Parent(s): cc6e8bf

Upload tool

Browse files
Files changed (3) hide show
  1. app.py +6 -0
  2. requirements.txt +1 -0
  3. tool.py +22 -0
app.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from smolagents import launch_gradio_demo
2
+ from tool import SuperheroPartyThemeTool
3
+
4
+ tool = SuperheroPartyThemeTool()
5
+
6
+ launch_gradio_demo(tool)
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ smolagents
tool.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Any, Optional
2
+ from smolagents.tools import Tool
3
+
4
+ class SuperheroPartyThemeTool(Tool):
5
+ name = "birthday_party_theme_generator"
6
+ description = """
7
+ This tool suggests creative birthday-themed party ideas based on a category.
8
+ It returns a unique party theme idea."""
9
+ inputs = {'category': {'type': 'string', 'description': "The type of birthday party (e.g., 'classic birthday', 'jungle safari', 'party in bollywood')."}}
10
+ output_type = "string"
11
+
12
+ def forward(self, category: str):
13
+ themes = {
14
+ "classic birthday": "Classical dressing: Guests come dressed as their favorite DC heroes with themed cocktails like 'The Kryptonite Punch'.",
15
+ "jungle safari": "Jungle masti: A mysterious masquerade where guests dress as animals.",
16
+ "party in bollywood": "bollywood style: dress like bollywood actors. A cyberpunk-style party inspired by Batman Beyond, with neon decorations and futuristic gadgets."
17
+ }
18
+
19
+ return themes.get(category.lower(), "Themed party idea not found. Try 'classic birthday', 'jungle safari', or 'party in bollywood'.")
20
+
21
+ def __init__(self, *args, **kwargs):
22
+ self.is_initialized = False