@bty/customer-service-cli 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +4 -4
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1397,7 +1397,7 @@ async function sendAgentMessage(opts) {
|
|
|
1397
1397
|
email: `${opts.conversationId}@gmail.com`
|
|
1398
1398
|
};
|
|
1399
1399
|
if (opts.imageUrl) {
|
|
1400
|
-
content.
|
|
1400
|
+
content.image = opts.imageUrl;
|
|
1401
1401
|
}
|
|
1402
1402
|
msgList = [
|
|
1403
1403
|
{
|
|
@@ -1463,21 +1463,21 @@ function recordsToMsgList(records) {
|
|
|
1463
1463
|
return records.map((r, i) => {
|
|
1464
1464
|
const context = r.context ?? {};
|
|
1465
1465
|
const text = context.text ?? "";
|
|
1466
|
-
const imageUrl = context.image_url;
|
|
1466
|
+
const imageUrl = context.image_url ?? context.image;
|
|
1467
1467
|
const content = {
|
|
1468
1468
|
text,
|
|
1469
1469
|
input: text,
|
|
1470
1470
|
email: `${r.conversation_id}@gmail.com`
|
|
1471
1471
|
};
|
|
1472
1472
|
if (imageUrl) {
|
|
1473
|
-
content.
|
|
1473
|
+
content.image = imageUrl;
|
|
1474
1474
|
}
|
|
1475
1475
|
const timestamp = originalTimestamps[i] + offset;
|
|
1476
1476
|
return {
|
|
1477
1477
|
match_id: r.record_id ?? `match_${timestamp}_${Math.floor(Math.random() * 100)}`,
|
|
1478
1478
|
content,
|
|
1479
1479
|
timestamp,
|
|
1480
|
-
type: "TEXT",
|
|
1480
|
+
type: r.context_type || "TEXT",
|
|
1481
1481
|
role: r.role
|
|
1482
1482
|
};
|
|
1483
1483
|
});
|