/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import OpenAI from 'openai'; import type { Config } from '../../../config/config.js'; import type { ContentGeneratorConfig } from '../../contentGenerator.js'; import type { OpenAICompatibleProvider } from './types.js'; /** * Provider for Ollama (both Cloud and Local) * * Ollama Cloud: https://ollama.com/v1 (requires API key from ollama.com/settings/keys) * Ollama Local: http://localhost:11434/v1 (no auth required, use placeholder 'ollama') * * For WSL/remote setups, set OLLAMA_HOST env var (e.g., host.docker.internal:11434) */ export declare class OllamaOpenAICompatibleProvider implements OpenAICompatibleProvider { protected contentGeneratorConfig: ContentGeneratorConfig; protected cliConfig: Config; constructor(contentGeneratorConfig: ContentGeneratorConfig, cliConfig: Config); /** * Check if this config is for Ollama (Cloud or Local) */ static isOllamaProvider(config: ContentGeneratorConfig): boolean; /** * Check if this is Ollama Cloud (vs Local) */ isCloud(): boolean; buildHeaders(): Record; buildClient(): OpenAI; buildRequest(request: OpenAI.Chat.ChatCompletionCreateParams, _userPromptId: string): OpenAI.Chat.ChatCompletionCreateParams; /** * Check if Ollama server is running and accessible */ checkHealth(): Promise<{ healthy: boolean; version?: string; error?: string; }>; /** * Check if a specific model is available on the Ollama server */ isModelAvailable(model: string): Promise<{ available: boolean; error?: string; }>; /** * Pull a model from Ollama registry */ pullModel(model: string): Promise<{ success: boolean; error?: string; }>; /** * Validate Ollama credentials. * For Cloud: validates API key with models endpoint. * For Local: verifies server is running with version endpoint. */ validateCredentials(): Promise; }