MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / constructor

Method constructor

packages/baseai/src/utils/memory/chunker.ts:12–21  ·  view source on GitHub ↗
(config: ChunkingConfig)

Source from the content-addressed store, hash-verified

10 protected lengthFunction: (text: string) => number;
11
12 constructor(config: ChunkingConfig) {
13 this.chunkSize = config.chunkMaxLength;
14 this.chunkOverlap = config.chunkOverlap;
15 this.keepSeparator = true;
16 this.lengthFunction = (text: string) => text.length;
17
18 if (this.chunkOverlap >= this.chunkSize) {
19 throw new Error('Cannot have chunkOverlap >= chunkSize');
20 }
21 }
22
23 protected async splitText(text: string): Promise<string[]> {
24 throw new Error('splitText method must be implemented in subclass');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected