import { logger } from "../utils/logger.js";
export class ChatValidator {
    static validateVision(provider, model, hasBinary, options) {
        if (!hasBinary)
            return;
        if (!options.assumeModelExists &&
            provider.capabilities &&
            !provider.capabilities.supportsVision(model)) {
            throw new Error(`Model ${model} does not support vision/binary files.`);
        }
        if (options.assumeModelExists) {
            logger.warn(`Skipping vision capability validation for model ${model}`);
        }
    }
    static validateTools(provider, model, hasTools, options) {
        if (!hasTools)
            return;
        if (!options.assumeModelExists &&
            provider.capabilities &&
            !provider.capabilities.supportsTools(model)) {
            throw new Error(`Model ${model} does not support tool calling.`);
        }
        if (options.assumeModelExists) {
            logger.warn(`Skipping tool capability validation for model ${model}`);
        }
    }
    static validateStructuredOutput(provider, model, hasSchema, options) {
        if (!hasSchema)
            return;
        if (!options.assumeModelExists &&
            provider.capabilities &&
            !provider.capabilities.supportsStructuredOutput(model)) {
            throw new Error(`Model ${model} does not support structured output.`);
        }
        if (options.assumeModelExists) {
            logger.warn(`Skipping structured output capability validation for model ${model}`);
        }
    }
}
