@xuda.io/ai_module 1.1.4417 → 1.1.4419
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 +5 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3357,11 +3357,10 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
|
|
|
3357
3357
|
}
|
|
3358
3358
|
|
|
3359
3359
|
case 'conversation': {
|
|
3360
|
-
debugger;
|
|
3361
3360
|
prompt = `create image: ${doc.title}`;
|
|
3362
3361
|
let images_arr;
|
|
3363
3362
|
const cache = await account_module.get_picture_cache(uid, 'chat_thumbnail', doc.title);
|
|
3364
|
-
images_arr = cache;
|
|
3363
|
+
images_arr = [cache];
|
|
3365
3364
|
if (!cache) {
|
|
3366
3365
|
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);
|
|
3367
3366
|
account_module.save_picture_cache(uid, 'chat_thumbnail', doc.title, images_arr[0], { tags });
|
|
@@ -5668,7 +5667,7 @@ const create_and_upload_image_to_drive = async function (drive_type, file_path,
|
|
|
5668
5667
|
};
|
|
5669
5668
|
|
|
5670
5669
|
export const create_avatar = async function (req, job_id, headers) {
|
|
5671
|
-
const { docType, uid, url, _id, name, account_type } = req;
|
|
5670
|
+
const { docType, uid, url, _id, name, account_type, metadata } = req;
|
|
5672
5671
|
try {
|
|
5673
5672
|
if (!['account', 'account_profile'].includes(docType)) {
|
|
5674
5673
|
throw new Error('invalid docType value');
|
|
@@ -5686,7 +5685,9 @@ export const create_avatar = async function (req, job_id, headers) {
|
|
|
5686
5685
|
|
|
5687
5686
|
const account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
5688
5687
|
const account_info = account_obj.account_info;
|
|
5689
|
-
|
|
5688
|
+
if (!metadata) {
|
|
5689
|
+
metadata = account_info;
|
|
5690
|
+
}
|
|
5690
5691
|
|
|
5691
5692
|
return await get_profile_avatar(url, uid, null, account_profile_info, account_type, docType, _id, metadata, account_info, name, account_info.email, job_id, headers);
|
|
5692
5693
|
} catch (err) {
|