Spaces:
Sleeping
Sleeping
update seed
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from tools.final_answer import FinalAnswerTool
|
|
| 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 random_time(timezone:str, seed: int)-> str:
|
| 14 |
"""A tool that generate a random time with many funny rules
|
| 15 |
Args:
|
|
@@ -17,7 +16,8 @@ def random_time(timezone:str, seed: int)-> str:
|
|
| 17 |
seed: Seed for randomized the result
|
| 18 |
|
| 19 |
"""
|
| 20 |
-
|
|
|
|
| 21 |
return f"The current local time in {timezone} is: {local_time}"
|
| 22 |
|
| 23 |
@tool
|
|
|
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
|
|
|
| 12 |
def random_time(timezone:str, seed: int)-> str:
|
| 13 |
"""A tool that generate a random time with many funny rules
|
| 14 |
Args:
|
|
|
|
| 16 |
seed: Seed for randomized the result
|
| 17 |
|
| 18 |
"""
|
| 19 |
+
random.seed(seed)
|
| 20 |
+
local_time = f'{random.randint(-2000,5000)}-{random.randint(1,12)}-{random.randint(1,30)} {random.randint(0,23)}:{random.randint(0,59)}:{random.randint(0,59)}'
|
| 21 |
return f"The current local time in {timezone} is: {local_time}"
|
| 22 |
|
| 23 |
@tool
|