(input: string)
| 247 | } |
| 248 | |
| 249 | function 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 | |
| 259 | function mergeEmbeddingVectors(vectors: number[][], weights: number[]): number[] { |
| 260 | if (vectors.length === 0) throw new Error("Cannot merge empty embedding vectors"); |
nothing calls this directly
no test coverage detected