import { resolveGitHubModelsApiKey } from "../llm/github-models.js";
import { parseBooleanEnv } from "./environment.js";
export function resolveOpenAiUseChatCompletions({ env, configForCli, }) {
    const envValue = parseBooleanEnv(env.OPENAI_USE_CHAT_COMPLETIONS);
    if (envValue !== null)
        return envValue;
    return typeof configForCli?.openai?.useChatCompletions === "boolean"
        ? configForCli.openai.useChatCompletions
        : undefined;
}
export function resolveProviderRuntimeBindings({ env, envState, configForCli, }) {
    return {
        apiKeys: {
            xai: envState.xaiApiKey,
            openai: envState.apiKey,
            google: envState.googleApiKey,
            anthropic: envState.anthropicApiKey,
            zai: envState.zaiApiKey,
            nvidia: envState.nvidiaApiKey,
            minimax: envState.minimaxApiKey,
            "github-copilot": resolveGitHubModelsApiKey(env),
            ollama: null,
        },
        baseUrls: {
            xai: envState.providerBaseUrls.xai,
            openai: envState.providerBaseUrls.openai,
            google: envState.providerBaseUrls.google,
            anthropic: envState.providerBaseUrls.anthropic,
            zai: envState.zaiBaseUrl,
            nvidia: envState.nvidiaBaseUrl,
            minimax: envState.minimaxBaseUrl,
            ollama: envState.ollamaBaseUrl,
        },
        openaiUseChatCompletions: resolveOpenAiUseChatCompletions({ env, configForCli }),
    };
}
//# sourceMappingURL=provider-runtime.js.map