@xuda.io/ai_module 1.1.4589 → 1.1.4591
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 +19 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6451,7 +6451,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6451
6451
|
|
|
6452
6452
|
// prompt += await generate_XU_markdown('attachment', file); //`[]`;
|
|
6453
6453
|
|
|
6454
|
-
const items = await client.conversations.items.create(
|
|
6454
|
+
const items = await client.conversations.items.create(conversation_doc.reference_id, {
|
|
6455
6455
|
items: [
|
|
6456
6456
|
{
|
|
6457
6457
|
type: 'message',
|
|
@@ -6465,6 +6465,24 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6465
6465
|
system_message_items.push(obj);
|
|
6466
6466
|
|
|
6467
6467
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, file, transcript, reference_id: conversation_doc.reference_id });
|
|
6468
|
+
///////////////
|
|
6469
|
+
let out_conversation_item_obj = {
|
|
6470
|
+
_id: await _common.xuda_get_uuid('chat_conversation_item'),
|
|
6471
|
+
stat: 3,
|
|
6472
|
+
docType: 'chat_conversation_item',
|
|
6473
|
+
uid,
|
|
6474
|
+
conversation_type: 'attachment',
|
|
6475
|
+
type: 'attachment',
|
|
6476
|
+
date_created_ts: Date.now(),
|
|
6477
|
+
ts: Date.now(),
|
|
6478
|
+
conversation_id,
|
|
6479
|
+
text: transcript.data || transcript,
|
|
6480
|
+
reference_id: conversation_doc.reference_id,
|
|
6481
|
+
direction: 'out',
|
|
6482
|
+
role: 'user',
|
|
6483
|
+
conversation_item_reference_id: items.last_id,
|
|
6484
|
+
};
|
|
6485
|
+
await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj);
|
|
6468
6486
|
}
|
|
6469
6487
|
|
|
6470
6488
|
// const items = await client.conversations.items.create(conversation_id, {
|