@xuda.io/ai_module 1.1.5520 → 1.1.5522
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 +10 -31
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3789,12 +3789,6 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
3789
3789
|
ret = { code: -44, data: 'invalid conversation_type ' + conversation_doc.conversation_type };
|
|
3790
3790
|
break;
|
|
3791
3791
|
}
|
|
3792
|
-
|
|
3793
|
-
// if (conversation_doc.conversation_type === 'note') {
|
|
3794
|
-
// return await chat_note(req, job_id, headers);
|
|
3795
|
-
// } else {
|
|
3796
|
-
// return await contact_chat_conversation(req, job_id, headers);
|
|
3797
|
-
// }
|
|
3798
3792
|
} else {
|
|
3799
3793
|
ret = await ai_chat_conversation(req, job_id, headers);
|
|
3800
3794
|
}
|
|
@@ -3861,17 +3855,17 @@ const contact_chat_conversation = async function (req, job_id, headers) {
|
|
|
3861
3855
|
const sender_app_id = account_profile_info.app_id;
|
|
3862
3856
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
3863
3857
|
|
|
3864
|
-
let item;
|
|
3865
3858
|
try {
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3859
|
+
add_conversation_item(uid, profile_id, conversation_id, prompt, 'chat', conversation_doc.reference_id);
|
|
3860
|
+
// item = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
|
|
3861
|
+
// items: [
|
|
3862
|
+
// {
|
|
3863
|
+
// type: 'message',
|
|
3864
|
+
// role: 'user',
|
|
3865
|
+
// content: [{ type: 'input_text', text: prompt }],
|
|
3866
|
+
// },
|
|
3867
|
+
// ],
|
|
3868
|
+
// });
|
|
3875
3869
|
report_ai_status('conversations');
|
|
3876
3870
|
} catch (err) {
|
|
3877
3871
|
report_ai_status('conversations', err);
|
|
@@ -6819,21 +6813,6 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
|
|
|
6819
6813
|
let items;
|
|
6820
6814
|
if (transcript) {
|
|
6821
6815
|
items = await add_transcript_conversation_item(conversation_doc.reference_conversation_id, file.filename, transcript);
|
|
6822
|
-
// try {
|
|
6823
|
-
// items = await client.conversations.items.create(conversation_doc.reference_conversation_id, {
|
|
6824
|
-
// items: [
|
|
6825
|
-
// {
|
|
6826
|
-
// type: 'message',
|
|
6827
|
-
// role: 'system',
|
|
6828
|
-
// content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript?.data || transcript || ''}` }],
|
|
6829
|
-
// },
|
|
6830
|
-
// ],
|
|
6831
|
-
// });
|
|
6832
|
-
// report_ai_status('conversations');
|
|
6833
|
-
// } catch (err) {
|
|
6834
|
-
// report_ai_status('conversations', err);
|
|
6835
|
-
// throw err;
|
|
6836
|
-
// }
|
|
6837
6816
|
}
|
|
6838
6817
|
let out_conversation_item_obj = {
|
|
6839
6818
|
_id: await _common.xuda_get_uuid('chat_conversation_item'),
|