@xuda.io/ai_module 1.1.4992 → 1.1.4994

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 +5 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3373,7 +3373,7 @@ function getFirstNWords(text, n = 10) {
3373
3373
  }
3374
3374
 
3375
3375
  export const create_conversation = async function (req, job_id, headers) {
3376
- const { profile_id, uid, prompt, perform_ai_execution = true, email_id, email_direction = 'out', from_mailbox, date_created, ai_model = _conf.default_ai_model } = req;
3376
+ const { profile_id, uid, prompt, perform_ai_execution = true, email_id, direction = 'out', from_mailbox, date_created, ai_model = _conf.default_ai_model } = req;
3377
3377
  let { reference_type, reference_id = '', conversation_type, email_recipient_type } = req;
3378
3378
 
3379
3379
  const account_profile_info = await get_active_account_profile_info(uid, profile_id);
@@ -3416,7 +3416,7 @@ export const create_conversation = async function (req, job_id, headers) {
3416
3416
  conversation_obj,
3417
3417
  conversation_type,
3418
3418
  initiator_uid: uid,
3419
- email_direction,
3419
+ direction,
3420
3420
  email_id,
3421
3421
  reference_conversation_id: conversation_obj.id,
3422
3422
  account_profiles: [account_profile_obj._id],
@@ -3470,6 +3470,7 @@ export const create_conversation = async function (req, job_id, headers) {
3470
3470
 
3471
3471
  recipient_conversation_doc.thumbnail_request_ts = conversation_doc.thumbnail_request_ts;
3472
3472
  recipient_conversation_doc.chat_image = conversation_doc.chat_image;
3473
+ recipient_conversation_doc.direction = 'in';
3473
3474
  await db_module.save_app_couch_doc_native(recipient_account_profile_info.app_id, recipient_conversation_doc);
3474
3475
 
3475
3476
  await update_conversation_mood_level(
@@ -3802,7 +3803,7 @@ const chat_note = async function (req, job_id, headers) {
3802
3803
  };
3803
3804
 
3804
3805
  const chat_email = async function (req, job_id, headers) {
3805
- const { profile_id, uid, email_id, perform_ai_execution = true, from_mailbox, _thread_reentry, email_direction } = req;
3806
+ const { profile_id, uid, email_id, perform_ai_execution = true, from_mailbox, _thread_reentry, direction } = req;
3806
3807
  const account_profile_info = await get_active_account_profile_info(uid, profile_id);
3807
3808
  let { prompt: body, conversation_doc, attachments = [], ai_agents } = req;
3808
3809
  try {
@@ -3910,7 +3911,7 @@ const chat_email = async function (req, job_id, headers) {
3910
3911
  text: body,
3911
3912
  reference_id: conversation_doc.reference_id,
3912
3913
  conversation_item_reference_id: item.data[0].id,
3913
- direction: email_direction,
3914
+ direction,
3914
3915
  role: 'user',
3915
3916
  email_id,
3916
3917
  subject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4992",
3
+ "version": "1.1.4994",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",