@xuda.io/ai_module 1.1.4601 → 1.1.4603

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 +6 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4168,7 +4168,7 @@ export const create_conversation = async function (req, job_id, headers) {
4168
4168
  if (prompt.split(' ').length > 10) {
4169
4169
  const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano', metadata: { conversation_id: conversation_doc._id, func: 'create_conversation' }, account_profile_info });
4170
4170
 
4171
- conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_obj.id);
4171
+ conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
4172
4172
  conversation_doc.title = title.data;
4173
4173
 
4174
4174
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
@@ -4183,10 +4183,10 @@ export const create_conversation = async function (req, job_id, headers) {
4183
4183
  // write conversation to host after thumbnail update
4184
4184
  // get sender conversation
4185
4185
 
4186
- const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_obj.id);
4186
+ const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
4187
4187
 
4188
4188
  const recipient_account_profile_info = await ac3180count_module.get_active_account_profile_info(recipient_uid);
4189
- let recipient_conversation_doc = await db_module.get_app_couch_doc_native(recipient_account_profile_info.app_id, conversation_obj.id);
4189
+ let recipient_conversation_doc = await db_module.get_app_couch_doc_native(recipient_account_profile_info.app_id, conversation_doc._id);
4190
4190
  recipient_conversation_doc.title = conversation_doc.title;
4191
4191
 
4192
4192
  recipient_conversation_doc.thumbnail_request_ts = conversation_doc.thumbnail_request_ts;
@@ -4199,7 +4199,7 @@ export const create_conversation = async function (req, job_id, headers) {
4199
4199
  { uid: account_profile_info.uid, contact_id: reference_id },
4200
4200
  { uid: recipient_uid, contact_id: recipient_contact_id },
4201
4201
  ],
4202
- conversation_obj.id,
4202
+ conversation_doc._id,
4203
4203
  prompt,
4204
4204
  uid,
4205
4205
  recipient_uid,
@@ -4209,7 +4209,7 @@ export const create_conversation = async function (req, job_id, headers) {
4209
4209
  } else {
4210
4210
  // other cases rather then chat
4211
4211
  if (perform_ai_execution) {
4212
- await update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id: reference_id }], conversation_obj.id, prompt, null, contact_id, conversation_doc.reference_type === 'contacts', account_profile_info);
4212
+ await update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id: reference_id }], conversation_doc._id, prompt, null, contact_id, conversation_doc.reference_type === 'contacts', account_profile_info);
4213
4213
  }
4214
4214
  }
4215
4215
  }
@@ -4521,7 +4521,7 @@ const chat_email = async function (req, job_id, headers) {
4521
4521
  last_email_item_id: last_email_item?._id,
4522
4522
  };
4523
4523
 
4524
- const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, out_conversation_item_obj);
4524
+ const save_ret = await db_module.save_app_couch_doc(sender_app_id, out_conversation_item_obj);
4525
4525
  // const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, {
4526
4526
  // _id: obj.id,
4527
4527
  // stat: 3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4601",
3
+ "version": "1.1.4603",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",