(text: string, maxChars = EMBED_MAX_CHARS)
| 115 | |
| 116 | /** Truncate an over-long chunk so it never blows the embedder's context window. Pure. */ |
| 117 | export 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 |
no outgoing calls
no test coverage detected