@xuda.io/ai_module 1.1.4251 → 1.1.4252

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 +5 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5149,7 +5149,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
5149
5149
  response: output.state._currentStep.output,
5150
5150
  });
5151
5151
 
5152
- record_chat_usage(uid, inputTokens, outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: obj.ai_agent_id, item_id: obj.id });
5152
+ record_chat_usage(uid, inputTokens, outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: obj.ai_agent_id, item_id: obj.id }, account_profile_info);
5153
5153
  // if (!conversation_doc.chat_image && (!conversation_doc.thumbnail_request_ts || Date.now() - conversation_doc.thumbnail_request_ts > 120000)) {
5154
5154
  // update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
5155
5155
  // }
@@ -5775,7 +5775,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5775
5775
  background: 'transparent',
5776
5776
  });
5777
5777
  imageBase64 = ai_avatar_response.data[0].b64_json;
5778
- record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url });
5778
+ record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url }, account_profile_info);
5779
5779
  } else {
5780
5780
  //////////////////
5781
5781
  imageBase64 = Buffer.from(await images[0].image_blob.arrayBuffer()).toString('base64');
@@ -5853,7 +5853,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5853
5853
  The background should be fully removed, remove trees,clouds,sky or any landscape objects`,
5854
5854
  background: 'transparent',
5855
5855
  });
5856
- record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url });
5856
+ record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url }, account_profile_info);
5857
5857
  imageBase64 = ai_avatar_response.data[0].b64_json;
5858
5858
  avatar_source = 'fictional';
5859
5859
  } else {
@@ -5870,7 +5870,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5870
5870
  Context: ${JSON.stringify({ first_name, last_name, bio, country, mainCategory, subCategory })}`,
5871
5871
  background: 'transparent',
5872
5872
  });
5873
- record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url });
5873
+ record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { url }, account_profile_info);
5874
5874
  imageBase64 = ai_avatar_response.data[0].b64_json;
5875
5875
  avatar_source = 'ai profile';
5876
5876
  };
@@ -6324,7 +6324,7 @@ const create_ai_agent_image = async function (req, job_id, headers) {
6324
6324
  background: 'transparent',
6325
6325
  });
6326
6326
  imageBase64 = ai_avatar_response.data[0].b64_json;
6327
- record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'agent avatar', prompt, model, { ai_agent_id });
6327
+ record_chat_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'agent avatar', prompt, model, { ai_agent_id }, account_profile_info);
6328
6328
  console.log('Normalizing final avatar to 1024 with transparent padding...');
6329
6329
  imageBase64 = await normalizeBase64To1024(imageBase64);
6330
6330
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4251",
3
+ "version": "1.1.4252",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",