Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,13 +53,14 @@ def responsenew(data):
|
|
| 53 |
try:
|
| 54 |
items = json.loads(newdata)
|
| 55 |
text = items['text']
|
|
|
|
| 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 "
|
| 63 |
values = getValues(text)
|
| 64 |
msg = values[0]
|
| 65 |
if values[1] is not None:
|
|
@@ -111,7 +112,7 @@ def responsenew(data):
|
|
| 111 |
}
|
| 112 |
}
|
| 113 |
|
| 114 |
-
elif "
|
| 115 |
respo = {
|
| 116 |
'messages': "Todo added!",
|
| 117 |
'action': "create_todo",
|
|
@@ -119,14 +120,14 @@ def responsenew(data):
|
|
| 119 |
'name': 'defaulttodo',
|
| 120 |
'id': idval,
|
| 121 |
'subTasks': [{
|
| 122 |
-
'task':
|
| 123 |
'done': False
|
| 124 |
}],
|
| 125 |
'shared': [],
|
| 126 |
'sharedByMe': [],
|
| 127 |
},
|
| 128 |
}
|
| 129 |
-
elif "
|
| 130 |
respo = {
|
| 131 |
'messages': "Got it!",
|
| 132 |
'action': "create_note",
|
|
@@ -134,7 +135,7 @@ def responsenew(data):
|
|
| 134 |
'title': 'defaultnote',
|
| 135 |
'id': idval,
|
| 136 |
'type': 'Note',
|
| 137 |
-
'description':
|
| 138 |
'time': datetime.now().strftime("%d/%m/%Y"),
|
| 139 |
'mainTime': datetime.now().strftime("%I:%M %p"),
|
| 140 |
'complete': False,
|
|
@@ -166,7 +167,7 @@ def responsenew(data):
|
|
| 166 |
"action": "show_mycommunities",
|
| 167 |
"function": "nothing",
|
| 168 |
}
|
| 169 |
-
elif "
|
| 170 |
respo = {
|
| 171 |
"message": "Here's the list of your shared reminders: ",
|
| 172 |
"action": "shared_reminders",
|
|
|
|
| 53 |
try:
|
| 54 |
items = json.loads(newdata)
|
| 55 |
text = items['text']
|
| 56 |
+
text = text.lower()
|
| 57 |
print(text)
|
| 58 |
except json.JSONDecodeError as e:
|
| 59 |
print("Invalid JSON:", e)
|
| 60 |
response = palm.chat( messages=text)
|
| 61 |
print(f"\n{response.last}")
|
| 62 |
if data is not None:
|
| 63 |
+
if "remind me" in text:
|
| 64 |
values = getValues(text)
|
| 65 |
msg = values[0]
|
| 66 |
if values[1] is not None:
|
|
|
|
| 112 |
}
|
| 113 |
}
|
| 114 |
|
| 115 |
+
elif "add to do" in text:
|
| 116 |
respo = {
|
| 117 |
'messages': "Todo added!",
|
| 118 |
'action': "create_todo",
|
|
|
|
| 120 |
'name': 'defaulttodo',
|
| 121 |
'id': idval,
|
| 122 |
'subTasks': [{
|
| 123 |
+
'task':text.replace("add todo", "").replace("add to do",""),
|
| 124 |
'done': False
|
| 125 |
}],
|
| 126 |
'shared': [],
|
| 127 |
'sharedByMe': [],
|
| 128 |
},
|
| 129 |
}
|
| 130 |
+
elif "note down" in text:
|
| 131 |
respo = {
|
| 132 |
'messages': "Got it!",
|
| 133 |
'action': "create_note",
|
|
|
|
| 135 |
'title': 'defaultnote',
|
| 136 |
'id': idval,
|
| 137 |
'type': 'Note',
|
| 138 |
+
'description': text.replace("Note down",""),
|
| 139 |
'time': datetime.now().strftime("%d/%m/%Y"),
|
| 140 |
'mainTime': datetime.now().strftime("%I:%M %p"),
|
| 141 |
'complete': False,
|
|
|
|
| 167 |
"action": "show_mycommunities",
|
| 168 |
"function": "nothing",
|
| 169 |
}
|
| 170 |
+
elif "show shared reminders" in text:
|
| 171 |
respo = {
|
| 172 |
"message": "Here's the list of your shared reminders: ",
|
| 173 |
"action": "shared_reminders",
|