@xuda.io/ai_module 1.1.5520 → 1.1.5522

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 +10 -31
  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,17 +3855,17 @@ 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
 
3864
- let item;
3865
3858
  try {
3866
- item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3867
- items: [
3868
- {
3869
- type: 'message',
3870
- role: 'user',
3871
- content: [{ type: 'input_text', text: prompt }],
3872
- },
3873
- ],
3874
- });
3859
+ add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id);
3860
+ // item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3861
+ // items: [
3862
+ // {
3863
+ // type: 'message',
3864
+ // role: 'user',
3865
+ // content: [{ type: 'input_text', text: prompt }],
3866
+ // },
3867
+ // ],
3868
+ // });
3875
3869
  report_ai_status('conversations');
3876
3870
  } catch (err) {
3877
3871
  report_ai_status('conversations', err);
@@ -6819,21 +6813,6 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6819
6813
  let items;
6820
6814
  if (transcript) {
6821
6815
  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
6816
  }
6838
6817
  let out_conversation_item_obj = {
6839
6818
  _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.5520",
3
+ "version": "1.1.5522",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",