@kreuzberg/node 4.4.5 → 4.4.6
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/README.md +13 -15
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +21 -1
- package/dist/types.d.ts +21 -1
- package/dist/types.js.map +1 -1
- package/index.d.ts +18 -0
- package/index.js +52 -52
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -295,6 +295,9 @@ function normalizeChunkingConfig(chunking) {
|
|
|
295
295
|
setIfDefined(normalized, "preset", chunking.preset);
|
|
296
296
|
setIfDefined(normalized, "embedding", chunking.embedding);
|
|
297
297
|
setIfDefined(normalized, "enabled", chunking.enabled);
|
|
298
|
+
setIfDefined(normalized, "sizingType", chunking.sizingType);
|
|
299
|
+
setIfDefined(normalized, "sizingModel", chunking.sizingModel);
|
|
300
|
+
setIfDefined(normalized, "sizingCacheDir", chunking.sizingCacheDir);
|
|
298
301
|
return normalized;
|
|
299
302
|
}
|
|
300
303
|
function normalizeImageExtractionConfig(images) {
|
|
@@ -521,7 +524,25 @@ function convertChunk(rawChunk) {
|
|
|
521
524
|
// biome-ignore lint/complexity/useLiteralKeys: required for strict TypeScript noPropertyAccessFromIndexSignature
|
|
522
525
|
firstPage: metadata["first_page"] ?? metadata["firstPage"] ?? null,
|
|
523
526
|
// biome-ignore lint/complexity/useLiteralKeys: required for strict TypeScript noPropertyAccessFromIndexSignature
|
|
524
|
-
lastPage: metadata["last_page"] ?? metadata["lastPage"] ?? null
|
|
527
|
+
lastPage: metadata["last_page"] ?? metadata["lastPage"] ?? null,
|
|
528
|
+
// biome-ignore lint/complexity/useLiteralKeys: required for strict TypeScript noPropertyAccessFromIndexSignature
|
|
529
|
+
headingContext: (() => {
|
|
530
|
+
const hc = metadata["heading_context"] ?? metadata["headingContext"];
|
|
531
|
+
if (!hc) return null;
|
|
532
|
+
const headings = hc["headings"];
|
|
533
|
+
if (!Array.isArray(headings)) return null;
|
|
534
|
+
return {
|
|
535
|
+
headings: headings.map((h) => {
|
|
536
|
+
const heading = h;
|
|
537
|
+
return {
|
|
538
|
+
// biome-ignore lint/complexity/useLiteralKeys: required for strict TypeScript noPropertyAccessFromIndexSignature
|
|
539
|
+
level: heading["level"] ?? 0,
|
|
540
|
+
// biome-ignore lint/complexity/useLiteralKeys: required for strict TypeScript noPropertyAccessFromIndexSignature
|
|
541
|
+
text: heading["text"] ?? ""
|
|
542
|
+
};
|
|
543
|
+
})
|
|
544
|
+
};
|
|
545
|
+
})()
|
|
525
546
|
}
|
|
526
547
|
};
|
|
527
548
|
}
|
|
@@ -1124,7 +1145,7 @@ function getEmbeddingPreset(name) {
|
|
|
1124
1145
|
}
|
|
1125
1146
|
|
|
1126
1147
|
// typescript/index.ts
|
|
1127
|
-
var __version__ = "4.4.
|
|
1148
|
+
var __version__ = "4.4.6";
|
|
1128
1149
|
export {
|
|
1129
1150
|
CacheError,
|
|
1130
1151
|
ErrorCode,
|