Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import json
|
|
5 |
from getvalues import getValues
|
6 |
from datetime import datetime
|
7 |
import uuid
|
|
|
8 |
|
9 |
# Set your API key
|
10 |
palm.configure(api_key=os.environ["PALM_KEY"])
|
@@ -52,7 +53,7 @@ def responsenew(data):
|
|
52 |
response = palm.chat( messages=data)
|
53 |
print(response)
|
54 |
if data is not None:
|
55 |
-
if "remind me
|
56 |
|
57 |
values = getValues(data)
|
58 |
if values[0] is not None:
|
@@ -108,7 +109,7 @@ def responsenew(data):
|
|
108 |
}
|
109 |
}
|
110 |
|
111 |
-
if "add todo
|
112 |
respo = {
|
113 |
'messages': "Todo added!",
|
114 |
'action': "create_todo",
|
|
|
5 |
from getvalues import getValues
|
6 |
from datetime import datetime
|
7 |
import uuid
|
8 |
+
import re
|
9 |
|
10 |
# Set your API key
|
11 |
palm.configure(api_key=os.environ["PALM_KEY"])
|
|
|
53 |
response = palm.chat( messages=data)
|
54 |
print(response)
|
55 |
if data is not None:
|
56 |
+
if re.search(r"(remind me|remind me to)", data):
|
57 |
|
58 |
values = getValues(data)
|
59 |
if values[0] is not None:
|
|
|
109 |
}
|
110 |
}
|
111 |
|
112 |
+
if re.search(r"(add todo|add to do)", data):
|
113 |
respo = {
|
114 |
'messages': "Todo added!",
|
115 |
'action': "create_todo",
|