@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.
- package/index.mjs +8 -11
- 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
|
-
|
|
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
|
};
|