@xuda.io/ai_module 1.1.4834 → 1.1.4836
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
|
@@ -3701,15 +3701,22 @@ const contact_chat_conversation = async function (req, job_id, headers) {
|
|
|
3701
3701
|
const sender_app_id = account_profile_info.app_id;
|
|
3702
3702
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
3703
3703
|
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3704
|
+
let item;
|
|
3705
|
+
try {
|
|
3706
|
+
item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
|
|
3707
|
+
items: [
|
|
3708
|
+
{
|
|
3709
|
+
type: 'message',
|
|
3710
|
+
role: 'user',
|
|
3711
|
+
content: [{ type: 'input_text', text: prompt }],
|
|
3712
|
+
},
|
|
3713
|
+
],
|
|
3714
|
+
});
|
|
3715
|
+
report_ai_status('conversations');
|
|
3716
|
+
} catch (err) {
|
|
3717
|
+
report_ai_status('conversations', err);
|
|
3718
|
+
throw err;
|
|
3719
|
+
}
|
|
3713
3720
|
|
|
3714
3721
|
// const obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'chat' };
|
|
3715
3722
|
// receiver_conversation_doc.messages.push(obj);
|