@xuda.io/ai_module 1.1.4588 → 1.1.4590
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 +20 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4525,8 +4525,8 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4525
4525
|
};
|
|
4526
4526
|
|
|
4527
4527
|
const ai_chat_conversation = async function (req, job_id, headers) {
|
|
4528
|
-
const { uid, gtp_token } = req;
|
|
4529
|
-
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4528
|
+
const { uid, gtp_token, profile_id } = req;
|
|
4529
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid, profile_id);
|
|
4530
4530
|
let { prompt, conversation_doc, attachments = [], ai_agents, output_format = 'md', stream = true, with_context = true } = req;
|
|
4531
4531
|
await _utils.delay(1000);
|
|
4532
4532
|
const conversation_id = conversation_doc._id;
|
|
@@ -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,23 @@ 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
|
+
};
|
|
6484
|
+
await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj);
|
|
6468
6485
|
}
|
|
6469
6486
|
|
|
6470
6487
|
// const items = await client.conversations.items.create(conversation_id, {
|