@xuda.io/ai_module 1.1.4841 → 1.1.4842
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 +13 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5304,10 +5304,12 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
5304
5304
|
if (is_user) {
|
|
5305
5305
|
if (business_has_person) {
|
|
5306
5306
|
} else {
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5307
|
+
let ai_avatar_response;
|
|
5308
|
+
try {
|
|
5309
|
+
ai_avatar_response = await client.images.edit({
|
|
5310
|
+
model,
|
|
5311
|
+
image: image_blob_ret.image_blob, //logo
|
|
5312
|
+
prompt: `
|
|
5311
5313
|
Create a transparent PNG profile image for a business account featuring building branded as ${name}.
|
|
5312
5314
|
Display the attached logo clearly as prominent exterior signage.
|
|
5313
5315
|
|
|
@@ -5317,8 +5319,13 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
5317
5319
|
|
|
5318
5320
|
Use the provided bio (${bio}) to understand the company’s focus and personality, and adapt the architectural style to match the ${country} country’s local design language. Select an appropriate building type for the specific business category, and present a contemporary, creative office environment with a strong, recognizable brand identity.
|
|
5319
5321
|
The background should be fully removed, remove trees,clouds,sky or any landscape objects`,
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
+
background: 'transparent',
|
|
5323
|
+
});
|
|
5324
|
+
report_ai_status(model);
|
|
5325
|
+
} catch (err) {
|
|
5326
|
+
report_ai_status(model, err);
|
|
5327
|
+
throw err;
|
|
5328
|
+
}
|
|
5322
5329
|
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);
|
|
5323
5330
|
imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
5324
5331
|
}
|