import { BaseProvider } from "../BaseProvider.js";
import { DEFAULT_DEEPSEEK_BASE_URL } from "../../constants.js";
import { DeepSeekChat } from "./Chat.js";
import { DeepSeekModels } from "./Models.js";
import { DeepSeekStreaming } from "./Streaming.js";
import { Capabilities } from "./Capabilities.js";
export class DeepSeekProvider extends BaseProvider {
    options;
    baseUrl;
    chatHandler;
    streamingHandler;
    modelsHandler;
    capabilities = {
        supportsVision: (model) => Capabilities.supportsVision(model),
        supportsTools: (model) => Capabilities.supportsTools(model),
        supportsStructuredOutput: (model) => Capabilities.supportsStructuredOutput(model),
        supportsEmbeddings: (model) => Capabilities.supportsEmbeddings(model),
        supportsImageGeneration: (model) => Capabilities.supportsImageGeneration(model),
        supportsTranscription: (model) => Capabilities.supportsTranscription(model),
        supportsModeration: (model) => Capabilities.supportsModeration(model),
        supportsReasoning: (model) => Capabilities.supportsReasoning(model),
        supportsDeveloperRole: (_model) => false,
        getContextWindow: (model) => Capabilities.getContextWindow(model)
    };
    constructor(options) {
        super();
        this.options = options;
        this.baseUrl = options.baseUrl ?? DEFAULT_DEEPSEEK_BASE_URL;
        this.chatHandler = new DeepSeekChat(this.baseUrl, options.apiKey);
        this.streamingHandler = new DeepSeekStreaming(this.baseUrl, options.apiKey);
        this.modelsHandler = new DeepSeekModels(this.baseUrl, options.apiKey);
    }
    apiBase() {
        return this.baseUrl;
    }
    headers() {
        return {
            Authorization: `Bearer ${this.options.apiKey}`,
            "Content-Type": "application/json"
        };
    }
    providerName() {
        return "DeepSeek";
    }
    defaultModel(_feature) {
        return "deepseek-chat";
    }
    async chat(request) {
        return this.chatHandler.execute(request);
    }
    async *stream(request) {
        yield* this.streamingHandler.execute(request);
    }
    async listModels() {
        return this.modelsHandler.execute();
    }
}
