@xuda.io/ai_module 1.1.5169 → 1.1.5171
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 +23 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4345,6 +4345,10 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4345
4345
|
}
|
|
4346
4346
|
|
|
4347
4347
|
case 'cpi': {
|
|
4348
|
+
if (reference_type !== 'ai_agents') {
|
|
4349
|
+
eligible_agent = false;
|
|
4350
|
+
break;
|
|
4351
|
+
}
|
|
4348
4352
|
continue;
|
|
4349
4353
|
try {
|
|
4350
4354
|
debugger;
|
|
@@ -4443,6 +4447,10 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4443
4447
|
}
|
|
4444
4448
|
|
|
4445
4449
|
case 'image_generate': {
|
|
4450
|
+
if (reference_type !== 'ai_agents') {
|
|
4451
|
+
eligible_agent = false;
|
|
4452
|
+
break;
|
|
4453
|
+
}
|
|
4446
4454
|
tools.push(
|
|
4447
4455
|
tool({
|
|
4448
4456
|
name: name.substring(0, 60),
|
|
@@ -4539,6 +4547,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4539
4547
|
}
|
|
4540
4548
|
|
|
4541
4549
|
case 'ai_agent': {
|
|
4550
|
+
if (reference_type !== 'ai_agents') {
|
|
4551
|
+
eligible_agent = false;
|
|
4552
|
+
break;
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4542
4555
|
let opt = {
|
|
4543
4556
|
selector: {
|
|
4544
4557
|
docType: 'studio',
|
|
@@ -4588,6 +4601,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4588
4601
|
break;
|
|
4589
4602
|
}
|
|
4590
4603
|
case 'plugin': {
|
|
4604
|
+
if (reference_type !== 'ai_agents') {
|
|
4605
|
+
eligible_agent = false;
|
|
4606
|
+
break;
|
|
4607
|
+
}
|
|
4608
|
+
|
|
4591
4609
|
if (!val.plugin_id) {
|
|
4592
4610
|
throw new Error('undefined plugin_id');
|
|
4593
4611
|
}
|
|
@@ -4627,9 +4645,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4627
4645
|
tool_resources,
|
|
4628
4646
|
modelSettings,
|
|
4629
4647
|
});
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4648
|
+
if (eligible_agent) {
|
|
4649
|
+
// allow read only agents if not ai_agent scope
|
|
4650
|
+
init_agent_hooks(agent);
|
|
4651
|
+
list.push(agent);
|
|
4652
|
+
}
|
|
4633
4653
|
} catch (err) {
|
|
4634
4654
|
console.error(err.message);
|
|
4635
4655
|
}
|