@xuda.io/ai_module 1.1.4836 → 1.1.4837

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 +16 -10
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3761,16 +3761,22 @@ const chat_note = async function (req, job_id, headers) {
3761
3761
  let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
3762
3762
 
3763
3763
  await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
3764
-
3765
- const item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3766
- items: [
3767
- {
3768
- type: 'message',
3769
- role: 'user',
3770
- content: [{ type: 'input_text', text: body }],
3771
- },
3772
- ],
3773
- });
3764
+ let item;
3765
+ try {
3766
+ item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
3767
+ items: [
3768
+ {
3769
+ type: 'message',
3770
+ role: 'user',
3771
+ content: [{ type: 'input_text', text: body }],
3772
+ },
3773
+ ],
3774
+ });
3775
+ report_ai_status('conversations');
3776
+ } catch (err) {
3777
+ report_ai_status('conversations', err);
3778
+ throw err;
3779
+ }
3774
3780
 
3775
3781
  // let obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'note' };
3776
3782
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4836",
3
+ "version": "1.1.4837",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",