Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,11 +12,18 @@ palm.configure(api_key=os.environ['PALM_KEY'])
|
|
| 12 |
|
| 13 |
def responsenew(data):
|
| 14 |
response = palm.chat(messages=data)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
print(data)
|
| 21 |
return json.dumps(respo)
|
| 22 |
|
|
|
|
| 12 |
|
| 13 |
def responsenew(data):
|
| 14 |
response = palm.chat(messages=data)
|
| 15 |
+
if response.last contains "payment":
|
| 16 |
+
respo = {
|
| 17 |
+
"message": response.last,
|
| 18 |
+
"action": "payment",
|
| 19 |
+
"function": "nothing"
|
| 20 |
+
}
|
| 21 |
+
elif response.last contains "show friends":
|
| 22 |
+
respo = {
|
| 23 |
+
"message": response.last,
|
| 24 |
+
"action": "show_friends",
|
| 25 |
+
"function": "nothing"
|
| 26 |
+
}
|
| 27 |
print(data)
|
| 28 |
return json.dumps(respo)
|
| 29 |
|