@xuda.io/ai_module 1.1.4608 → 1.1.4610
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 +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3403,7 +3403,7 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
|
|
|
3403
3403
|
images_arr = [cache];
|
|
3404
3404
|
if (!cache) {
|
|
3405
3405
|
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);
|
|
3406
|
-
account_module.
|
|
3406
|
+
account_module.save_xuda_cache(uid, 'chat_thumbnail', doc.title, images_arr[0], { tags });
|
|
3407
3407
|
}
|
|
3408
3408
|
db_doc = await get_db_doc();
|
|
3409
3409
|
db_doc.thumbnail_request_ts = Date.now();
|
|
@@ -7010,10 +7010,10 @@ export const get_business_info = async function (uid, name, email, account_profi
|
|
|
7010
7010
|
}
|
|
7011
7011
|
};
|
|
7012
7012
|
|
|
7013
|
-
const get_chat_picture_cache = async function (uid, docType,
|
|
7014
|
-
if (!
|
|
7013
|
+
const get_chat_picture_cache = async function (uid, docType, key) {
|
|
7014
|
+
if (!key || typeof key !== 'string') return null;
|
|
7015
7015
|
|
|
7016
|
-
const words =
|
|
7016
|
+
const words = key
|
|
7017
7017
|
.trim()
|
|
7018
7018
|
.toLowerCase()
|
|
7019
7019
|
.split(/\s+/)
|
|
@@ -7022,7 +7022,7 @@ const get_chat_picture_cache = async function (uid, docType, name) {
|
|
|
7022
7022
|
if (words.length < 3) {
|
|
7023
7023
|
// Direct exact match for short names
|
|
7024
7024
|
const ret = await db_module.find_couch_query('xuda_cache', {
|
|
7025
|
-
selector: { docType,
|
|
7025
|
+
selector: { docType, key: key.toLowerCase().trim() },
|
|
7026
7026
|
limit: 1,
|
|
7027
7027
|
});
|
|
7028
7028
|
|
|
@@ -7046,7 +7046,7 @@ const get_chat_picture_cache = async function (uid, docType, name) {
|
|
|
7046
7046
|
selector: {
|
|
7047
7047
|
docType,
|
|
7048
7048
|
$and: threeWords.map((word) => ({
|
|
7049
|
-
|
|
7049
|
+
key: { $regex: `(?i)\\b${word}\\b` },
|
|
7050
7050
|
})),
|
|
7051
7051
|
},
|
|
7052
7052
|
limit: 1,
|