@xuda.io/ai_module 1.1.4988 → 1.1.4989

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 +5 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2394,7 +2394,7 @@ const upload_agent_files = async function (uid, agent_doc) {
2394
2394
  if (tool.type === 'file_search') {
2395
2395
  if (!_.isEmpty(tool.file)) {
2396
2396
  if (!tool.file.file_id) {
2397
- const validation_ret = drive_ms.file_upload_validator(tool.file.name);
2397
+ const validation_ret = await drive_ms.file_upload_validator(tool.file.name);
2398
2398
  if (!validation_ret.valid) {
2399
2399
  throw new Error(validation_ret.error);
2400
2400
  }
@@ -3297,7 +3297,7 @@ export const upload_prompt_attachment = async function (req, job_id, headers, fi
3297
3297
 
3298
3298
  const file_name = file_obj?.['originalname'];
3299
3299
 
3300
- const validation_ret = drive_ms.file_upload_validator(file_name);
3300
+ const validation_ret = await drive_ms.file_upload_validator(file_name);
3301
3301
 
3302
3302
  if (!validation_ret.valid) {
3303
3303
  throw new Error(validation_ret.error);
@@ -6050,7 +6050,7 @@ export const get_transcript = async function (uid, app_id, conversation_id, acco
6050
6050
  return Buffer.concat(chunks);
6051
6051
  }
6052
6052
 
6053
- const validation_ret = drive_ms.file_upload_validator(filename);
6053
+ const validation_ret = await drive_ms.file_upload_validator(filename);
6054
6054
  if (!validation_ret.valid) {
6055
6055
  throw new Error(validation_ret.error);
6056
6056
  }
@@ -6178,7 +6178,7 @@ const attachment_handler = async function (uid, app_id, conversation_id, attachm
6178
6178
  // return Buffer.concat(chunks);
6179
6179
  // }
6180
6180
 
6181
- // const validation_ret = drive_ms.file_upload_validator(filename);
6181
+ // const validation_ret = await drive_ms.file_upload_validator(filename);
6182
6182
  // if (!validation_ret.valid) {
6183
6183
  // throw new Error(validation_ret.error);
6184
6184
  // }
@@ -6624,7 +6624,7 @@ const save_drive_file_to_disk = async function (drive_file) {
6624
6624
  const tempDir = os.tmpdir();
6625
6625
 
6626
6626
  const tempOutputPath = path.join(tempDir, drive_file.filename + '_' + Date.now());
6627
- const validation_ret = drive_ms.file_upload_validator(drive_file.filename);
6627
+ const validation_ret = await drive_ms.file_upload_validator(drive_file.filename);
6628
6628
 
6629
6629
  // 5. Write the downloaded image to disk
6630
6630
  fs.writeFileSync(tempOutputPath, imageBuffer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4988",
3
+ "version": "1.1.4989",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",