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

Function splitEmbeddingInput

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

Source from the content-addressed store, hash-verified

247}
248
249function splitEmbeddingInput(input: string): string[] {
250 const chunkChars = getEmbedChunkChars();
251 if (input.length <= chunkChars) return [input];
252 const chunks: string[] = [];
253 for (let start = 0; start < input.length; start += chunkChars) {
254 chunks.push(input.slice(start, start + chunkChars));
255 }
256 return chunks;
257}
258
259function mergeEmbeddingVectors(vectors: number[][], weights: number[]): number[] {
260 if (vectors.length === 0) throw new Error("Cannot merge empty embedding vectors");

Callers

nothing calls this directly

Calls 1

getEmbedChunkCharsFunction · 0.85

Tested by

no test coverage detected