@xuda.io/ai_module 1.1.4172 → 1.1.4174

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.
Files changed (2) hide show
  1. package/index.mjs +4 -2
  2. 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,10 +2579,10 @@ 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 project_db.get(agent_id);
2582
+ let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
2581
2583
  agent_doc.stat = 4;
2582
2584
  agent_doc.ts = Date.now();
2583
- const save_ret = await project_db.insert(agent_doc);
2585
+ const save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, agent_doc);
2584
2586
 
2585
2587
  for (const [key, val] of Object.entries(agent_doc?.agentConfig?.agent_tools || [])) {
2586
2588
  const file_id = val?.youtube?.file_id || val?.file?.file_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4172",
3
+ "version": "1.1.4174",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",