@xuda.io/ai_module 1.1.4666 → 1.1.4668
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 +20 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3455,6 +3455,22 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
|
|
|
3455
3455
|
break;
|
|
3456
3456
|
}
|
|
3457
3457
|
|
|
3458
|
+
case 'conversation_category': {
|
|
3459
|
+
prompt = `create image: ${doc.category_info.category}`;
|
|
3460
|
+
let images_arr;
|
|
3461
|
+
const cache = await get_chat_picture_cache(uid, 'chat_thumbnail', doc.category_info.category);
|
|
3462
|
+
images_arr = [cache];
|
|
3463
|
+
if (!cache) {
|
|
3464
|
+
images_arr = await create_and_upload_image_to_drive('user', 'Chat Thumbnails', doc._id, prompt, 1, uid, app_id, job_id, headers, true, tags, account_profile_info);
|
|
3465
|
+
account_module.save_xuda_cache(uid, 'chat_thumbnail', doc.category_info.category, images_arr[0], { tags });
|
|
3466
|
+
}
|
|
3467
|
+
db_doc = await get_db_doc();
|
|
3468
|
+
db_doc.thumbnail_request_ts = Date.now();
|
|
3469
|
+
db_doc.chat_image = images_arr;
|
|
3470
|
+
|
|
3471
|
+
break;
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3458
3474
|
case 'mini_app': {
|
|
3459
3475
|
if (doc.studio_meta.agent_image) return;
|
|
3460
3476
|
prompt = `create image: ${doc.properties.menuName}`;
|
|
@@ -4344,13 +4360,14 @@ const process_conversation = async function (uid, conversation_id, account_profi
|
|
|
4344
4360
|
break;
|
|
4345
4361
|
}
|
|
4346
4362
|
}
|
|
4363
|
+
debugger;
|
|
4347
4364
|
conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
|
|
4348
4365
|
conversation_doc.category_info = category_info;
|
|
4349
4366
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
|
|
4350
4367
|
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4368
|
+
if (category_info.category) {
|
|
4369
|
+
await update_thumbnail('conversation_category', conversation_doc, account_profile_info.app_id, uid, job_id, headers, null, null, account_profile_info);
|
|
4370
|
+
}
|
|
4354
4371
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4355
4372
|
if (recipient_uid) {
|
|
4356
4373
|
// valid for chat conversation
|