@xuda.io/ai_module 1.1.3781 → 1.1.3783
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 +18 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4742,10 +4742,9 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4742
4742
|
if (val.ai_agent_id) {
|
|
4743
4743
|
opt.selector._id = val.ai_agent_id;
|
|
4744
4744
|
}
|
|
4745
|
-
const agent_ret = await get_ai_agents(opt);
|
|
4746
|
-
if (agent_ret.code > -1) {
|
|
4747
|
-
const agent_doc = agent_ret.data;
|
|
4748
4745
|
|
|
4746
|
+
const user_agents = await db_module.find_app_couch_query(ai_agent_doc?.studio_meta?.shared_from_app_id || ai_agent_doc?.studio_meta?.installed_from_app_id || app_id, opt);
|
|
4747
|
+
for (const agent_doc of user_agents.docs) {
|
|
4749
4748
|
const agent = new Agent({
|
|
4750
4749
|
name: agent_doc.agent_name,
|
|
4751
4750
|
instructions: agent_doc.agent_instructions,
|
|
@@ -4758,6 +4757,22 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4758
4757
|
}),
|
|
4759
4758
|
);
|
|
4760
4759
|
}
|
|
4760
|
+
// const agent_ret = await get_ai_agents(opt);
|
|
4761
|
+
// if (agent_ret.code > -1) {
|
|
4762
|
+
// const agent_doc = agent_ret.data;
|
|
4763
|
+
|
|
4764
|
+
// const agent = new Agent({
|
|
4765
|
+
// name: agent_doc.agent_name,
|
|
4766
|
+
// instructions: agent_doc.agent_instructions,
|
|
4767
|
+
// });
|
|
4768
|
+
|
|
4769
|
+
// tools.push(
|
|
4770
|
+
// agent.asTool({
|
|
4771
|
+
// toolName: agent_doc.agent_name,
|
|
4772
|
+
// toolDescription: agent_doc.agent_instructions,
|
|
4773
|
+
// }),
|
|
4774
|
+
// );
|
|
4775
|
+
// }
|
|
4761
4776
|
// }
|
|
4762
4777
|
break;
|
|
4763
4778
|
}
|