@xuda.io/ai_module 1.1.5184 → 1.1.5186
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 +8 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4060,7 +4060,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4060
4060
|
const reference_id = conversation_doc.reference_id;
|
|
4061
4061
|
|
|
4062
4062
|
const activate_prompt_suggestions = _.isArray(ai_agents) && conversation_doc.reference_type !== 'ai_agents' && !conversation_item_id;
|
|
4063
|
-
|
|
4063
|
+
let prompt_suggestion_activated;
|
|
4064
4064
|
let model = ai_model;
|
|
4065
4065
|
if (!_conf.ai_models[model]) {
|
|
4066
4066
|
throw new Error('model not supported');
|
|
@@ -4179,6 +4179,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4179
4179
|
conversation_doc.stat = 2;
|
|
4180
4180
|
conversation_doc.ts = Date.now();
|
|
4181
4181
|
conversation_doc.ai_agents = ai_agents;
|
|
4182
|
+
conversation_doc.job_id = job_id;
|
|
4182
4183
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
|
|
4183
4184
|
|
|
4184
4185
|
await update_job('analyzing request');
|
|
@@ -4331,7 +4332,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4331
4332
|
}
|
|
4332
4333
|
|
|
4333
4334
|
case 'mcp': {
|
|
4334
|
-
if (reference_type !== 'ai_agents') {
|
|
4335
|
+
if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
|
|
4335
4336
|
eligible_agent = false;
|
|
4336
4337
|
break;
|
|
4337
4338
|
}
|
|
@@ -4352,7 +4353,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4352
4353
|
}
|
|
4353
4354
|
|
|
4354
4355
|
case 'cpi': {
|
|
4355
|
-
if (reference_type !== 'ai_agents') {
|
|
4356
|
+
if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
|
|
4356
4357
|
eligible_agent = false;
|
|
4357
4358
|
break;
|
|
4358
4359
|
}
|
|
@@ -4454,7 +4455,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4454
4455
|
}
|
|
4455
4456
|
|
|
4456
4457
|
case 'image_generate': {
|
|
4457
|
-
if (reference_type !== 'ai_agents') {
|
|
4458
|
+
if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
|
|
4458
4459
|
eligible_agent = false;
|
|
4459
4460
|
break;
|
|
4460
4461
|
}
|
|
@@ -4554,7 +4555,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4554
4555
|
}
|
|
4555
4556
|
|
|
4556
4557
|
case 'ai_agent': {
|
|
4557
|
-
if (reference_type !== 'ai_agents') {
|
|
4558
|
+
if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
|
|
4558
4559
|
eligible_agent = false;
|
|
4559
4560
|
break;
|
|
4560
4561
|
}
|
|
@@ -4608,7 +4609,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4608
4609
|
break;
|
|
4609
4610
|
}
|
|
4610
4611
|
case 'plugin': {
|
|
4611
|
-
if (reference_type !== 'ai_agents') {
|
|
4612
|
+
if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
|
|
4612
4613
|
eligible_agent = false;
|
|
4613
4614
|
break;
|
|
4614
4615
|
}
|
|
@@ -4715,6 +4716,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4715
4716
|
return { code: 5, data: 'aborted' };
|
|
4716
4717
|
}
|
|
4717
4718
|
if (job_info.data.payload.ai_agents) {
|
|
4719
|
+
prompt_suggestion_activated = true;
|
|
4718
4720
|
ai_agents = job_info.data.payload.ai_agents;
|
|
4719
4721
|
agents = await get_agents();
|
|
4720
4722
|
}
|