@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.
- package/index.mjs +13 -15
- 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 (
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
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
|
-
|
|
4784
|
+
|
|
4787
4785
|
// try {
|
|
4788
4786
|
const runner = new Runner();
|
|
4789
4787
|
let _agent = [];
|