@xuda.io/ai_module 1.1.5529 → 1.1.5530

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 +3 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3904,9 +3904,9 @@ const chat_note = async function (req, job_id, headers) {
3904
3904
  let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
3905
3905
 
3906
3906
  await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
3907
- let item;
3907
+ let conversation_item_reference_id;
3908
3908
  try {
3909
- add_conversation_item(uid, profile_id, conversation_id, body, 'note', conversation_doc.reference_id, {});
3909
+ conversation_item_reference_id = await add_conversation_item(uid, profile_id, conversation_id, body, 'note', conversation_doc.reference_id, {});
3910
3910
 
3911
3911
  report_ai_status('conversations');
3912
3912
  } catch (err) {
@@ -3914,11 +3914,6 @@ const chat_note = async function (req, job_id, headers) {
3914
3914
  throw err;
3915
3915
  }
3916
3916
 
3917
- // let obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'note' };
3918
-
3919
- // sender_conversation_doc.messages.push(obj);
3920
- // await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
3921
-
3922
3917
  let out_conversation_item_obj = {
3923
3918
  _id: await _common.xuda_get_uuid('chat_conversation_item'),
3924
3919
  stat: 3,
@@ -3931,7 +3926,7 @@ const chat_note = async function (req, job_id, headers) {
3931
3926
  conversation_id,
3932
3927
  text: body,
3933
3928
  reference_id: conversation_doc.reference_id,
3934
- conversation_item_reference_id: item.data[0].id,
3929
+ conversation_item_reference_id,
3935
3930
  direction: 'out',
3936
3931
  role: 'user',
3937
3932
  read: { [uid]: Date.now() },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5529",
3
+ "version": "1.1.5530",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",