(input: string)
| 198 | } |
| 199 | |
| 200 | function 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 | |
| 207 | async function embedSingleAdaptive(input: string): Promise<number[]> { |
| 208 | let candidate = input; |
no outgoing calls
no test coverage detected