@xuda.io/ai_module 1.1.4695 → 1.1.4696
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 +23 -19
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6867,30 +6867,34 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6867
6867
|
// debugger;
|
|
6868
6868
|
try {
|
|
6869
6869
|
// first attempt
|
|
6870
|
+
if (account_type === 'business') {
|
|
6871
|
+
let url = await get_url();
|
|
6870
6872
|
|
|
6871
|
-
let url = await get_url();
|
|
6872
|
-
|
|
6873
|
-
if (url.substr(0, 8) !== 'https://') {
|
|
6874
|
-
profile_picture_source = 'factual';
|
|
6875
|
-
// second attempt
|
|
6876
|
-
url = await get_url();
|
|
6877
6873
|
if (url.substr(0, 8) !== 'https://') {
|
|
6878
|
-
factual_image_mode = true;
|
|
6879
6874
|
profile_picture_source = 'factual';
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
}
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6875
|
+
// second attempt
|
|
6876
|
+
url = await get_url();
|
|
6877
|
+
if (url.substr(0, 8) !== 'https://') {
|
|
6878
|
+
factual_image_mode = true;
|
|
6879
|
+
profile_picture_source = 'factual';
|
|
6880
|
+
}
|
|
6881
|
+
} else {
|
|
6882
|
+
// success
|
|
6883
|
+
profile_picture_source = 'internet search';
|
|
6884
|
+
try {
|
|
6885
|
+
image_blob_ret = await get_image_blob_from_downloaded_image(url);
|
|
6886
|
+
} catch (err) {
|
|
6887
|
+
if (!err.message.includes('Failed to fetch image URL')) {
|
|
6888
|
+
console.error(err);
|
|
6889
|
+
return '';
|
|
6890
|
+
}
|
|
6891
|
+
profile_picture_source = 'factual';
|
|
6892
|
+
factual_image_mode = true;
|
|
6890
6893
|
}
|
|
6891
|
-
profile_picture_source = 'factual';
|
|
6892
|
-
factual_image_mode = true;
|
|
6893
6894
|
}
|
|
6895
|
+
} else {
|
|
6896
|
+
factual_image_mode = true;
|
|
6897
|
+
profile_picture_source = 'factual';
|
|
6894
6898
|
}
|
|
6895
6899
|
if (factual_image_mode) {
|
|
6896
6900
|
imageBase64 = await create_image(uid, factual_prompt, undefined, undefined, 1, undefined, undefined, {}, account_profile_info);
|