LuisMBA commited on
Commit
86e9d6b
·
verified ·
1 Parent(s): 8bc1bba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -4,21 +4,24 @@ import requests
4
  import pytz
5
  import yaml
6
  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 roll_dice() -> str:
13
  """
14
- Simulates rolling two dice and returns their values as a string.
 
 
 
15
 
16
  Returns:
17
- str: A message indicating the values of the two dice.
18
  """
19
- die1 = random.randint(1, 6)
20
- die2 = random.randint(1, 6)
21
- return f"The values of the dice are {die1} and {die2}."
22
 
23
  @tool
24
  def get_current_time_in_timezone(timezone: str) -> str:
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
+ import random
8
 
9
  from Gradio_UI import GradioUI
10
 
11
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
12
  @tool
13
+ def roll_dice(num_dice: int) -> str:
14
  """
15
+ Simulates rolling a specified number of dice and returns their values as a string.
16
+
17
+ Args:
18
+ num_dice (int): The number of dice to roll.
19
 
20
  Returns:
21
+ str: A message indicating the values of the rolled dice.
22
  """
23
+ dice_values = [random.randint(1, 6) for _ in range(num_dice)]
24
+ return f"The values of the {num_dice} dice are: {', '.join(map(str, dice_values))}."
 
25
 
26
  @tool
27
  def get_current_time_in_timezone(timezone: str) -> str: