@xuda.io/ai_module 1.1.4171 → 1.1.4173
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 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2562,6 +2562,8 @@ export const get_ai_agents = async function (req, job_id, headers) {
|
|
|
2562
2562
|
export const delete_ai_agent = async function (req) {
|
|
2563
2563
|
let { agent_id, uid, app_id } = req;
|
|
2564
2564
|
|
|
2565
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
2566
|
+
|
|
2565
2567
|
const project_db = await get_account_project_db(uid);
|
|
2566
2568
|
|
|
2567
2569
|
try {
|
|
@@ -2577,7 +2579,7 @@ export const delete_ai_agent = async function (req) {
|
|
|
2577
2579
|
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2578
2580
|
save_ret = await team_module.remove_team_member({ team_req_id: prog_doc.studio_meta.team_req_id });
|
|
2579
2581
|
} else {
|
|
2580
|
-
let agent_doc = await
|
|
2582
|
+
let agent_doc = await db_module.get_app_couch_doc(account_profile_info.app_id, agent_id);
|
|
2581
2583
|
agent_doc.stat = 4;
|
|
2582
2584
|
agent_doc.ts = Date.now();
|
|
2583
2585
|
const save_ret = await project_db.insert(agent_doc);
|
|
@@ -4422,7 +4424,7 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
4422
4424
|
const sender_app_id = conversation_doc.account_profile_info.app_id; //await account_module.get_account_default_project_id(uid);
|
|
4423
4425
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4424
4426
|
|
|
4425
|
-
await attachment_handler(uid, sender_app_id, conversation_id, attachments);
|
|
4427
|
+
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|
|
4426
4428
|
|
|
4427
4429
|
const item = await client.conversations.items.create(conversation_id, {
|
|
4428
4430
|
items: [
|
|
@@ -5016,7 +5018,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
5016
5018
|
/////////////
|
|
5017
5019
|
if (attachments?.length) {
|
|
5018
5020
|
await update_job('analyzing attachments');
|
|
5019
|
-
await attachment_handler(uid, app_id, conversation_id, attachments);
|
|
5021
|
+
await attachment_handler(uid, app_id, conversation_id, attachments, account_profile_info);
|
|
5020
5022
|
}
|
|
5021
5023
|
////////////
|
|
5022
5024
|
|
|
@@ -6402,7 +6404,7 @@ export const unpin_ai_agent = async function (req, job_id, headers) {
|
|
|
6402
6404
|
}
|
|
6403
6405
|
};
|
|
6404
6406
|
|
|
6405
|
-
const attachment_handler = async function (uid, app_id, conversation_id, attachments) {
|
|
6407
|
+
const attachment_handler = async function (uid, app_id, conversation_id, attachments, account_profile_info) {
|
|
6406
6408
|
if (!attachments?.length) return;
|
|
6407
6409
|
|
|
6408
6410
|
const get_transcript = async function (filename) {
|