@xuda.io/ai_module 1.1.4130 → 1.1.4132

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 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1723,7 +1723,7 @@ export const get_chat_conversation = async function (req) {
1723
1723
 
1724
1724
  export const get_ai_chats = async function (req, job_id, headers) {
1725
1725
  let { uid, reference_id, _id, search, filter_type = 'all', conversation_type, limit, skip, conversation_id } = req;
1726
- debugger;
1726
+
1727
1727
  const active_account_profile_info = await account_module.get_active_account_profile_info(uid);
1728
1728
 
1729
1729
  const get_conversation_background = function (doc) {
@@ -4172,6 +4172,9 @@ export const submit_chat_gpt_prompt = async function (req) {
4172
4172
  export const create_conversation = async function (req, job_id, headers) {
4173
4173
  const { uid, prompt } = req;
4174
4174
  let { reference_type, reference_id = '', conversation_type } = req;
4175
+
4176
+ const active_account_profile_info = await account_module.get_active_account_profile_info(uid);
4177
+
4175
4178
  const app_id = await account_module.get_account_default_project_id(uid);
4176
4179
 
4177
4180
  try {
@@ -4191,8 +4194,9 @@ export const create_conversation = async function (req, job_id, headers) {
4191
4194
  conversation_obj,
4192
4195
  conversation_type,
4193
4196
  initiator_uid: uid,
4197
+ account_profile_id: active_account_profile_info.account_profile_id,
4194
4198
  };
4195
- const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
4199
+ const save_ret = await db_module.save_app_couch_doc(active_account_profile_info.app_id, conversation_doc);
4196
4200
 
4197
4201
  let contact_uid_chat_conversation, receiver_contact_id, receiver_contact_doc;
4198
4202
 
@@ -4216,9 +4220,6 @@ export const create_conversation = async function (req, job_id, headers) {
4216
4220
  const save_ret = await db_module.save_app_couch_doc(app_id, { ...conversation_doc, ...{ uid: receiver_contact_doc.contact_uid, reference_id: sender_contact_id } });
4217
4221
  contact_uid_chat_conversation = receiver_contact_doc.contact_uid;
4218
4222
  }
4219
-
4220
- if (conversation_type === 'note') {
4221
- }
4222
4223
  }
4223
4224
 
4224
4225
  setTimeout(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4130",
3
+ "version": "1.1.4132",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",