@xuda.io/ai_module 1.1.4461 → 1.1.4463
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 +6 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3157,7 +3157,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
|
|
|
3157
3157
|
agent_doc.studio_meta.account_profiles[account_profile_obj._id];
|
|
3158
3158
|
|
|
3159
3159
|
// const data = await db.insert(agent_doc);
|
|
3160
|
-
|
|
3160
|
+
debugger;
|
|
3161
3161
|
const data = await db_module.save_app_couch_doc_native(account_profile_info.app_id, agent_doc);
|
|
3162
3162
|
setTimeout(async () => {
|
|
3163
3163
|
await update_ai_agent_properties(agent_doc, account_profile_info.app_id, uid);
|
|
@@ -4363,7 +4363,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4363
4363
|
|
|
4364
4364
|
const sender_app_id = account_profile_info.app_id;
|
|
4365
4365
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4366
|
-
|
|
4366
|
+
|
|
4367
4367
|
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|
|
4368
4368
|
|
|
4369
4369
|
const item = await client.conversations.items.create(conversation_id, {
|
|
@@ -4381,9 +4381,9 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4381
4381
|
sender_conversation_doc.messages.push(obj);
|
|
4382
4382
|
await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
|
|
4383
4383
|
|
|
4384
|
-
await db_module.save_app_couch_doc_native(sender_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, body });
|
|
4384
|
+
const save_ret = await db_module.save_app_couch_doc_native(sender_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, body });
|
|
4385
4385
|
|
|
4386
|
-
return
|
|
4386
|
+
return save_ret;
|
|
4387
4387
|
} catch (err) {
|
|
4388
4388
|
return { code: -15, data: err.message };
|
|
4389
4389
|
}
|
|
@@ -6305,6 +6305,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6305
6305
|
},
|
|
6306
6306
|
],
|
|
6307
6307
|
metadata: { conversation_id, func: 'attachment_handler' },
|
|
6308
|
+
account_profile_info,
|
|
6308
6309
|
});
|
|
6309
6310
|
if (ret.code < 0) {
|
|
6310
6311
|
throw new Error('something went wrong try again later');
|
|
@@ -6389,7 +6390,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6389
6390
|
const obj = { id: items.last_id, ts: Date.now(), conversation_type: 'attachment', file };
|
|
6390
6391
|
system_message_items.push(obj);
|
|
6391
6392
|
|
|
6392
|
-
await db_module.save_app_couch_doc_native(
|
|
6393
|
+
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 });
|
|
6393
6394
|
}
|
|
6394
6395
|
|
|
6395
6396
|
// const items = await client.conversations.items.create(conversation_id, {
|