@xuda.io/ai_module 1.1.3841 → 1.1.3842

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 +3 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5759,12 +5759,12 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
5759
5759
  imageBase64 = ai_avatar_response.data[0].b64_json;
5760
5760
  avatar_source = 'fictional';
5761
5761
  } else {
5762
- debugger;
5763
5762
  /// PERSONAL
5764
5763
  const create_avatar_from_pic = async function () {
5765
5764
  const { first_name, last_name, bio, country, mainCategory, subCategory } = account_obj.account_info;
5765
+ const model = 'chatgpt-image-latest';
5766
5766
  const ai_avatar_response = await client.images.edit({
5767
- model: 'chatgpt-image-latest',
5767
+ model,
5768
5768
  image: images[0].image_blob,
5769
5769
 
5770
5770
  prompt: `Completely remove the background, enhance and color-correct the subject, and return only a centered head-and-shoulders portrait facing the camera. Add extra top margin, include no labels or text, and export the result as a clean transparent PNG.
@@ -5772,6 +5772,7 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
5772
5772
  Context: ${JSON.stringify({ first_name, last_name, bio, country, mainCategory, subCategory })}`,
5773
5773
  background: 'transparent',
5774
5774
  });
5775
+ record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model);
5775
5776
  imageBase64 = ai_avatar_response.data[0].b64_json;
5776
5777
  avatar_source = 'ai profile';
5777
5778
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3841",
3
+ "version": "1.1.3842",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",