@llamaindex/cloud
Advanced tools
Comparing version 0.2.9 to 0.2.10
{ | ||
"name": "@llamaindex/cloud", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { FileReader, Document } from '@llamaindex/core/schema'; | ||
import { getEnv, fs } from '@llamaindex/env'; | ||
import { getEnv, fs, path } from '@llamaindex/env'; | ||
import { filetypeinfo } from 'magic-bytes.js'; | ||
@@ -711,9 +711,3 @@ import { ParsingService } from '../../api/dist/index.js'; | ||
async getImagePath(downloadPath, jobId, imageName) { | ||
// Get the full path | ||
let imagePath = `${downloadPath}/${jobId}-${imageName}`; | ||
// Get a valid image path | ||
if (!imagePath.endsWith(".png") && !imagePath.endsWith(".jpg")) { | ||
imagePath += ".png"; | ||
} | ||
return imagePath; | ||
return path.join(downloadPath, `${jobId}-${imageName}`); | ||
} | ||
@@ -731,6 +725,5 @@ async fetchAndSaveImage(imageName, imagePath, jobId) { | ||
} | ||
const arrayBuffer = await response.data; | ||
const buffer = new Uint8Array(arrayBuffer); | ||
const blob = await response.data; | ||
// Write the image buffer to the specified imagePath | ||
await fs.writeFile(imagePath, buffer); | ||
await fs.writeFile(imagePath, new Uint8Array(await blob.arrayBuffer())); | ||
} | ||
@@ -737,0 +730,0 @@ // Filters out invalid values (null, undefined, empty string) of specific params. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
2307831
58105