This commit is contained in:
15
docs/snippets/wasm/utils/chunking.md
Normal file
15
docs/snippets/wasm/utils/chunking.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```typescript title="WASM"
|
||||
import init, { extractFile } from "kreuzberg-wasm";
|
||||
|
||||
await init();
|
||||
|
||||
const config = {
|
||||
chunking: {
|
||||
maxChars: 1500,
|
||||
chunkOverlap: 200,
|
||||
},
|
||||
};
|
||||
|
||||
const result = await extractFile("document.pdf", undefined, config);
|
||||
console.log(`Chunks created: ${result.chunks?.length ?? 0}`);
|
||||
```
|
||||
Reference in New Issue
Block a user