Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,9 +66,9 @@ def responsenew(data):
|
|
| 66 |
# print("Invalid JSON:", e)
|
| 67 |
response = model.generate_content(query)
|
| 68 |
print(f"\n{response.text}")
|
| 69 |
-
if
|
| 70 |
-
if "remind me" in
|
| 71 |
-
values = getValues(
|
| 72 |
if values[0] is not None:
|
| 73 |
msg = values[0]
|
| 74 |
else:
|
|
@@ -122,7 +122,7 @@ def responsenew(data):
|
|
| 122 |
}
|
| 123 |
}
|
| 124 |
|
| 125 |
-
elif "add to do" in
|
| 126 |
replaced_string = text.replace("add todo", "").replace("add to do","")
|
| 127 |
# 1. Replace "note down" with an empty string:
|
| 128 |
replaced_string = text.replace("note down", "")
|
|
@@ -149,7 +149,7 @@ def responsenew(data):
|
|
| 149 |
'sharedByMe': [],
|
| 150 |
},
|
| 151 |
}
|
| 152 |
-
elif "note down" in
|
| 153 |
# 1. Replace "note down" with an empty string:
|
| 154 |
replaced_string = text.replace("note down", "")
|
| 155 |
|
|
@@ -176,43 +176,43 @@ def responsenew(data):
|
|
| 176 |
'sharedByMe': [],
|
| 177 |
}
|
| 178 |
}
|
| 179 |
-
elif "add coins" in
|
| 180 |
respo = {
|
| 181 |
"message": "Click the button below to view Premium Services and Coin Recharge options: ",
|
| 182 |
"action": "payment",
|
| 183 |
"function": "nothing",
|
| 184 |
}
|
| 185 |
-
elif "show my friends" in
|
| 186 |
respo = {
|
| 187 |
"message": "Here's the list of your friends: ",
|
| 188 |
"action": "show_friends",
|
| 189 |
"function": "nothing",
|
| 190 |
}
|
| 191 |
-
elif "show my groups" in
|
| 192 |
respo = {
|
| 193 |
"message": "You are member of following groups: ",
|
| 194 |
"action": "show_mygroups",
|
| 195 |
"function": "nothing",
|
| 196 |
}
|
| 197 |
-
elif "show my communities" in
|
| 198 |
respo = {
|
| 199 |
"message": "You are part of following communities🫶: ",
|
| 200 |
"action": "show_mycommunities",
|
| 201 |
"function": "nothing",
|
| 202 |
}
|
| 203 |
-
elif "show shared reminders" in
|
| 204 |
respo = {
|
| 205 |
"message": "Here's the list of your shared reminders: ",
|
| 206 |
"action": "shared_reminders",
|
| 207 |
"function": "nothing",
|
| 208 |
}
|
| 209 |
-
elif "create a post" in
|
| 210 |
respo = {
|
| 211 |
"message": "Sure!",
|
| 212 |
"action": "create_post",
|
| 213 |
"function": "nothing",
|
| 214 |
}
|
| 215 |
-
elif "show my routines" in
|
| 216 |
respo = {
|
| 217 |
"message": "Here's the list of your routines: ",
|
| 218 |
"action": "myroutines",
|
|
@@ -224,13 +224,13 @@ def responsenew(data):
|
|
| 224 |
# "action": "nothing",
|
| 225 |
# "function": "nothing",
|
| 226 |
# }
|
| 227 |
-
elif "notify" in
|
| 228 |
respo = {
|
| 229 |
"message": "Select your friends to notify",
|
| 230 |
"action": "send_notify",
|
| 231 |
"function": "nothing",
|
| 232 |
}
|
| 233 |
-
elif "show actions" in
|
| 234 |
respo = {
|
| 235 |
"message": "Here is list of actions you can use:",
|
| 236 |
"action": "show_actions",
|
|
|
|
| 66 |
# print("Invalid JSON:", e)
|
| 67 |
response = model.generate_content(query)
|
| 68 |
print(f"\n{response.text}")
|
| 69 |
+
if query is not None:
|
| 70 |
+
if "remind me" in query:
|
| 71 |
+
values = getValues(query)
|
| 72 |
if values[0] is not None:
|
| 73 |
msg = values[0]
|
| 74 |
else:
|
|
|
|
| 122 |
}
|
| 123 |
}
|
| 124 |
|
| 125 |
+
elif "add to do" in query:
|
| 126 |
replaced_string = text.replace("add todo", "").replace("add to do","")
|
| 127 |
# 1. Replace "note down" with an empty string:
|
| 128 |
replaced_string = text.replace("note down", "")
|
|
|
|
| 149 |
'sharedByMe': [],
|
| 150 |
},
|
| 151 |
}
|
| 152 |
+
elif "note down" in query:
|
| 153 |
# 1. Replace "note down" with an empty string:
|
| 154 |
replaced_string = text.replace("note down", "")
|
| 155 |
|
|
|
|
| 176 |
'sharedByMe': [],
|
| 177 |
}
|
| 178 |
}
|
| 179 |
+
elif "add coins" in query:
|
| 180 |
respo = {
|
| 181 |
"message": "Click the button below to view Premium Services and Coin Recharge options: ",
|
| 182 |
"action": "payment",
|
| 183 |
"function": "nothing",
|
| 184 |
}
|
| 185 |
+
elif "show my friends" in query:
|
| 186 |
respo = {
|
| 187 |
"message": "Here's the list of your friends: ",
|
| 188 |
"action": "show_friends",
|
| 189 |
"function": "nothing",
|
| 190 |
}
|
| 191 |
+
elif "show my groups" in query:
|
| 192 |
respo = {
|
| 193 |
"message": "You are member of following groups: ",
|
| 194 |
"action": "show_mygroups",
|
| 195 |
"function": "nothing",
|
| 196 |
}
|
| 197 |
+
elif "show my communities" in query:
|
| 198 |
respo = {
|
| 199 |
"message": "You are part of following communities🫶: ",
|
| 200 |
"action": "show_mycommunities",
|
| 201 |
"function": "nothing",
|
| 202 |
}
|
| 203 |
+
elif "show shared reminders" in query:
|
| 204 |
respo = {
|
| 205 |
"message": "Here's the list of your shared reminders: ",
|
| 206 |
"action": "shared_reminders",
|
| 207 |
"function": "nothing",
|
| 208 |
}
|
| 209 |
+
elif "create a post" in query:
|
| 210 |
respo = {
|
| 211 |
"message": "Sure!",
|
| 212 |
"action": "create_post",
|
| 213 |
"function": "nothing",
|
| 214 |
}
|
| 215 |
+
elif "show my routines" in query:
|
| 216 |
respo = {
|
| 217 |
"message": "Here's the list of your routines: ",
|
| 218 |
"action": "myroutines",
|
|
|
|
| 224 |
# "action": "nothing",
|
| 225 |
# "function": "nothing",
|
| 226 |
# }
|
| 227 |
+
elif "notify" in query:
|
| 228 |
respo = {
|
| 229 |
"message": "Select your friends to notify",
|
| 230 |
"action": "send_notify",
|
| 231 |
"function": "nothing",
|
| 232 |
}
|
| 233 |
+
elif "show actions" in query:
|
| 234 |
respo = {
|
| 235 |
"message": "Here is list of actions you can use:",
|
| 236 |
"action": "show_actions",
|