Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -46,23 +46,23 @@ client = openai.OpenAI(
|
|
46 |
base_url="https://api.sambanova.ai/v1",
|
47 |
)
|
48 |
|
49 |
-
def messenger_button(recipient_phone, ai_response):
|
50 |
messenger.send_button(
|
51 |
recipient_id=recipient_phone,
|
52 |
button={
|
53 |
-
"header": "
|
54 |
"body": f"{ai_response}",
|
55 |
-
"footer": "
|
56 |
"action": {
|
57 |
-
"button": "
|
58 |
"sections": [
|
59 |
{
|
60 |
"title": "iBank",
|
61 |
"rows": [
|
62 |
-
{"id": "
|
63 |
{
|
64 |
-
"id": "
|
65 |
-
"title": "
|
66 |
"description": "",
|
67 |
},
|
68 |
],
|
|
|
46 |
base_url="https://api.sambanova.ai/v1",
|
47 |
)
|
48 |
|
49 |
+
def messenger_button(recipient_phone, ai_response, header='Transaction Confirmation', footer='', btn_name='Confirm Details'):
|
50 |
messenger.send_button(
|
51 |
recipient_id=recipient_phone,
|
52 |
button={
|
53 |
+
"header": f"{header}",
|
54 |
"body": f"{ai_response}",
|
55 |
+
"footer": f"{footer}",
|
56 |
"action": {
|
57 |
+
"button": f"{btn_name}",
|
58 |
"sections": [
|
59 |
{
|
60 |
"title": "iBank",
|
61 |
"rows": [
|
62 |
+
{"id": "confirm", "title": "Record Transaction", "description": ""},
|
63 |
{
|
64 |
+
"id": "cancel",
|
65 |
+
"title": "Cancel Transaction",
|
66 |
"description": "",
|
67 |
},
|
68 |
],
|