@xuda.io/ai_module 1.1.5191 → 1.1.5193

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 +11 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4072,8 +4072,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4072
4072
  const prev_conversation_items = await client.conversations.items.list(conversation_doc.reference_conversation_id, { order: 'desc' });
4073
4073
  const last_conversation_item = prev_conversation_items?.data?.[0]?.id;
4074
4074
 
4075
+ const out_conversation_item_id = await _common.xuda_get_uuid('chat_conversation_item');
4076
+ const in_conversation_item_id = await _common.xuda_get_uuid('chat_conversation_item');
4077
+
4075
4078
  let out_conversation_item_obj = {
4076
- _id: await _common.xuda_get_uuid('chat_conversation_item'),
4079
+ _id: out_conversation_item_id,
4077
4080
  stat: 3, //1,
4078
4081
  docType: 'chat_conversation_item',
4079
4082
  uid,
@@ -4103,6 +4106,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4103
4106
  conversation_id,
4104
4107
  job_id,
4105
4108
  delta: content,
4109
+ out_conversation_item_id,
4110
+ in_conversation_item_id,
4106
4111
  },
4107
4112
  });
4108
4113
  };
@@ -4655,7 +4660,9 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4655
4660
  });
4656
4661
  if (eligible_agent) {
4657
4662
  // allow read only agents if not ai_agent scope
4658
- init_agent_hooks(agent);
4663
+ if (!prompt_suggestion_activated) {
4664
+ init_agent_hooks(agent);
4665
+ }
4659
4666
  list.push(agent);
4660
4667
  }
4661
4668
  } catch (err) {
@@ -4711,7 +4718,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4711
4718
  await render_suggestions();
4712
4719
  await _utils.delay(10000);
4713
4720
  const job_info = await jobs_ms.get_job_info({ job_id });
4714
- debugger;
4721
+
4715
4722
  if (job_info.code < 0 || job_info.data.stat === 4) {
4716
4723
  return { code: 5, data: 'aborted' };
4717
4724
  }
@@ -4771,7 +4778,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4771
4778
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
4772
4779
 
4773
4780
  let in_conversation_item_obj = {
4774
- _id: await _common.xuda_get_uuid('chat_conversation_item'),
4781
+ _id: in_conversation_item_id,
4775
4782
  stat: 3,
4776
4783
  docType: 'chat_conversation_item',
4777
4784
  uid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5191",
3
+ "version": "1.1.5193",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",