@xuda.io/ai_module 1.1.4837 → 1.1.4838
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/index.mjs +16 -9
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3887,15 +3887,22 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
3887
3887
|
if (perform_ai_execution) {
|
|
3888
3888
|
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|
|
3889
3889
|
}
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3890
|
+
let item;
|
|
3891
|
+
try {
|
|
3892
|
+
item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
|
|
3893
|
+
items: [
|
|
3894
|
+
{
|
|
3895
|
+
type: 'message',
|
|
3896
|
+
role: 'user',
|
|
3897
|
+
content: [{ type: 'input_text', text: body || '' }],
|
|
3898
|
+
},
|
|
3899
|
+
],
|
|
3900
|
+
});
|
|
3901
|
+
report_ai_status('conversations');
|
|
3902
|
+
} catch (err) {
|
|
3903
|
+
report_ai_status('conversations', err);
|
|
3904
|
+
throw err;
|
|
3905
|
+
}
|
|
3899
3906
|
|
|
3900
3907
|
// let obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'email' };
|
|
3901
3908
|
|