@xuda.io/ai_module 1.1.4746 → 1.1.4748
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 +29 -29
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6122,28 +6122,30 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6122
6122
|
// });
|
|
6123
6123
|
// account_module.record_ai_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { profile_picture }, account_profile_info);
|
|
6124
6124
|
// imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
6125
|
-
if (
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6125
|
+
if (is_user) {
|
|
6126
|
+
} else {
|
|
6127
|
+
if (business_has_person) {
|
|
6128
|
+
imageBase64 = await create_image(
|
|
6129
|
+
uid,
|
|
6130
|
+
`
|
|
6129
6131
|
analyze the the person info : name:${name || ''}, person_nationality: ${person_nationality}
|
|
6130
6132
|
and create realistic fictional profile picture
|
|
6131
6133
|
transparent background ,
|
|
6132
6134
|
person in the center of the picture return only a centered head-and-shoulders portrait facing the camera.
|
|
6133
6135
|
include no labels or text add top margin the person should cover the whole picture
|
|
6134
6136
|
`,
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6137
|
+
model,
|
|
6138
|
+
undefined,
|
|
6139
|
+
1,
|
|
6140
|
+
undefined,
|
|
6141
|
+
undefined,
|
|
6142
|
+
{},
|
|
6143
|
+
account_profile_info,
|
|
6144
|
+
);
|
|
6145
|
+
} else {
|
|
6146
|
+
imageBase64 = await create_image(
|
|
6147
|
+
uid,
|
|
6148
|
+
`
|
|
6147
6149
|
Create a transparent PNG profile image show realistic ${obj?.[business_size]} without labels or signs.
|
|
6148
6150
|
The building’s architecture, materials, and overall atmosphere must reflect the business nature,
|
|
6149
6151
|
aligned with ${mainCategory} and ${subCategory}.
|
|
@@ -6151,16 +6153,17 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6151
6153
|
Do not include trees, clouds, sky, landscape, or any environmental elements.
|
|
6152
6154
|
Only the building should be visible on a fully transparent background.
|
|
6153
6155
|
`,
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6156
|
+
model,
|
|
6157
|
+
undefined,
|
|
6158
|
+
1,
|
|
6159
|
+
undefined,
|
|
6160
|
+
undefined,
|
|
6161
|
+
{},
|
|
6162
|
+
account_profile_info,
|
|
6163
|
+
);
|
|
6164
|
+
}
|
|
6165
|
+
avatar_source = 'fictional';
|
|
6162
6166
|
}
|
|
6163
|
-
avatar_source = 'fictional';
|
|
6164
6167
|
} else {
|
|
6165
6168
|
/// PERSONAL
|
|
6166
6169
|
const create_avatar_from_pic = async function () {
|
|
@@ -6364,10 +6367,7 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
|
|
|
6364
6367
|
metadata = account_info;
|
|
6365
6368
|
}
|
|
6366
6369
|
|
|
6367
|
-
|
|
6368
|
-
// const ret = await get_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj, account_profile_info }, job_id, headers);
|
|
6369
|
-
// return ret;
|
|
6370
|
-
|
|
6370
|
+
metadata.is_user = true;
|
|
6371
6371
|
return await get_profile_avatar(url, uid, prompt, account_profile_info, account_type, docType, _id, metadata, account_info, name, account_info.email, job_id, headers);
|
|
6372
6372
|
} catch (err) {
|
|
6373
6373
|
return { code: -111, data: err.message };
|