()
| 185 | * unset or set to an unsupported model. |
| 186 | */ |
| 187 | export function getConfiguredEmbeddingModel(): string { |
| 188 | const configured = env.KB_EMBEDDING_MODEL |
| 189 | if (configured && SUPPORTED_EMBEDDING_MODELS[configured]) { |
| 190 | return configured |
| 191 | } |
| 192 | if (configured) { |
| 193 | logger.warn( |
| 194 | `KB_EMBEDDING_MODEL="${configured}" is not a supported embedding model — falling back to ${DEFAULT_EMBEDDING_MODEL}` |
| 195 | ) |
| 196 | } |
| 197 | return DEFAULT_EMBEDDING_MODEL |
| 198 | } |
| 199 | |
| 200 | async function resolveProvider( |
| 201 | embeddingModel: string, |
no test coverage detected