import { resolvePiSideCallModel } from "../../../model-provider.js";
export function resolvePiModel(config, options = {}) {
    return resolvePiSideCallModel(config, options);
}
export function normalizeOpenAICompatibleBaseUrl(baseUrl) {
    const trimmed = baseUrl.trim().replace(/\/+$/, "");
    return trimmed.endsWith("/v1") ? trimmed : `${trimmed}/v1`;
}
export function getPiApiKey(config, provider) {
    const resolved = resolvePiModel(config);
    if (resolved.model.provider !== provider) {
        throw new Error(`No Pi API key resolved for provider ${provider}`);
    }
    return resolved.apiKey;
}
//# sourceMappingURL=model.js.map