Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,17 +9,27 @@ 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 get_family_age(my_family:str)->
|
13 |
-
"""A tool that looks up family ages and returns a
|
|
|
14 |
Args:
|
15 |
-
my_family: A string representing
|
|
|
|
|
16 |
"""
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
@tool
|
25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
9 |
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
@tool
|
12 |
+
def get_family_age(my_family: str) -> str:
|
13 |
+
"""A tool that looks up family ages and returns a formatted string with the family member's age.
|
14 |
+
|
15 |
Args:
|
16 |
+
my_family: A string representing the family member type to retrieve the age for (e.g., 'father', 'mother')
|
17 |
+
Returns:
|
18 |
+
A string with the family member's age
|
19 |
"""
|
20 |
+
my_family_age = {
|
21 |
+
"father": 60,
|
22 |
+
"mother": 61,
|
23 |
+
"sister": 40,
|
24 |
+
"brother": 42,
|
25 |
+
"dog": 17
|
26 |
+
}
|
27 |
+
|
28 |
+
if my_family.lower() in my_family_age:
|
29 |
+
age = my_family_age[my_family.lower()]
|
30 |
+
return f"my {my_family} is {age} years old"
|
31 |
+
else:
|
32 |
+
return f"Family member '{my_family}' not found"
|
33 |
|
34 |
@tool
|
35 |
def get_current_time_in_timezone(timezone: str) -> str:
|