@xuda.io/ai_module 1.1.5183 → 1.1.5185

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 +8 -6
  2. 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');
@@ -4331,7 +4331,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4331
4331
  }
4332
4332
 
4333
4333
  case 'mcp': {
4334
- if (reference_type !== 'ai_agents') {
4334
+ if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
4335
4335
  eligible_agent = false;
4336
4336
  break;
4337
4337
  }
@@ -4352,7 +4352,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4352
4352
  }
4353
4353
 
4354
4354
  case 'cpi': {
4355
- if (reference_type !== 'ai_agents') {
4355
+ if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
4356
4356
  eligible_agent = false;
4357
4357
  break;
4358
4358
  }
@@ -4454,7 +4454,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4454
4454
  }
4455
4455
 
4456
4456
  case 'image_generate': {
4457
- if (reference_type !== 'ai_agents') {
4457
+ if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
4458
4458
  eligible_agent = false;
4459
4459
  break;
4460
4460
  }
@@ -4554,7 +4554,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4554
4554
  }
4555
4555
 
4556
4556
  case 'ai_agent': {
4557
- if (reference_type !== 'ai_agents') {
4557
+ if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
4558
4558
  eligible_agent = false;
4559
4559
  break;
4560
4560
  }
@@ -4608,7 +4608,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4608
4608
  break;
4609
4609
  }
4610
4610
  case 'plugin': {
4611
- if (reference_type !== 'ai_agents') {
4611
+ if (reference_type !== 'ai_agents' && !prompt_suggestion_activated) {
4612
4612
  eligible_agent = false;
4613
4613
  break;
4614
4614
  }
@@ -4715,6 +4715,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4715
4715
  return { code: 5, data: 'aborted' };
4716
4716
  }
4717
4717
  if (job_info.data.payload.ai_agents) {
4718
+ prompt_suggestion_activated = true;
4718
4719
  ai_agents = job_info.data.payload.ai_agents;
4719
4720
  agents = await get_agents();
4720
4721
  }
@@ -4782,6 +4783,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4782
4783
  direction: 'in',
4783
4784
  role: 'assistant',
4784
4785
  ai_agent_id: output.state._currentAgent.name,
4786
+ job_id,
4785
4787
  };
4786
4788
  const save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, in_conversation_item_obj);
4787
4789
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5183",
3
+ "version": "1.1.5185",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",