@xuda.io/ai_module 1.1.4152 → 1.1.4154
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 +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5511,6 +5511,7 @@ const create_and_upload_image_to_drive = async function (drive_type, file_path,
|
|
|
5511
5511
|
export const create_account_profile_avatar = async function (req, job_id, headers) {
|
|
5512
5512
|
const { uid } = req;
|
|
5513
5513
|
try {
|
|
5514
|
+
req.account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
5514
5515
|
req.is_profile_avatar = true;
|
|
5515
5516
|
req.account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
5516
5517
|
|
|
@@ -5614,6 +5615,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
|
|
|
5614
5615
|
is_real_person_in_picture: z.boolean().describe('if a postrate of real person in the picture return true otherwise return false'),
|
|
5615
5616
|
}),
|
|
5616
5617
|
metadata: { account_id: account_obj._id, func: 'detect_real_person_in_image' },
|
|
5618
|
+
account_profile_info,
|
|
5617
5619
|
});
|
|
5618
5620
|
|
|
5619
5621
|
const res = JSON5.parse(ret.data);
|
|
@@ -5621,7 +5623,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
|
|
|
5621
5623
|
};
|
|
5622
5624
|
|
|
5623
5625
|
// const drive_module = await import(`${module_path}/drive_module/index.mjs`);
|
|
5624
|
-
const { url, uid, account_obj, prompt, is_profile_avatar } = req;
|
|
5626
|
+
const { url, uid, account_obj, prompt, is_profile_avatar, account_profile_info } = req;
|
|
5625
5627
|
if (!is_profile_avatar) {
|
|
5626
5628
|
await update_profile_avatar_status(account_obj._id, 2);
|
|
5627
5629
|
}
|
|
@@ -5854,7 +5856,7 @@ export const create_profile_avatar = async function (req, job_id, headers) {
|
|
|
5854
5856
|
};
|
|
5855
5857
|
|
|
5856
5858
|
export const conversation_actions = async function (req, job_id, headers) {
|
|
5857
|
-
const { conversation_id, item_id, action, uid } = req;
|
|
5859
|
+
const { conversation_id, item_id, action, uid, account_profile_info } = req;
|
|
5858
5860
|
try {
|
|
5859
5861
|
if (!conversation_id || conversation_id === 'undefined') {
|
|
5860
5862
|
throw new Error('conversation_id is missing or invalid:' + conversation_id);
|
|
@@ -5972,7 +5974,7 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
|
|
|
5972
5974
|
}
|
|
5973
5975
|
|
|
5974
5976
|
let account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
5975
|
-
const ret = await create_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj }, job_id, headers);
|
|
5977
|
+
const ret = await create_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj, account_profile_info }, job_id, headers);
|
|
5976
5978
|
return ret;
|
|
5977
5979
|
} catch (err) {
|
|
5978
5980
|
return { code: -111, data: err.message };
|