@xuda.io/ai_module 1.1.4842 → 1.1.4844
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 +20 -13
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5200,12 +5200,19 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
5200
5200
|
let avatar_source = '';
|
|
5201
5201
|
if (prompt) {
|
|
5202
5202
|
const model = 'chatgpt-image-latest';
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5203
|
+
let ai_avatar_response;
|
|
5204
|
+
try {
|
|
5205
|
+
ai_avatar_response = await client.images.edit({
|
|
5206
|
+
model,
|
|
5207
|
+
image: image_blob_ret.image_blob, //base photo
|
|
5208
|
+
prompt,
|
|
5209
|
+
background: 'transparent',
|
|
5210
|
+
});
|
|
5211
|
+
report_ai_status(model);
|
|
5212
|
+
} catch (err) {
|
|
5213
|
+
report_ai_status(model, err);
|
|
5214
|
+
throw err;
|
|
5215
|
+
}
|
|
5209
5216
|
imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
5210
5217
|
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);
|
|
5211
5218
|
} else {
|
|
@@ -5310,15 +5317,15 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
5310
5317
|
model,
|
|
5311
5318
|
image: image_blob_ret.image_blob, //logo
|
|
5312
5319
|
prompt: `
|
|
5313
|
-
|
|
5314
|
-
|
|
5320
|
+
Create a transparent PNG profile image for a business account featuring building branded as ${name}.
|
|
5321
|
+
Display the attached logo clearly as prominent exterior signage.
|
|
5315
5322
|
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5323
|
+
show ${obj?.[business_size] || 'office building'} located in ${country}
|
|
5324
|
+
The building’s architecture and overall atmosphere should reflect the nature of the business,
|
|
5325
|
+
aligning with ${mainCategory} and ${subCategory}.
|
|
5319
5326
|
|
|
5320
|
-
|
|
5321
|
-
|
|
5327
|
+
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.
|
|
5328
|
+
The background should be fully removed, remove trees,clouds,sky or any landscape objects`,
|
|
5322
5329
|
background: 'transparent',
|
|
5323
5330
|
});
|
|
5324
5331
|
report_ai_status(model);
|