@xuda.io/ai_module 1.1.4347 → 1.1.4349

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 +23 -22
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5291,16 +5291,16 @@ setTimeout(async () => {
5291
5291
  // });
5292
5292
 
5293
5293
  // ret = await get_profile_image(uid, 'business', 'ioshka media', {}, account_profile_info);
5294
- ret = await get_profile_image(
5295
- uid,
5296
- 'personal',
5297
- 'Glenn Willett',
5298
- {
5299
- email: 'glennwillett@schoolsponsoringregionzft.com',
5300
- body: 'We have a couple middle and elementary schools a few minutes from you in Boca Raton that have available sponsorship slots. The parents would see your sponsorship in the student progress reports each week.Is it okay if I send over the available spots?',
5301
- },
5302
- account_profile_info,
5303
- );
5294
+ // ret = await get_profile_image(
5295
+ // uid,
5296
+ // 'personal',
5297
+ // 'Glenn Willett',
5298
+ // {
5299
+ // email: 'glennwillett@schoolsponsoringregionzft.com',
5300
+ // body: 'We have a couple middle and elementary schools a few minutes from you in Boca Raton that have available sponsorship slots. The parents would see your sponsorship in the student progress reports each week.Is it okay if I send over the available spots?',
5301
+ // },
5302
+ // account_profile_info,
5303
+ // );
5304
5304
 
5305
5305
  console.log(ret);
5306
5306
  }, 1000);
@@ -6784,24 +6784,25 @@ const get_profile_image = async function (uid, account_type = 'business', name,
6784
6784
 
6785
6785
  debugger;
6786
6786
  try {
6787
+ // first attempt
6787
6788
  let url = await get_url();
6788
- if (!url.includes('https://')) {
6789
+ if (!url.substr(0, 7, 'https://')) {
6790
+ // second attempt
6789
6791
  url = await get_url();
6790
- } // throw new Error('not valid url');
6791
- let file;
6792
- try {
6793
- file = await get_image_blob_from_downloaded_image(url);
6794
- } catch (err) {
6795
- if (!err.message.includes('Failed to fetch image URL')) {
6796
- console.error(err);
6797
- return '';
6792
+ if (!url.substr(0, 7, 'https://')) {
6793
+ factual_image_mode = true;
6798
6794
  }
6799
-
6795
+ } else {
6796
+ // success
6797
+ let file;
6800
6798
  try {
6801
- url = await get_url();
6802
6799
  file = await get_image_blob_from_downloaded_image(url);
6803
6800
  } catch (err) {
6804
- // create factual image
6801
+ if (!err.message.includes('Failed to fetch image URL')) {
6802
+ console.error(err);
6803
+ return '';
6804
+ }
6805
+
6805
6806
  factual_image_mode = true;
6806
6807
  }
6807
6808
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4347",
3
+ "version": "1.1.4349",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",