@xuda.io/ai_module 1.1.4552 → 1.1.4554

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 +0 -49
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6114,47 +6114,6 @@ const create_ai_agent_image = async function (req, job_id, headers) {
6114
6114
  let url = account_doc.account_info.profile_avatar;
6115
6115
 
6116
6116
  try {
6117
- // if (!url) {
6118
- // throw new Error('No URL provided in request');
6119
- // }
6120
-
6121
- // // 3. Download the image to a Buffer
6122
- // const res = await fetch(url);
6123
- // if (!res.ok) {
6124
- // throw new Error(`Failed to fetch image URL: ${res.status} ${res.statusText}`);
6125
- // }
6126
-
6127
- // const arrayBuffer = await res.arrayBuffer();
6128
- // const imageBuffer = Buffer.from(arrayBuffer);
6129
-
6130
- // const tempDir = os.tmpdir();
6131
- // const uniqueId = Date.now() + '_' + Math.random().toString(36).substring(7);
6132
-
6133
- // const inputExt = path.extname(url) || '.jpg';
6134
- // const tempInputPath = path.join(tempDir, `input_${uniqueId}${inputExt}`);
6135
- // const tempOutputPath = path.join(tempDir, `output_${uniqueId}.png`); // Output is always PNG (transparent)
6136
-
6137
- // 5. Write the downloaded image to disk
6138
- // fs.writeFileSync(tempInputPath, imageBuffer);
6139
- /////////////////////////////////
6140
-
6141
- // const imageFiles = [tempInputPath];
6142
-
6143
- // const images = await Promise.all(
6144
- // imageFiles.map(async (filePath) => {
6145
- // const img_ret = await imageToPngBlob(filePath);
6146
- // const blob = img_ret.image_blob;
6147
-
6148
- // // OpenAI expects a filename for logging/debugging
6149
- // const filename = path.basename(filePath, path.extname(filePath)) + '.png';
6150
- // blob.name = filename; // Optional but helpful
6151
- // // @ts-ignore – name is allowed in Node 20+
6152
- // blob.lastModified = Date.now();
6153
-
6154
- // return { is_transparent: img_ret.is_transparent, image_blob: blob };
6155
- // }),
6156
- // );
6157
-
6158
6117
  let imageBase64;
6159
6118
  const image_blob_ret = await get_image_blob_from_downloaded_image(url);
6160
6119
  //////////////////
@@ -6211,14 +6170,6 @@ const create_ai_agent_image = async function (req, job_id, headers) {
6211
6170
  const drive_ret = await drive_module.upload_drive_file_studio({ uid, app_id, path: '/Progs Thumbnails' }, job_id, headers, file_obj);
6212
6171
 
6213
6172
  if (drive_ret.code > 0) {
6214
- // let db_doc = await db_module.get_app_couch_doc_native(app_id, ai_agent_id);
6215
- // db_doc.studio_meta.thumbnail_request_ts = Date.now();
6216
- // db_doc.studio_meta.agent_image = drive_ret.data;
6217
-
6218
- // const save_ret = await db_module.save_app_couch_doc_native(app_id, db_doc);
6219
- // console.log(save_ret);
6220
-
6221
- // return save_ret;
6222
6173
  return drive_ret;
6223
6174
  } else {
6224
6175
  throw new Error(drive_ret.data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4552",
3
+ "version": "1.1.4554",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",