@xuda.io/ai_module 1.1.5519 → 1.1.5521

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 -22
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3789,12 +3789,6 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
3789
3789
  ret = { code: -44, data: 'invalid conversation_type ' + conversation_doc.conversation_type };
3790
3790
  break;
3791
3791
  }
3792
-
3793
- // if (conversation_doc.conversation_type === 'note') {
3794
- // return await chat_note(req, job_id, headers);
3795
- // } else {
3796
- // return await contact_chat_conversation(req, job_id, headers);
3797
- // }
3798
3792
  } else {
3799
3793
  ret = await ai_chat_conversation(req, job_id, headers);
3800
3794
  }
@@ -3861,6 +3855,8 @@ const contact_chat_conversation = async function (req, job_id, headers) {
3861
3855
  const sender_app_id = account_profile_info.app_id;
3862
3856
  let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
3863
3857
 
3858
+ add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id);
3859
+
3864
3860
  let item;
3865
3861
  try {
3866
3862
  item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
@@ -5122,7 +5118,7 @@ const add_conversation_item = async function (uid, profile_id, conversation_id,
5122
5118
 
5123
5119
  const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
5124
5120
 
5125
- let text = `${new Date()} User Uid: ${uid} User Name: ${account_info.full_name} Type: ${conversation_type} `;
5121
+ let text = `${new Date()} User Uid: ${uid} User Name: ${account_info.full_name} Type: ${_.capitalize(conversation_type)} `;
5126
5122
 
5127
5123
  switch (conversation_type) {
5128
5124
  case 'note':
@@ -6819,21 +6815,6 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6819
6815
  let items;
6820
6816
  if (transcript) {
6821
6817
  items = await add_transcript_conversation_item(conversation_doc.reference_conversation_id, file.filename, transcript);
6822
- // try {
6823
- // items = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
6824
- // items: [
6825
- // {
6826
- // type: 'message',
6827
- // role: 'system',
6828
- // content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript?.data || transcript || ''}` }],
6829
- // },
6830
- // ],
6831
- // });
6832
- // report_ai_status('conversations');
6833
- // } catch (err) {
6834
- // report_ai_status('conversations', err);
6835
- // throw err;
6836
- // }
6837
6818
  }
6838
6819
  let out_conversation_item_obj = {
6839
6820
  _id: await _common.xuda_get_uuid('chat_conversation_item'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5519",
3
+ "version": "1.1.5521",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",