export function resolveProviderModelCandidates(candidates) {
    let provider;
    let model;
    for (const candidate of candidates) {
        if (provider === undefined && candidate.provider !== undefined) {
            provider = candidate.provider;
        }
        if (model === undefined && candidate.model !== undefined) {
            model = candidate.model;
        }
        if (provider !== undefined && model !== undefined) {
            break;
        }
    }
    return { provider, model };
}
export function resolveModelFromCandidates(candidates, resolvedProvider) {
    for (const candidate of candidates) {
        const { model, provider } = candidate;
        if (model === undefined) {
            continue;
        }
        if (provider !== undefined && provider !== resolvedProvider) {
            continue;
        }
        return model;
    }
    return undefined;
}
//# sourceMappingURL=provider-resolution.js.map