@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.
Files changed (2) hide show
  1. package/index.mjs +13 -6
  2. 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
- const image_response = await client.images.edit({
6291
- model,
6292
- image: image_blob_ret.image_blob,
6293
- prompt,
6294
- background: 'transparent',
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4845",
3
+ "version": "1.1.4846",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",