Spaces:
Sleeping
Sleeping
added give_compliment tool
Browse files
app.py
CHANGED
@@ -33,6 +33,22 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
33 |
except Exception as e:
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
final_answer = FinalAnswerTool()
|
38 |
|
|
|
33 |
except Exception as e:
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
+
@tool
|
37 |
+
def give_compliment(name: str) -> str:
|
38 |
+
"""A tool that gives a random compliment to the person.
|
39 |
+
Args:
|
40 |
+
name: The name of the person to compliment.
|
41 |
+
"""
|
42 |
+
compliments = [
|
43 |
+
"has a great sense of humor",
|
44 |
+
"is an honest and kind-hearted person",
|
45 |
+
"has a lot of resilience and agency",
|
46 |
+
"has both high IQ and EQ",
|
47 |
+
"works hard, is a good team player, and remains humble"
|
48 |
+
]
|
49 |
+
import random
|
50 |
+
return f"{name} {random.choice(compliments)}"
|
51 |
+
|
52 |
|
53 |
final_answer = FinalAnswerTool()
|
54 |
|