@xuda.io/ai_module 1.1.4410 → 1.1.4412

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.
Files changed (2) hide show
  1. package/index.mjs +8 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3358,12 +3358,14 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
3358
3358
 
3359
3359
  case 'conversation': {
3360
3360
  prompt = `create image: ${doc.title}`;
3361
-
3362
- const 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);
3363
- db_doc = await get_db_doc();
3364
- db_doc.thumbnail_request_ts = Date.now();
3365
- db_doc.chat_image = images_arr;
3366
- account_module.save_picture_cache(uid, 'chat_thumbnail', prompt.substr(14), db_doc.chat_image[0], { tags });
3361
+ const cache = await account_module.get_picture_cache(uid, 'chat_thumbnail', prompt.substr(14));
3362
+ if (!cache) {
3363
+ const 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);
3364
+ db_doc = await get_db_doc();
3365
+ db_doc.thumbnail_request_ts = Date.now();
3366
+ db_doc.chat_image = images_arr;
3367
+ account_module.save_picture_cache(uid, 'chat_thumbnail', prompt.substr(14), db_doc.chat_image[0], { tags });
3368
+ }
3367
3369
  break;
3368
3370
  }
3369
3371
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4410",
3
+ "version": "1.1.4412",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",