Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
```typescript title="WASM"
// HTTP client approach for chunking text via the REST API
// Useful in browsers where WASM extraction is called server-side
const text = "This is a long document that needs to be split into semantic chunks.";
const response = await fetch("http://localhost:8000/chunk", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
text,
chunker_type: "text",
config: {
chunking: {
strategy: "semantic",
max_chunk_size: 512,
overlap: 50,
},
},
}),
});
const result = await response.json();
console.log(`Created ${result.chunks?.length ?? 0} chunks`);
result.chunks?.forEach((chunk) => {
console.log(`Chunk: ${chunk.content.substring(0, 50)}...`);
});
```