@xuda.io/ai_module 1.1.3615 → 1.1.3617

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 +3 -29
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5758,34 +5758,9 @@ export const create_ai_agent_image = async function (req, job_id, headers) {
5758
5758
  return { is_transparent, image_blob: new Blob([buffer], { type: 'image/png' }) };
5759
5759
  }
5760
5760
 
5761
- const detect_real_person_in_image = async function (base64) {
5762
- const ret = await submit_chat_gpt_prompt({
5763
- model: 'gpt-5-nano',
5764
- prompt: [
5765
- {
5766
- role: 'user',
5767
- content: [
5768
- {
5769
- type: 'input_text',
5770
- text: `detect if a postrate of real person shown in the picture `,
5771
- },
5772
- {
5773
- type: 'input_image',
5774
- image_url: `data:image/png;base64,${base64}`,
5775
- },
5776
- ],
5777
- },
5778
- ],
5779
- response_format: z.object({
5780
- is_real_person_in_picture: z.boolean().describe('if a postrate of real person in the picture return true otherwise return false'),
5781
- }),
5782
- });
5761
+ const { url, app_id, uid, account_obj, ai_agent_id, prompt } = req;
5783
5762
 
5784
- const res = JSON5.parse(ret.data);
5785
- return res?.is_real_person_in_picture;
5786
- };
5787
-
5788
- const { url, uid, account_obj, prompt } = req;
5763
+ const ai_agent_doc = await db_module.get_app_couch_doc_native(app_id, ai_agent_id);
5789
5764
 
5790
5765
  try {
5791
5766
  if (!url) {
@@ -5847,7 +5822,6 @@ export const create_ai_agent_image = async function (req, job_id, headers) {
5847
5822
  background: 'transparent',
5848
5823
  });
5849
5824
  imageBase64 = ai_avatar_response.data[0].b64_json;
5850
- avatar_source = 'ai profile';
5851
5825
  };
5852
5826
 
5853
5827
  await create_avatar_from_pic();
@@ -5870,7 +5844,7 @@ export const create_ai_agent_image = async function (req, job_id, headers) {
5870
5844
  mimetype: `image/${ext}`,
5871
5845
  };
5872
5846
 
5873
- const drive_ret = await drive_module.upload_drive_file_user({ uid, path: '/Profile Images' }, job_id, headers, file_obj);
5847
+ const drive_ret = await drive_module.upload_drive_file_studio({ uid, path: '/Progs Thumbnails' }, job_id, headers, file_obj);
5874
5848
 
5875
5849
  if (drive_ret.code > 0) {
5876
5850
  let db_doc = await db_module.get_couch_doc_native('xuda_accounts', account_obj._id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3615",
3
+ "version": "1.1.3617",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",