@xuda.io/ai_module 1.1.4141 → 1.1.4142
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 +4 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4251,10 +4251,10 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4251
4251
|
receiver_conversation_doc.chat_image = sender_conversation_doc.chat_image;
|
|
4252
4252
|
await db_module.save_app_couch_doc_native(receiver_app_id, receiver_conversation_doc);
|
|
4253
4253
|
|
|
4254
|
-
await update_conversation_mood_level(conversation_obj.id, prompt, uid, contact_uid_chat_conversation, true);
|
|
4254
|
+
await update_conversation_mood_level(conversation_obj.id, prompt, uid, contact_uid_chat_conversation, true, account_profile_info);
|
|
4255
4255
|
} else {
|
|
4256
4256
|
// other cases rather then chat
|
|
4257
|
-
await update_conversation_mood_level(conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts');
|
|
4257
|
+
await update_conversation_mood_level(conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts', account_profile_info);
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
4260
4260
|
}, 1000);
|
|
@@ -4342,7 +4342,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4342
4342
|
}
|
|
4343
4343
|
};
|
|
4344
4344
|
|
|
4345
|
-
const update_conversation_mood_level = async function (conversation_id, prompt, sender_uid, receiver_uid, update_contact) {
|
|
4345
|
+
const update_conversation_mood_level = async function (conversation_id, prompt, sender_uid, receiver_uid, update_contact, account_profile_info) {
|
|
4346
4346
|
try {
|
|
4347
4347
|
// analyze the mood of the conversation
|
|
4348
4348
|
const mood_level = await submit_chat_gpt_prompt({
|
|
@@ -4353,6 +4353,7 @@ const update_conversation_mood_level = async function (conversation_id, prompt,
|
|
|
4353
4353
|
mood_level: z.number().describe('mood level of interaction: -2: very negative,-1: negative 0:natural 1:positive 2: very positive'),
|
|
4354
4354
|
}),
|
|
4355
4355
|
metadata: { conversation_id, func: 'update_conversation_mood_level' },
|
|
4356
|
+
account_profile_info,
|
|
4356
4357
|
});
|
|
4357
4358
|
|
|
4358
4359
|
const mood_level_obj = JSON5.parse(mood_level.data);
|