Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,62 +107,62 @@ def responsenew(data):
|
|
| 107 |
""",
|
| 108 |
)
|
| 109 |
print(intent)
|
| 110 |
-
respo = {"message": intent.last, "action": "nothing", "function": "nothing"}
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
return json.dumps(respo)
|
| 167 |
|
| 168 |
|
|
|
|
| 107 |
""",
|
| 108 |
)
|
| 109 |
print(intent)
|
| 110 |
+
# respo = {"message": intent.last, "action": "nothing", "function": "nothing"}
|
| 111 |
+
if intent.last is not None:
|
| 112 |
+
if "purchase_coins" in intent.last:
|
| 113 |
+
respo = {
|
| 114 |
+
"message": "Click the button below to view Premium Services and Coin Recharge options: ",
|
| 115 |
+
"action": "payment",
|
| 116 |
+
"function": "nothing",
|
| 117 |
+
}
|
| 118 |
+
elif "view_friends" in intent.last:
|
| 119 |
+
respo = {
|
| 120 |
+
"message": "Here's the list of your friends: ",
|
| 121 |
+
"action": "show_friends",
|
| 122 |
+
"function": "nothing",
|
| 123 |
+
}
|
| 124 |
+
elif "view_groups" in intent.last:
|
| 125 |
+
respo = {
|
| 126 |
+
"message": "You are member of following groups: ",
|
| 127 |
+
"action": "show_mygroups",
|
| 128 |
+
"function": "nothing",
|
| 129 |
+
}
|
| 130 |
+
elif "view_communities" in intent.last:
|
| 131 |
+
respo = {
|
| 132 |
+
"message": "You are part of following communities🫶: ",
|
| 133 |
+
"action": "show_mycommunities",
|
| 134 |
+
"function": "nothing",
|
| 135 |
+
}
|
| 136 |
+
elif "shared_reminders" in intent.last:
|
| 137 |
+
respo = {
|
| 138 |
+
"message": "Here's the list of your shared reminders: ",
|
| 139 |
+
"action": "shared_reminders",
|
| 140 |
+
"function": "nothing",
|
| 141 |
+
}
|
| 142 |
+
elif "my_routines" in intent.last:
|
| 143 |
+
respo = {
|
| 144 |
+
"message": "Here's the list of your routines: ",
|
| 145 |
+
"action": "myroutines",
|
| 146 |
+
"function": "nothing",
|
| 147 |
+
}
|
| 148 |
+
# elif "cosmo_name" in intent.last:
|
| 149 |
+
# respo = {
|
| 150 |
+
# "message": "My name is Cosmo. I am your friendly personal assistant.",
|
| 151 |
+
# "action": "nothing",
|
| 152 |
+
# "function": "nothing",
|
| 153 |
+
# }
|
| 154 |
+
# else:
|
| 155 |
+
respo = {
|
| 156 |
+
"message": response.last,
|
| 157 |
+
"action": "nothing",
|
| 158 |
+
"function": "nothing",
|
| 159 |
+
}
|
| 160 |
+
else:
|
| 161 |
+
respo = {
|
| 162 |
+
"message": "Unable to understand.",
|
| 163 |
+
"action": "nothing",
|
| 164 |
+
"function": "nothing",
|
| 165 |
+
}
|
| 166 |
return json.dumps(respo)
|
| 167 |
|
| 168 |
|