import { OpenAIProvider } from "../openai/OpenAIProvider.js";
import { DEFAULT_OLLAMA_BASE_URL } from "../../constants.js";
import { OllamaModels } from "./Models.js";
import { OllamaEmbedding } from "./Embedding.js";
import { OllamaCapabilities } from "./Capabilities.js";
export class OllamaProvider extends OpenAIProvider {
    constructor(options = {}) {
        super({
            apiKey: "ollama",
            baseUrl: options.baseUrl || DEFAULT_OLLAMA_BASE_URL
        });
        // Override handlers with Ollama-specific ones
        this.modelsHandler = new OllamaModels(this.baseUrl, this.options.apiKey);
        this.embeddingHandler = new OllamaEmbedding(this.baseUrl, this.options.apiKey);
        // Override capabilities to use OllamaCapabilities
        this.capabilities = {
            supportsVision: (modelId) => OllamaCapabilities.supportsVision(modelId),
            supportsTools: (modelId) => OllamaCapabilities.supportsTools(modelId),
            supportsStructuredOutput: (modelId) => OllamaCapabilities.supportsStructuredOutput(modelId),
            supportsEmbeddings: (modelId) => OllamaCapabilities.supportsEmbeddings(modelId),
            supportsImageGeneration: (modelId) => OllamaCapabilities.supportsImageGeneration(modelId),
            supportsTranscription: (modelId) => OllamaCapabilities.supportsTranscription(modelId),
            supportsModeration: (modelId) => OllamaCapabilities.supportsModeration(modelId),
            supportsReasoning: (modelId) => OllamaCapabilities.supportsReasoning(modelId),
            supportsDeveloperRole: (_modelId) => false,
            supportsPrediction: (_modelId) => false,
            getContextWindow: (modelId) => OllamaCapabilities.getContextWindow(modelId)
        };
    }
    providerName() {
        return "Ollama";
    }
    defaultModel(_feature) {
        return "llama3";
    }
}
