mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
fec4008696
* fix: preserve ai reasoning content * fix: avoid text-only reasoning replay * feat: add deepseek ai eval models
20 lines
534 B
TypeScript
20 lines
534 B
TypeScript
import type { FrontendEvalModelConfig } from "../core/models";
|
|
|
|
export function getFrontendApiKey(
|
|
provider: FrontendEvalModelConfig["provider"],
|
|
): string {
|
|
const envName =
|
|
provider === "anthropic"
|
|
? "ANTHROPIC_API_KEY"
|
|
: provider === "googleai"
|
|
? "GEMINI_API_KEY"
|
|
: provider === "deepseek"
|
|
? "DEEPSEEK_API_KEY"
|
|
: "OPENAI_API_KEY";
|
|
const apiKey = process.env[envName];
|
|
if (!apiKey) {
|
|
throw new Error(`${envName} is required for frontend evals`);
|
|
}
|
|
return apiKey;
|
|
}
|