petfol commited on
Commit
ccbbf41
·
verified ·
1 Parent(s): 99501b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -7,6 +7,23 @@ from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
@@ -58,7 +75,7 @@ with open("prompts.yaml", 'r') as stream:
58
 
59
  agent = CodeAgent(
60
  model=model,
61
- tools=[final_answer, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,
 
7
 
8
  from Gradio_UI import GradioUI
9
 
10
+ # Tool to suggest a menu based on the occasion
11
+
12
+ def suggest_menu(occasion: str) -> str:
13
+ """
14
+ Suggests a menu based on the occasion.
15
+ Args:
16
+ occasion: The type of occasion for the party.
17
+ """
18
+ if occasion == "casual":
19
+ return "Pizza, snacks, and drinks."
20
+ elif occasion == "formal":
21
+ return "3-course dinner with wine and dessert."
22
+ elif occasion == "superhero":
23
+ return "Buffet with high-energy and healthy food."
24
+ else:
25
+ return "Custom menu for the butler."
26
+
27
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
28
  @tool
29
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
75
 
76
  agent = CodeAgent(
77
  model=model,
78
+ tools=[final_answer, suggest_menu], ## add your tools here (don't remove final answer)
79
  max_steps=6,
80
  verbosity_level=1,
81
  grammar=None,