@xuda.io/ai_module 1.1.3872 → 1.1.3874

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 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1828,7 +1828,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
1828
1828
  ],
1829
1829
  };
1830
1830
  }
1831
-
1831
+ debugger;
1832
1832
  const app_id = await account_module.get_account_default_project_id(uid);
1833
1833
 
1834
1834
  ////// FROM - IN
@@ -4031,12 +4031,12 @@ export const create_conversation = async function (req, job_id, headers) {
4031
4031
  };
4032
4032
  const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
4033
4033
 
4034
- let contact_uid_chat_conversation;
4034
+ let contact_uid_chat_conversation, receiver_contact_id, receiver_contact_doc;
4035
4035
 
4036
4036
  if (conversation_doc.reference_type === 'contacts') {
4037
4037
  // reference_id is the contact id
4038
- const receiver_contact_id = reference_id;
4039
- const receiver_contact_doc = await account_module.get_contact_info(uid, null, receiver_contact_id);
4038
+ receiver_contact_id = reference_id;
4039
+ receiver_contact_doc = await account_module.get_contact_info(uid, null, receiver_contact_id);
4040
4040
  if (conversation_type === 'chat') {
4041
4041
  if (receiver_contact_doc?.connection_stat !== 3) {
4042
4042
  throw new Error('chat conversation to the recipient is not available');
@@ -4068,6 +4068,7 @@ export const create_conversation = async function (req, job_id, headers) {
4068
4068
  await db_module.save_app_couch_doc_native(app_id, conversation_doc);
4069
4069
 
4070
4070
  await update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
4071
+
4071
4072
  if (conversation_doc.reference_type === 'contacts') {
4072
4073
  if (contact_uid_chat_conversation) {
4073
4074
  // write conversation to host after thumbnail update
@@ -4085,6 +4086,7 @@ export const create_conversation = async function (req, job_id, headers) {
4085
4086
 
4086
4087
  await update_conversation_mood_level(conversation_obj.id, prompt, uid, contact_uid_chat_conversation, true);
4087
4088
  } else {
4089
+ // other cases rather then chat
4088
4090
  await update_conversation_mood_level(conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts');
4089
4091
  }
4090
4092
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3872",
3
+ "version": "1.1.3874",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",