MCPcopy Index your code
hub / github.com/simstudioai/sim / constructor

Method constructor

apps/sim/lib/chunkers/recursive-chunker.ts:60–71  ·  view source on GitHub ↗
(options: RecursiveChunkerOptions = {})

Source from the content-addressed store, hash-verified

58 private readonly separators: string[]
59
60 constructor(options: RecursiveChunkerOptions = {}) {
61 const resolved = resolveChunkerOptions(options)
62 this.chunkSize = resolved.chunkSize
63 this.chunkOverlap = resolved.chunkOverlap
64
65 if (options.separators && options.separators.length > 0) {
66 this.separators = options.separators
67 } else {
68 const recipe = options.recipe ?? 'plain'
69 this.separators = [...RECIPES[recipe]]
70 }
71 }
72
73 private splitRecursively(text: string, separatorIndex = 0): string[] {
74 const tokenCount = estimateTokens(text)

Callers

nothing calls this directly

Calls 1

resolveChunkerOptionsFunction · 0.90

Tested by

no test coverage detected