@xuda.io/ai_module 1.1.5511 → 1.1.5513
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 +17 -16
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5120,7 +5120,6 @@ const add_conversation_item = async function (uid, profile_id, conversation_id,
|
|
|
5120
5120
|
if (account_info_ret.code < 0) throw new Error(account_info_ret.data);
|
|
5121
5121
|
const account_info = account_info_ret.data;
|
|
5122
5122
|
|
|
5123
|
-
let contact_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
|
|
5124
5123
|
const conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
5125
5124
|
|
|
5126
5125
|
let text = `${new Date()} User Uid: ${uid} User Name: ${account_info.full_name} Type: ${conversation_type}`;
|
|
@@ -5131,27 +5130,29 @@ const add_conversation_item = async function (uid, profile_id, conversation_id,
|
|
|
5131
5130
|
{
|
|
5132
5131
|
type: 'message',
|
|
5133
5132
|
role: 'user',
|
|
5134
|
-
content: [{ type: 'input_text', text
|
|
5133
|
+
content: [{ type: 'input_text', text }],
|
|
5135
5134
|
},
|
|
5136
5135
|
],
|
|
5137
5136
|
});
|
|
5138
5137
|
} catch (err) {
|
|
5139
5138
|
throw err;
|
|
5140
5139
|
}
|
|
5141
|
-
if(contact_id){
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
items
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5140
|
+
if (contact_id) {
|
|
5141
|
+
try {
|
|
5142
|
+
let contact_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
|
|
5143
|
+
const item = await client.conversations.items.create(contact_doc.contact_reference_conversation_id, {
|
|
5144
|
+
items: [
|
|
5145
|
+
{
|
|
5146
|
+
type: 'message',
|
|
5147
|
+
role: 'user',
|
|
5148
|
+
content: [{ type: 'input_text', text }],
|
|
5149
|
+
},
|
|
5150
|
+
],
|
|
5151
|
+
});
|
|
5152
|
+
} catch (err) {
|
|
5153
|
+
throw err;
|
|
5154
|
+
}
|
|
5155
|
+
}
|
|
5155
5156
|
} catch (err) {
|
|
5156
5157
|
throw err;
|
|
5157
5158
|
}
|