@absolutejs/rag 0.10.0 → 0.12.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/dist/index.js CHANGED
@@ -1,5 +1,37 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
2
4
  var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
30
+ if (canCache)
31
+ cache.set(mod, to);
32
+ return to;
33
+ };
34
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
35
  var __returnValue = (v) => v;
4
36
  function __exportSetter(name, newValue) {
5
37
  this[name] = __returnValue.bind(null, newValue);
@@ -13,6 +45,7 @@ var __export = (target, all) => {
13
45
  set: __exportSetter.bind(all, name)
14
46
  });
15
47
  };
48
+ var __require = import.meta.require;
16
49
 
17
50
  // src/quality/quality.ts
18
51
  import { mkdir, readFile } from "fs/promises";
@@ -15251,6 +15284,9 @@ var inferFormatFromName = (value) => {
15251
15284
  };
15252
15285
  var inferFormatFromContentType = (contentType) => {
15253
15286
  const normalizedType = (contentType || "").toLowerCase();
15287
+ if (normalizedType.includes("html")) {
15288
+ return "html";
15289
+ }
15254
15290
  if (normalizedType.includes("xml")) {
15255
15291
  return "xml";
15256
15292
  }
@@ -19963,7 +19999,7 @@ var loadRAGDocumentFromURL = async (input) => {
19963
19999
  contentType: input.contentType ?? response.headers.get("content-type") ?? undefined,
19964
20000
  data,
19965
20001
  extractorRegistry: input.extractorRegistry,
19966
- format: input.format ?? inferFormatFromUrl(url),
20002
+ format: input.format ?? inferFormatFromContentType(input.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
19967
20003
  metadata: input.metadata,
19968
20004
  name: basename(new URL(url).pathname),
19969
20005
  source: input.source ?? url,
@@ -20011,7 +20047,7 @@ var loadRAGDocumentsFromURLs = async (input) => {
20011
20047
  contentType: urlInput.contentType ?? response.headers.get("content-type") ?? undefined,
20012
20048
  data,
20013
20049
  extractorRegistry: urlInput.extractorRegistry ?? input.extractorRegistry,
20014
- format: urlInput.format ?? inferFormatFromUrl(url),
20050
+ format: urlInput.format ?? inferFormatFromContentType(urlInput.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
20015
20051
  metadata: urlInput.metadata,
20016
20052
  name: basename(new URL(url).pathname),
20017
20053
  source: urlInput.source ?? url,
@@ -36929,5 +36965,5 @@ export {
36929
36965
  xaiEmbeddings
36930
36966
  };
36931
36967
 
36932
- //# debugId=2522635E4551C85B64756E2164756E21
36968
+ //# debugId=87B4523169D1586964756E2164756E21
36933
36969
  //# sourceMappingURL=index.js.map