MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / shrinkEmbeddingInput

Function shrinkEmbeddingInput

src/core/embeddings.ts:200–205  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

198}
199
200function shrinkEmbeddingInput(input: string): string {
201 if (input.length <= MIN_EMBED_INPUT_CHARS) return input;
202 const nextLength = Math.max(MIN_EMBED_INPUT_CHARS, Math.floor(input.length * SINGLE_INPUT_SHRINK_FACTOR));
203 if (nextLength >= input.length) return input.slice(0, input.length - 1);
204 return input.slice(0, nextLength);
205}
206
207async function embedSingleAdaptive(input: string): Promise<number[]> {
208 let candidate = input;

Callers 1

embedSingleAdaptiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected