MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / capTextForEmbedding

Function capTextForEmbedding

src/context/retrieval.ts:117–119  ·  view source on GitHub ↗
(text: string, maxChars = EMBED_MAX_CHARS)

Source from the content-addressed store, hash-verified

115
116/** Truncate an over-long chunk so it never blows the embedder's context window. Pure. */
117export function capTextForEmbedding(text: string, maxChars = EMBED_MAX_CHARS): string {
118 return text.length > maxChars ? text.slice(0, maxChars) : text;
119}
120
121/**
122 * Embed chunks resiliently: one oversized or otherwise-unembeddable chunk must never

Callers 2

embedChunksResilientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected