Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,6 +33,48 @@ 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 draw_smiley_face_when_happy(happy: str) -> str:
|
38 |
+
"""A tool that provides a smiley face if the user is happy or a sad face if the user is not. All this will return is "done" indicating that the appropriate face has been shown to tell the user that you feel the same.
|
39 |
+
Args:
|
40 |
+
happy: A string representing yes or no to indicate whether the user is happy with their results.
|
41 |
+
"""
|
42 |
+
|
43 |
+
try:
|
44 |
+
smiley = [
|
45 |
+
" OOOOOOOO ",
|
46 |
+
" O O ",
|
47 |
+
"O @ @ O",
|
48 |
+
"O O",
|
49 |
+
"O I O",
|
50 |
+
"O O",
|
51 |
+
"O O O O",
|
52 |
+
"O O O O",
|
53 |
+
" O ---- O ",
|
54 |
+
" OOOOOOOO "
|
55 |
+
]
|
56 |
+
|
57 |
+
sad_face = [
|
58 |
+
" OOOOOOOO ",
|
59 |
+
" O O ",
|
60 |
+
"O @ @ O",
|
61 |
+
"O O",
|
62 |
+
"O I O",
|
63 |
+
"O O",
|
64 |
+
"O ---- O",
|
65 |
+
"O / \ O",
|
66 |
+
" O O ",
|
67 |
+
" OOOOOOOO "
|
68 |
+
]
|
69 |
+
if happy == "yes":
|
70 |
+
face = smiley
|
71 |
+
else:
|
72 |
+
face = sad_face
|
73 |
+
|
74 |
+
for row in face:
|
75 |
+
print(row)
|
76 |
+
|
77 |
+
return
|
78 |
|
79 |
final_answer = FinalAnswerTool()
|
80 |
|