(input: string[], signal: AbortSignal)
| 104 | } |
| 105 | |
| 106 | async function callOllamaEmbed(input: string[], signal: AbortSignal): Promise<number[][]> { |
| 107 | const client = await getOllamaClient(); |
| 108 | const options = getEmbedRuntimeOptions(); |
| 109 | const request: Record<string, unknown> = { model: EMBED_MODEL, input, signal }; |
| 110 | if (options) request.options = options; |
| 111 | const response = await client.embed(request); |
| 112 | return response.embeddings; |
| 113 | } |
| 114 | |
| 115 | async function callOpenAIEmbed(input: string[], signal: AbortSignal): Promise<number[][]> { |
| 116 | const url = `${OPENAI_BASE_URL.replace(/\/+$/, "")}/embeddings`; |
no test coverage detected