(input: LoadOpenAiEmbedderInput)
| 280 | } |
| 281 | |
| 282 | export async function loadOpenAiEmbedder(input: LoadOpenAiEmbedderInput): Promise<Embedder | null> { |
| 283 | const stored = input.keyStore ? await input.keyStore.get().catch(() => null) : null; |
| 284 | const apiKey = stored ?? process.env[EMBEDDINGS_API_KEY_ENV] ?? null; |
| 285 | if (!apiKey) return null; |
| 286 | return createOpenAiEmbedder({ ...input.config, apiKey }, input.options); |
| 287 | } |
no test coverage detected