@xuda.io/ai_module 1.1.5394 → 1.1.5396

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 +13 -15
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4320,25 +4320,23 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4320
4320
  return is_agent ? identity : triage_assistant + identity;
4321
4321
  };
4322
4322
  const get_agents = async function () {
4323
- if (typeof local_ai_agents === 'undefined') {
4324
- // no agents
4325
- local_ai_agents = [];
4326
- } else if (!local_ai_agents.length) {
4327
- // auto agent mode
4328
- const ai_agents_ret = await get_user_ai_agents(uid);
4329
- for (const doc of ai_agents_ret.docs) {
4330
- local_ai_agents.push(doc._id);
4323
+ if (reference_type === 'ai_agents') {
4324
+ local_ai_agents.push(reference_id);
4325
+ } else {
4326
+ if (typeof local_ai_agents === 'undefined') {
4327
+ // no agents
4328
+ local_ai_agents = [];
4329
+ } else if (!local_ai_agents.length) {
4330
+ // auto agent mode
4331
+ const ai_agents_ret = await get_user_ai_agents(uid);
4332
+ for (const doc of ai_agents_ret.docs) {
4333
+ local_ai_agents.push(doc._id);
4334
+ }
4331
4335
  }
4332
4336
  }
4333
-
4334
4337
  const list = [];
4335
4338
 
4336
4339
  let modelSettings = {};
4337
-
4338
- if (reference_type === 'ai_agents') {
4339
- local_ai_agents.push(reference_id);
4340
- }
4341
-
4342
4340
  let eligible_agent = true;
4343
4341
 
4344
4342
  for (const agent_id of local_ai_agents) {
@@ -4783,7 +4781,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4783
4781
  resolve(ret);
4784
4782
  });
4785
4783
  };
4786
- debugger;
4784
+
4787
4785
  // try {
4788
4786
  const runner = new Runner();
4789
4787
  let _agent = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5394",
3
+ "version": "1.1.5396",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",