/**
 * src/models/deepseek.ts
 * مزود DeepSeek R1 — للتفكير العميق والأسئلة المعقدة
 * OpenAI-compatible API
 */
import { config, MODELS } from '../config.js';
import { callOpenAICompatible, ModelError, } from './provider.js';
const DEEPSEEK_BASE_URL = 'https://api.deepseek.com/v1';
export class DeepSeekProvider {
    name = 'deepseek';
    model = MODELS.reasoning.model;
    async chat(messages, options = {}) {
        const apiKey = config.DEEPSEEK_API_KEY;
        if (!apiKey) {
            throw new ModelError('DeepSeek API key not configured', 503, this.model);
        }
        // DeepSeek R1 doesn't support tools or response_format
        const cleanOptions = {
            temperature: options.temperature ?? 0.6,
            maxTokens: options.maxTokens ?? 4096,
            topP: options.topP,
            stop: options.stop,
        };
        return callOpenAICompatible(DEEPSEEK_BASE_URL, apiKey, this.model, messages, cleanOptions);
    }
}
// Singleton
export const deepseek = new DeepSeekProvider();
//# sourceMappingURL=deepseek.js.map