@xuda.io/ai_module 1.1.4262 → 1.1.4264
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 +15 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4242,10 +4242,22 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4242
4242
|
receiver_conversation_doc.chat_image = sender_conversation_doc.chat_image;
|
|
4243
4243
|
await db_module.save_app_couch_doc_native(receiver_app_id, receiver_conversation_doc);
|
|
4244
4244
|
|
|
4245
|
-
await update_conversation_mood_level(
|
|
4245
|
+
await update_conversation_mood_level(
|
|
4246
|
+
uid,
|
|
4247
|
+
[
|
|
4248
|
+
{ uid: account_profile_info.uid, contact_id: reference_id },
|
|
4249
|
+
{ uid: contact_uid_chat_conversation.uid, contact_id: reference_id },
|
|
4250
|
+
],
|
|
4251
|
+
conversation_obj.id,
|
|
4252
|
+
prompt,
|
|
4253
|
+
uid,
|
|
4254
|
+
contact_uid_chat_conversation,
|
|
4255
|
+
true,
|
|
4256
|
+
account_profile_info,
|
|
4257
|
+
);
|
|
4246
4258
|
} else {
|
|
4247
4259
|
// other cases rather then chat
|
|
4248
|
-
await update_conversation_mood_level(uid, conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts', account_profile_info);
|
|
4260
|
+
await update_conversation_mood_level(uid, [{ uid: account_profile_info.uid, contact_id: reference_id }], conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts', account_profile_info);
|
|
4249
4261
|
}
|
|
4250
4262
|
}
|
|
4251
4263
|
}, 1000);
|
|
@@ -4338,7 +4350,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4338
4350
|
}
|
|
4339
4351
|
};
|
|
4340
4352
|
|
|
4341
|
-
const update_conversation_mood_level = async function (uid, conversation_id, prompt, sender_uid, receiver_uid, update_contact, account_profile_info) {
|
|
4353
|
+
const update_conversation_mood_level = async function (uid, target = [], conversation_id, prompt, sender_uid, receiver_uid, update_contact, account_profile_info) {
|
|
4342
4354
|
try {
|
|
4343
4355
|
// analyze the mood of the conversation
|
|
4344
4356
|
const mood_level = await submit_chat_gpt_prompt({
|