@xuda.io/ai_module 1.1.4840 → 1.1.4841

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
@@ -5377,13 +5377,20 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
5377
5377
  // const { first_name, last_name, bio, country, mainCategory, subCategory } = account_obj.account_info;
5378
5378
  // const model = 'gpt-image-1-mini';
5379
5379
  const model = 'chatgpt-image-latest';
5380
- const ai_avatar_response = await client.images.edit({
5381
- model,
5382
- image: image_blob_ret.image_blob,
5380
+ let ai_avatar_response;
5381
+ try {
5382
+ ai_avatar_response = await client.images.edit({
5383
+ model,
5384
+ image: image_blob_ret.image_blob,
5383
5385
 
5384
- prompt,
5385
- background: 'transparent',
5386
- });
5386
+ prompt,
5387
+ background: 'transparent',
5388
+ });
5389
+ report_ai_status(model);
5390
+ } catch (err) {
5391
+ report_ai_status(model, err);
5392
+ throw err;
5393
+ }
5387
5394
  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);
5388
5395
  imageBase64 = ai_avatar_response.data[0].b64_json;
5389
5396
  avatar_source = 'ai profile';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4840",
3
+ "version": "1.1.4841",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",