@xuda.io/ai_module 1.1.4367 → 1.1.4369
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.
- package/index.mjs +7 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6787,7 +6787,7 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6787
6787
|
.replace(/^_+|_+$/g, ''); // trim leading/trailing underscores
|
|
6788
6788
|
}
|
|
6789
6789
|
|
|
6790
|
-
let prompt, factual_prompt, originalname, factual_image_mode, imageBase64, image_blob_ret, file;
|
|
6790
|
+
let prompt, factual_prompt, originalname, factual_image_mode, imageBase64, image_blob_ret, file, profile_picture_source;
|
|
6791
6791
|
|
|
6792
6792
|
switch (account_type) {
|
|
6793
6793
|
case 'personal': {
|
|
@@ -6828,16 +6828,20 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6828
6828
|
// debugger;
|
|
6829
6829
|
try {
|
|
6830
6830
|
// first attempt
|
|
6831
|
+
|
|
6831
6832
|
let url = await get_url();
|
|
6833
|
+
|
|
6832
6834
|
if (url.substr(0, 8) !== 'https://') {
|
|
6835
|
+
profile_picture_source = 'factual';
|
|
6833
6836
|
// second attempt
|
|
6834
6837
|
url = await get_url();
|
|
6835
6838
|
if (url.substr(0, 8) !== 'https://') {
|
|
6836
6839
|
factual_image_mode = true;
|
|
6840
|
+
profile_picture_source = 'factual';
|
|
6837
6841
|
}
|
|
6838
6842
|
} else {
|
|
6839
6843
|
// success
|
|
6840
|
-
|
|
6844
|
+
profile_picture_source = 'internet search';
|
|
6841
6845
|
try {
|
|
6842
6846
|
image_blob_ret = await get_image_blob_from_downloaded_image(url);
|
|
6843
6847
|
} catch (err) {
|
|
@@ -6845,7 +6849,7 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6845
6849
|
console.error(err);
|
|
6846
6850
|
return '';
|
|
6847
6851
|
}
|
|
6848
|
-
|
|
6852
|
+
profile_picture_source = 'factual';
|
|
6849
6853
|
factual_image_mode = true;
|
|
6850
6854
|
}
|
|
6851
6855
|
}
|