Spaces:
Running
Running
this
Browse files
app.py
CHANGED
@@ -79,66 +79,66 @@ def responsenew(data):
|
|
79 |
* if intent = sharing a note return = "share_note"
|
80 |
""")
|
81 |
print(intent)
|
82 |
-
|
83 |
-
|
84 |
-
# "action": "nothing",
|
85 |
-
# "function": "nothing"
|
86 |
-
# }
|
87 |
-
if intent.last is not None:
|
88 |
-
if "purchase_coins" in intent.last:
|
89 |
-
respo = {
|
90 |
-
"message": "Click the button below to view Premium Services and Coin Recharge options: ",
|
91 |
-
"action": "payment",
|
92 |
-
"function": "nothing",
|
93 |
-
}
|
94 |
-
elif "view_friends" in intent.last:
|
95 |
-
respo = {
|
96 |
-
"message": "Here's the list of your friends: ",
|
97 |
-
"action": "show_friends",
|
98 |
-
"function": "nothing",
|
99 |
-
}
|
100 |
-
elif "view_groups" in intent.last:
|
101 |
-
respo = {
|
102 |
-
"message": "You are member of following groups: ",
|
103 |
-
"action": "show_mygroups",
|
104 |
-
"function": "nothing",
|
105 |
-
}
|
106 |
-
elif "view_communities" in intent.last:
|
107 |
-
respo = {
|
108 |
-
"message": "You are part of following communities🫶: ",
|
109 |
-
"action": "show_mycommunities",
|
110 |
-
"function": "nothing",
|
111 |
-
}
|
112 |
-
elif "shared_reminders" in intent.last:
|
113 |
-
respo = {
|
114 |
-
"message": "Here's the list of your shared reminders: ",
|
115 |
-
"action": "shared_reminders",
|
116 |
-
"function": "nothing",
|
117 |
-
}
|
118 |
-
elif "my_routines" in intent.last:
|
119 |
-
respo = {
|
120 |
-
"message": "Here's the list of your routines: ",
|
121 |
-
"action": "myroutines",
|
122 |
-
"function": "nothing",
|
123 |
-
}
|
124 |
-
elif "cosmo_name" in intent.last:
|
125 |
-
respo = {
|
126 |
-
"message": "My name is Cosmo. I am your friendly personal assistant.",
|
127 |
-
"action": "nothing",
|
128 |
-
"function": "nothing",
|
129 |
-
}
|
130 |
-
else:
|
131 |
-
respo = {
|
132 |
-
"message": response.last,
|
133 |
-
"action": "nothing",
|
134 |
-
"function": "nothing",
|
135 |
-
}
|
136 |
-
else:
|
137 |
-
respo = {
|
138 |
-
"message": "Unable to understand.",
|
139 |
"action": "nothing",
|
140 |
-
"function": "nothing"
|
141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
return json.dumps(respo)
|
143 |
|
144 |
|
|
|
79 |
* if intent = sharing a note return = "share_note"
|
80 |
""")
|
81 |
print(intent)
|
82 |
+
respo = {
|
83 |
+
"message": intent.last,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
"action": "nothing",
|
85 |
+
"function": "nothing"
|
86 |
}
|
87 |
+
# if intent.last is not None:
|
88 |
+
# if "purchase_coins" in intent.last:
|
89 |
+
# respo = {
|
90 |
+
# "message": "Click the button below to view Premium Services and Coin Recharge options: ",
|
91 |
+
# "action": "payment",
|
92 |
+
# "function": "nothing",
|
93 |
+
# }
|
94 |
+
# elif "view_friends" in intent.last:
|
95 |
+
# respo = {
|
96 |
+
# "message": "Here's the list of your friends: ",
|
97 |
+
# "action": "show_friends",
|
98 |
+
# "function": "nothing",
|
99 |
+
# }
|
100 |
+
# elif "view_groups" in intent.last:
|
101 |
+
# respo = {
|
102 |
+
# "message": "You are member of following groups: ",
|
103 |
+
# "action": "show_mygroups",
|
104 |
+
# "function": "nothing",
|
105 |
+
# }
|
106 |
+
# elif "view_communities" in intent.last:
|
107 |
+
# respo = {
|
108 |
+
# "message": "You are part of following communities🫶: ",
|
109 |
+
# "action": "show_mycommunities",
|
110 |
+
# "function": "nothing",
|
111 |
+
# }
|
112 |
+
# elif "shared_reminders" in intent.last:
|
113 |
+
# respo = {
|
114 |
+
# "message": "Here's the list of your shared reminders: ",
|
115 |
+
# "action": "shared_reminders",
|
116 |
+
# "function": "nothing",
|
117 |
+
# }
|
118 |
+
# elif "my_routines" in intent.last:
|
119 |
+
# respo = {
|
120 |
+
# "message": "Here's the list of your routines: ",
|
121 |
+
# "action": "myroutines",
|
122 |
+
# "function": "nothing",
|
123 |
+
# }
|
124 |
+
# elif "cosmo_name" in intent.last:
|
125 |
+
# respo = {
|
126 |
+
# "message": "My name is Cosmo. I am your friendly personal assistant.",
|
127 |
+
# "action": "nothing",
|
128 |
+
# "function": "nothing",
|
129 |
+
# }
|
130 |
+
# else:
|
131 |
+
# respo = {
|
132 |
+
# "message": response.last,
|
133 |
+
# "action": "nothing",
|
134 |
+
# "function": "nothing",
|
135 |
+
# }
|
136 |
+
# else:
|
137 |
+
# respo = {
|
138 |
+
# "message": "Unable to understand.",
|
139 |
+
# "action": "nothing",
|
140 |
+
# "function": "nothing",
|
141 |
+
# }
|
142 |
return json.dumps(respo)
|
143 |
|
144 |
|