@xuda.io/ai_module 1.1.4878 → 1.1.4880
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
|
@@ -6183,7 +6183,7 @@ export const get_transcript = async function (uid, app_id, conversation_id, acco
|
|
|
6183
6183
|
return transcript;
|
|
6184
6184
|
};
|
|
6185
6185
|
|
|
6186
|
-
export const
|
|
6186
|
+
export const add_transcript_conversation_item = async function (reference_conversation_id, filename, transcript) {
|
|
6187
6187
|
try {
|
|
6188
6188
|
const items = await client.conversations.items.create(reference_conversation_id, {
|
|
6189
6189
|
items: [
|
|
@@ -6330,21 +6330,22 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6330
6330
|
}
|
|
6331
6331
|
let items;
|
|
6332
6332
|
if (transcript) {
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6333
|
+
items = await add_transcript_conversation_item(conversation_doc.reference_conversation_id, file.filename, transcript);
|
|
6334
|
+
// try {
|
|
6335
|
+
// items = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
|
|
6336
|
+
// items: [
|
|
6337
|
+
// {
|
|
6338
|
+
// type: 'message',
|
|
6339
|
+
// role: 'system',
|
|
6340
|
+
// content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript?.data || transcript || ''}` }],
|
|
6341
|
+
// },
|
|
6342
|
+
// ],
|
|
6343
|
+
// });
|
|
6344
|
+
// report_ai_status('conversations');
|
|
6345
|
+
// } catch (err) {
|
|
6346
|
+
// report_ai_status('conversations', err);
|
|
6347
|
+
// throw err;
|
|
6348
|
+
// }
|
|
6348
6349
|
}
|
|
6349
6350
|
let out_conversation_item_obj = {
|
|
6350
6351
|
_id: await _common.xuda_get_uuid('chat_conversation_item'),
|