import { initPiAI, getModel, isModelAvailable } from './pi-ai.js';
export class MinimaxLLM {
    model;
    constructor(config) {
        this.model = initPiAI({
            provider: config.provider,
            apiKey: config.apiKey,
            baseUrl: config.baseUrl,
            model: config.model
        });
    }
    async chat(message, context) {
        return this.model.chat(message, context);
    }
    async summarize(text, context) {
        return this.model.summarize(text, context);
    }
    async improveContent(content, requirements, context) {
        return this.model.improveContent(content, requirements, context);
    }
    estimateQuality(original, summary) {
        return this.model.estimateQuality(original, summary);
    }
    async shouldAutoSend(qualityScore, threshold = 0.7) {
        return this.model.shouldAutoSend(qualityScore, threshold);
    }
}
export { initPiAI, getModel, isModelAvailable } from './pi-ai.js';
let minimaxInstance = null;
export function initMinimax(config) {
    minimaxInstance = new MinimaxLLM(config);
    return minimaxInstance;
}
export function getMinimax() {
    if (!minimaxInstance) {
        if (isModelAvailable()) {
            const piModel = getModel();
            minimaxInstance = new MinimaxLLM({});
            minimaxInstance.model = piModel;
            return minimaxInstance;
        }
        throw new Error('Minimax not initialized. Call initMinimax first.');
    }
    return minimaxInstance;
}
