CosmoAI commited on
Commit
f35b6a6
·
1 Parent(s): 9bce928

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -56,11 +56,11 @@ def responsenew(data):
56
  print(text)
57
  except json.JSONDecodeError as e:
58
  print("Invalid JSON:", e)
59
- response = palm.chat( messages=data)
60
  print(f"\n{response.last}")
61
  if data is not None:
62
- if re.search(r"(Remind me|Remind me to)", data):
63
- values = getValues(data)
64
  if values[0] is not None:
65
  msg = values[0]
66
  else:
@@ -114,7 +114,7 @@ def responsenew(data):
114
  }
115
  }
116
 
117
- elif re.search(r"(Add todo|Add to do)", data):
118
  respo = {
119
  'messages': "Todo added!",
120
  'action': "create_todo",
@@ -129,7 +129,7 @@ def responsenew(data):
129
  'sharedByMe': [],
130
  },
131
  }
132
- elif "Note down" in data:
133
  respo = {
134
  'messages': "Got it!",
135
  'action': "create_note",
@@ -145,37 +145,37 @@ def responsenew(data):
145
  'sharedByMe': [],
146
  }
147
  }
148
- elif "add coins" in data:
149
  respo = {
150
  "message": "Click the button below to view Premium Services and Coin Recharge options: ",
151
  "action": "payment",
152
  "function": "nothing",
153
  }
154
- elif "show my friends" in data:
155
  respo = {
156
  "message": "Here's the list of your friends: ",
157
  "action": "show_friends",
158
  "function": "nothing",
159
  }
160
- elif "show my groups" in data:
161
  respo = {
162
  "message": "You are member of following groups: ",
163
  "action": "show_mygroups",
164
  "function": "nothing",
165
  }
166
- elif "show my communities" in data:
167
  respo = {
168
  "message": "You are part of following communities🫶: ",
169
  "action": "show_mycommunities",
170
  "function": "nothing",
171
  }
172
- elif " show shared reminders" in data:
173
  respo = {
174
  "message": "Here's the list of your shared reminders: ",
175
  "action": "shared_reminders",
176
  "function": "nothing",
177
  }
178
- elif "show my routines" in data:
179
  respo = {
180
  "message": "Here's the list of your routines: ",
181
  "action": "myroutines",
@@ -187,13 +187,13 @@ def responsenew(data):
187
  # "action": "nothing",
188
  # "function": "nothing",
189
  # }
190
- elif "notify" in data:
191
  respo = {
192
  "message": "Select your friends to notify",
193
  "action": "send_notify",
194
  "function": "nothing",
195
  }
196
- elif "show actions" in data:
197
  respo = {
198
  "message": "Here is list of actions you can use:",
199
  "action": "show_actions",
 
56
  print(text)
57
  except json.JSONDecodeError as e:
58
  print("Invalid JSON:", e)
59
+ response = palm.chat( messages=text)
60
  print(f"\n{response.last}")
61
  if data is not None:
62
+ if "Remind me" in text):
63
+ values = getValues(text)
64
  if values[0] is not None:
65
  msg = values[0]
66
  else:
 
114
  }
115
  }
116
 
117
+ elif "Add to do" in text):
118
  respo = {
119
  'messages': "Todo added!",
120
  'action': "create_todo",
 
129
  'sharedByMe': [],
130
  },
131
  }
132
+ elif "Note down" in text:
133
  respo = {
134
  'messages': "Got it!",
135
  'action': "create_note",
 
145
  'sharedByMe': [],
146
  }
147
  }
148
+ elif "add coins" in text:
149
  respo = {
150
  "message": "Click the button below to view Premium Services and Coin Recharge options: ",
151
  "action": "payment",
152
  "function": "nothing",
153
  }
154
+ elif "show my friends" in text:
155
  respo = {
156
  "message": "Here's the list of your friends: ",
157
  "action": "show_friends",
158
  "function": "nothing",
159
  }
160
+ elif "show my groups" in text:
161
  respo = {
162
  "message": "You are member of following groups: ",
163
  "action": "show_mygroups",
164
  "function": "nothing",
165
  }
166
+ elif "show my communities" in text:
167
  respo = {
168
  "message": "You are part of following communities🫶: ",
169
  "action": "show_mycommunities",
170
  "function": "nothing",
171
  }
172
+ elif " show shared reminders" in text:
173
  respo = {
174
  "message": "Here's the list of your shared reminders: ",
175
  "action": "shared_reminders",
176
  "function": "nothing",
177
  }
178
+ elif "show my routines" in text:
179
  respo = {
180
  "message": "Here's the list of your routines: ",
181
  "action": "myroutines",
 
187
  # "action": "nothing",
188
  # "function": "nothing",
189
  # }
190
+ elif "notify" in text:
191
  respo = {
192
  "message": "Select your friends to notify",
193
  "action": "send_notify",
194
  "function": "nothing",
195
  }
196
+ elif "show actions" in text:
197
  respo = {
198
  "message": "Here is list of actions you can use:",
199
  "action": "show_actions",