@xuda.io/ai_module 1.1.4797 → 1.1.4799

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 +8 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6716,14 +6716,17 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6716
6716
  return transcript;
6717
6717
  };
6718
6718
 
6719
- let file_names = [];
6719
+ // let file_names = [];
6720
+ let process_stat = 'full';
6720
6721
  let system_message_items = [];
6721
6722
  for (const file of attachments) {
6722
- file_names.push(file.filename);
6723
+ // file_names.push(file.filename);
6723
6724
  let transcript;
6724
6725
  try {
6725
6726
  transcript = await get_transcript(file.filename);
6726
- } catch (error) {}
6727
+ } catch (error) {
6728
+ process_stat = 'partial';
6729
+ }
6727
6730
 
6728
6731
  const items = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
6729
6732
  items: [
@@ -6752,23 +6755,17 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6752
6755
  conversation_item_reference_id: items.last_id,
6753
6756
  file,
6754
6757
  read: { [uid]: Date.now() },
6758
+ process_stat,
6755
6759
  };
6756
6760
  await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj);
6757
6761
  system_message_items.push(out_conversation_item_obj);
6758
6762
  }
6759
6763
 
6760
- // const items = await client.conversations.items.create(conversation_id, {
6761
- // items: system_message_items,
6762
- // });
6763
-
6764
- // console.log(items.data);
6765
-
6766
6764
  conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
6767
6765
 
6768
6766
  conversation_doc.ts = Date.now();
6769
6767
  conversation_doc.stat = 2;
6770
- // conversation_doc.messages = [...conversation_doc.messages, ...system_message_items];
6771
- // s.push(obj);
6768
+
6772
6769
  await db_module.save_app_couch_doc_native(app_id, conversation_doc);
6773
6770
  return system_message_items;
6774
6771
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4797",
3
+ "version": "1.1.4799",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",