@xuda.io/ai_module 1.1.4369 → 1.1.4371
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 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5674,12 +5674,12 @@ export const create_account_profile_avatar = async function (req, job_id, header
|
|
|
5674
5674
|
}
|
|
5675
5675
|
};
|
|
5676
5676
|
|
|
5677
|
-
export const get_profile_avatar = async function (
|
|
5677
|
+
export const get_profile_avatar = async function (url, uid, prompt, account_profile_info, account_type, docType = 'account', _id, metadata = {}, profile_picture, business_size = 'unknown', name, email, job_id, headers) {
|
|
5678
5678
|
const tempDir = os.tmpdir();
|
|
5679
5679
|
const uniqueId = Date.now() + '_' + Math.random().toString(36).substring(7);
|
|
5680
5680
|
const tempOutputPath = path.join(tempDir, `output_${uniqueId}.png`);
|
|
5681
5681
|
|
|
5682
|
-
const { url, uid, prompt, account_profile_info, account_type, docType = 'account', _id, metadata = {}, profile_picture, business_size = 'unknown', name, email } = req;
|
|
5682
|
+
// const { url, uid, prompt, account_profile_info, account_type, docType = 'account', _id, metadata = {}, profile_picture, business_size = 'unknown', name, email } = req;
|
|
5683
5683
|
|
|
5684
5684
|
// async function normalizeBase64To1024(base64Image) {
|
|
5685
5685
|
// const inputBuffer = Buffer.from(base64Image, 'base64');
|
|
@@ -6883,8 +6883,8 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6883
6883
|
mimetype: `image/png`,
|
|
6884
6884
|
};
|
|
6885
6885
|
|
|
6886
|
-
|
|
6887
|
-
|
|
6886
|
+
let drive_ret = await drive_module.upload_drive_file_user({ uid, path: '/Profile Images' }, job_id, headers, file_obj);
|
|
6887
|
+
drive_ret.profile_picture_source = profile_picture_source;
|
|
6888
6888
|
record_chat_usage(uid, image_response.usage.input_tokens, image_response.usage.output_tokens, 'profile image', prompt, model, { url }, account_profile_info);
|
|
6889
6889
|
|
|
6890
6890
|
return drive_ret;
|