@xuda.io/ai_module 1.1.4358 → 1.1.4359

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 +45 -12
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5679,7 +5679,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5679
5679
  const uniqueId = Date.now() + '_' + Math.random().toString(36).substring(7);
5680
5680
  const tempOutputPath = path.join(tempDir, `output_${uniqueId}.png`);
5681
5681
 
5682
- const { url, uid, account_obj, prompt, is_profile_avatar, account_profile_info, docType = 'account', _id, metadata = {} } = req;
5682
+ const { url, uid, account_obj, prompt, is_profile_avatar, account_profile_info, docType = 'account', _id, metadata = {}, profile_picture, business_size = 'unknown' } = req;
5683
5683
 
5684
5684
  // async function normalizeBase64To1024(base64Image) {
5685
5685
  // const inputBuffer = Buffer.from(base64Image, 'base64');
@@ -5780,9 +5780,9 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5780
5780
 
5781
5781
  // const drive_module = await import(`${module_path}/drive_module/index.mjs`);
5782
5782
 
5783
- if (!is_profile_avatar) {
5784
- await update_profile_avatar_status(account_obj._id, 2);
5785
- }
5783
+ // if (!is_profile_avatar) {
5784
+ // await update_profile_avatar_status(account_obj._id, 2);
5785
+ // }
5786
5786
  try {
5787
5787
  // if (!url) {
5788
5788
  // throw new Error('No URL provided in request');
@@ -5843,7 +5843,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5843
5843
  imageBase64 = Buffer.from(await image_blob_ret.image_blob.arrayBuffer()).toString('base64');
5844
5844
  if (account_obj.account_info.account_type === 'business') {
5845
5845
  // create avatar from logo - BUSINESS
5846
- const { bio, business_name, country, mainCategory, subCategory } = account_obj.account_info;
5846
+ const { bio, business_name, country, mainCategory, subCategory, membership_plan } = metadata;
5847
5847
  // const ai_avatar_response = await client.images.edit({
5848
5848
  // model: 'chatgpt-image-latest',
5849
5849
  // image: image_blob_ret.image_blob, // only one image allowed
@@ -5864,11 +5864,44 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5864
5864
  // });
5865
5865
  /////////////////
5866
5866
 
5867
+ // const obj = {
5868
+ // free: {
5869
+ // building_size: 'small single-story office building',
5870
+ // employees: 'Empty exterior with no people or employees visible',
5871
+ // },
5872
+ // pro: {
5873
+ // building_size: 'small low-rise single-story office building',
5874
+ // employees: 'One professional employee from ${country} (with ethnic features typical of ${country}) standing prominently in the foreground in front of the building entrance',
5875
+ // },
5876
+ // team: {
5877
+ // building_size: 'medium-sized building',
5878
+ // employees:
5879
+ // 'A small group of five diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5880
+ // },
5881
+ // agency: {
5882
+ // building_size: 'medium-sized building',
5883
+ // employees: 'A group of ten diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5884
+ // },
5885
+
5886
+ // enterprise_t1: {
5887
+ // building_size: 'large modern multi-story office building',
5888
+ // employees:
5889
+ // 'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5890
+ // },
5891
+ // enterprise_t2: {
5892
+ // building_size: 'large modern hight tower multi-story office building',
5893
+ // employees:
5894
+ // 'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5895
+ // },
5896
+ // enterprise_t3: {
5897
+ // building_size: 'large modern hight tower multi-story office building',
5898
+ // employees:
5899
+ // 'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5900
+ // },
5901
+ // };
5867
5902
  const obj = {
5868
- free: {
5869
- building_size: 'small single-story office building',
5870
- employees: 'Empty exterior with no people or employees visible',
5871
- },
5903
+ unknown: 'small single-story office building',
5904
+
5872
5905
  pro: {
5873
5906
  building_size: 'small low-rise single-story office building',
5874
5907
  employees: 'One professional employee from ${country} (with ethnic features typical of ${country}) standing prominently in the foreground in front of the building entrance',
@@ -5889,12 +5922,12 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5889
5922
  'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5890
5923
  },
5891
5924
  enterprise_t2: {
5892
- building_size: 'large modern multi-story office building',
5925
+ building_size: 'large modern hight tower multi-story office building',
5893
5926
  employees:
5894
5927
  'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5895
5928
  },
5896
5929
  enterprise_t3: {
5897
- building_size: 'large modern multi-story office building',
5930
+ building_size: 'large modern hight tower multi-story office building',
5898
5931
  employees:
5899
5932
  'A large group of thirty diverse professional employees, all appearing to be from ${country} (with ethnic features, skin tones, and facial characteristics typical of ${country}), men and women in business attire, standing together smiling in the foreground in front of the building',
5900
5933
  },
@@ -5906,7 +5939,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
5906
5939
  prompt: `
5907
5940
  Create a transparent PNG profile image for a business account featuring building branded as ${business_name}.
5908
5941
  Display the attached logo clearly as prominent exterior signage.
5909
- Show ${obj?.[account_obj.membership_plan]?.employees || obj.free.employees} in front of the building/premises.
5942
+ Show ${obj?.[membership_plan]?.employees || obj.free.employees} in front of the building/premises.
5910
5943
  show ${obj?.[account_obj.membership_plan]?.building_size || obj.free.building_size}
5911
5944
  The building’s architecture and overall atmosphere should reflect the nature of the business,
5912
5945
  aligning with ${mainCategory} and ${subCategory}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4358",
3
+ "version": "1.1.4359",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",