lcapriles commited on
Commit
63aa8a5
·
verified ·
1 Parent(s): 844f2bb

Update with menu tool

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py CHANGED
@@ -11,4 +11,26 @@ from Gradio_UI import GradioUI
11
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())
12
  agent.run("Search for the best music recommendations for a party at the Wayne's mansion.")
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  GradioUI(agent).launch()
 
11
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())
12
  agent.run("Search for the best music recommendations for a party at the Wayne's mansion.")
13
 
14
+ # Tool to suggest a menu based on the occasion
15
+ def suggest_menu(occasion: str) -> str:
16
+ """
17
+ Suggests a menu based on the occasion.
18
+ Args:
19
+ occasion: The type of occasion for the party.
20
+ """
21
+ if occasion == "casual":
22
+ return "Pizza, snacks, and drinks."
23
+ elif occasion == "formal":
24
+ return "3-course dinner with wine and dessert."
25
+ elif occasion == "superhero":
26
+ return "Buffet with high-energy and healthy food."
27
+ else:
28
+ return "Custom menu for the butler."
29
+
30
+ # Alfred, the butler, preparing the menu for the party
31
+ agent = CodeAgent(tools=[suggest_menu], model=HfApiModel())
32
+
33
+ # Preparing the menu for the party
34
+ agent.run("Prepare a formal menu for the party.")
35
+
36
  GradioUI(agent).launch()