/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import type { ContentGenerator, ContentGeneratorConfig } from '../contentGenerator.js'; import type { Config } from '../../config/config.js'; import type { CountTokensParameters, CountTokensResponse, EmbedContentParameters, EmbedContentResponse, GenerateContentParameters, GenerateContentResponse } from '@google/genai'; /** * Content generator for Ollama Cloud API * Uses native Ollama API format (/api/chat) instead of OpenAI-compatible format */ export declare class OllamaContentGenerator implements ContentGenerator { private config; private baseUrl; constructor(config: ContentGeneratorConfig, _cliConfig: Config); /** * Check if this is Ollama Cloud (requires auth) */ private isCloud; /** * Build headers for Ollama API requests */ private buildHeaders; /** * Extract text content from a ContentUnion */ private extractTextFromContentUnion; /** * Extract text content from parts */ private extractTextFromParts; /** * Check if a part is a function call */ private isFunctionCall; /** * Check if a part is a function response */ private isFunctionResponse; /** * Convert GenerateContentParameters to Ollama format */ private convertToOllamaRequest; /** * Convert Ollama response to GenerateContentResponse format */ private convertFromOllamaResponse; /** * Generate content using Ollama API */ generateContent(request: GenerateContentParameters, _userPromptId: string): Promise; /** * Generate content stream using Ollama API */ generateContentStream(request: GenerateContentParameters, _userPromptId: string): Promise>; /** * Count tokens - Ollama doesn't have a direct token counting API, * so we estimate based on character count */ countTokens(_request: CountTokensParameters): Promise; /** * Embed content - Use Ollama's embedding API if available */ embedContent(_request: EmbedContentParameters): Promise; } /** * Create an Ollama content generator */ export declare function createOllamaContentGenerator(config: ContentGeneratorConfig, cliConfig: Config): ContentGenerator;