@xuda.io/ai_module 1.1.4845 → 1.1.4846
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
|
@@ -6287,12 +6287,19 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6287
6287
|
const prompt = `
|
|
6288
6288
|
extract the logo from the image
|
|
6289
6289
|
`;
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6290
|
+
let image_response;
|
|
6291
|
+
try {
|
|
6292
|
+
image_response = await client.images.edit({
|
|
6293
|
+
model,
|
|
6294
|
+
image: image_blob_ret.image_blob,
|
|
6295
|
+
prompt,
|
|
6296
|
+
background: 'transparent',
|
|
6297
|
+
});
|
|
6298
|
+
report_ai_status(model);
|
|
6299
|
+
} catch (err) {
|
|
6300
|
+
report_ai_status(model, err);
|
|
6301
|
+
throw err;
|
|
6302
|
+
}
|
|
6296
6303
|
|
|
6297
6304
|
imageBase64 = await normalizeBase64To1024(image_response.data[0].b64_json, resize);
|
|
6298
6305
|
account_module.record_ai_usage(uid, image_response.usage.input_tokens, image_response.usage.output_tokens, 'profile image', prompt, model, { url }, account_profile_info);
|