@xuda.io/ai_module 1.1.5509 → 1.1.5511
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 +16 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5112,7 +5112,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
5112
5112
|
}
|
|
5113
5113
|
};
|
|
5114
5114
|
|
|
5115
|
-
const add_conversation_item = async function (uid, profile_id, conversation_id,
|
|
5115
|
+
const add_conversation_item = async function (uid, profile_id, conversation_id, body, conversation_type, contact_id, metadata = {}) {
|
|
5116
5116
|
const account_profile_info = await get_active_account_profile_info(uid, profile_id);
|
|
5117
5117
|
|
|
5118
5118
|
try {
|
|
@@ -5131,13 +5131,27 @@ const add_conversation_item = async function (uid, profile_id, conversation_id,
|
|
|
5131
5131
|
{
|
|
5132
5132
|
type: 'message',
|
|
5133
5133
|
role: 'user',
|
|
5134
|
-
content: [{ type: 'input_text', text:
|
|
5134
|
+
content: [{ type: 'input_text', text: }],
|
|
5135
5135
|
},
|
|
5136
5136
|
],
|
|
5137
5137
|
});
|
|
5138
5138
|
} catch (err) {
|
|
5139
5139
|
throw err;
|
|
5140
5140
|
}
|
|
5141
|
+
if(contact_id){
|
|
5142
|
+
try {
|
|
5143
|
+
const item = await client.conversations.items.create(conversation_doc.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
|
+
}}
|
|
5141
5155
|
} catch (err) {
|
|
5142
5156
|
throw err;
|
|
5143
5157
|
}
|