@opengeni/documents 0.8.6 → 0.8.14-canary.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/documents",
3
- "version": "0.8.6",
3
+ "version": "0.8.14-canary.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,11 +39,11 @@
39
39
  "prepublishOnly": "bash ../../scripts/prepublish-guard"
40
40
  },
41
41
  "dependencies": {
42
- "@llamaindex/liteparse": "^1.5.3",
43
- "@opengeni/config": "^0.22.0",
44
- "@opengeni/contracts": "^2.7.0",
45
- "@opengeni/db": "^3.6.0",
46
- "@opengeni/storage": "^0.2.110",
42
+ "@llamaindex/liteparse": "2.14.2",
43
+ "@opengeni/config": "^0.22.5-canary.1",
44
+ "@opengeni/contracts": "^2.9.2-canary.1",
45
+ "@opengeni/db": "^3.7.4-canary.0",
46
+ "@opengeni/storage": "^0.2.115-canary.1",
47
47
  "drizzle-orm": "^0.45.2",
48
48
  "openai": "6.47.0"
49
49
  }
package/src/index.ts CHANGED
@@ -331,8 +331,8 @@ export class LiteParseDocumentParser implements DocumentParser {
331
331
  private async parseWithLiteParse(bytes: Uint8Array): Promise<string> {
332
332
  return await this.enqueueParse(async () => {
333
333
  const { LiteParse } = await import("@llamaindex/liteparse");
334
- const parser = new LiteParse({ ocrEnabled: true, numWorkers: 1 });
335
- const result = await parser.parse(Buffer.from(bytes), true);
334
+ const parser = new LiteParse({ ocrEnabled: true, numWorkers: 1, quiet: true });
335
+ const result = await parser.parse(Buffer.from(bytes));
336
336
  const text = typeof result?.text === "string" ? result.text : "";
337
337
  return text.replace(/\0/g, " ").trim();
338
338
  });
@@ -4168,13 +4168,17 @@ function validateEmbedding(values: number[], dimensions: number, model: string):
4168
4168
  }
4169
4169
 
4170
4170
  function isTextLike(file: FileAsset): boolean {
4171
- const contentType = file.contentType.toLowerCase();
4171
+ const contentType = file.contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
4172
4172
  const filename = file.filename.toLowerCase();
4173
4173
  return (
4174
4174
  contentType.startsWith("text/") ||
4175
4175
  contentType === "application/json" ||
4176
4176
  contentType === "application/xml" ||
4177
4177
  contentType === "application/x-yaml" ||
4178
+ contentType === "application/yaml" ||
4179
+ contentType === "message/rfc822" ||
4180
+ filename.endsWith(".txt") ||
4181
+ filename.endsWith(".log") ||
4178
4182
  filename.endsWith(".md") ||
4179
4183
  filename.endsWith(".markdown") ||
4180
4184
  filename.endsWith(".json") ||
@@ -4182,7 +4186,10 @@ function isTextLike(file: FileAsset): boolean {
4182
4186
  filename.endsWith(".yml") ||
4183
4187
  filename.endsWith(".csv") ||
4184
4188
  filename.endsWith(".tsv") ||
4185
- filename.endsWith(".xml")
4189
+ filename.endsWith(".xml") ||
4190
+ filename.endsWith(".html") ||
4191
+ filename.endsWith(".htm") ||
4192
+ filename.endsWith(".eml")
4186
4193
  );
4187
4194
  }
4188
4195