@xuda.io/ai_module 1.1.4469 → 1.1.4471
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 +7 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4053,7 +4053,7 @@ export const submit_chat_gpt_prompt = async function (req) {
|
|
|
4053
4053
|
}
|
|
4054
4054
|
};
|
|
4055
4055
|
export const create_conversation = async function (req, job_id, headers) {
|
|
4056
|
-
const { uid, prompt,
|
|
4056
|
+
const { uid, prompt, perform_ai_execution = true } = req;
|
|
4057
4057
|
let { reference_type, reference_id = '', conversation_type } = req;
|
|
4058
4058
|
|
|
4059
4059
|
function getFirstTenWords(text) {
|
|
@@ -4125,8 +4125,9 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4125
4125
|
|
|
4126
4126
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
|
|
4127
4127
|
}
|
|
4128
|
-
|
|
4129
|
-
|
|
4128
|
+
if (perform_ai_execution) {
|
|
4129
|
+
await update_thumbnail('conversation', conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
|
|
4130
|
+
}
|
|
4130
4131
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4131
4132
|
if (recipient_uid) {
|
|
4132
4133
|
// write conversation to host after thumbnail update
|
|
@@ -4157,7 +4158,9 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4157
4158
|
);
|
|
4158
4159
|
} else {
|
|
4159
4160
|
// other cases rather then chat
|
|
4160
|
-
|
|
4161
|
+
if (perform_ai_execution) {
|
|
4162
|
+
await update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id: reference_id }], conversation_obj.id, prompt, null, contact_id, conversation_doc.reference_type === 'contacts', account_profile_info);
|
|
4163
|
+
}
|
|
4161
4164
|
}
|
|
4162
4165
|
}
|
|
4163
4166
|
}, 1000);
|