Package-level declarations

Types

Link copied to clipboard

Represents a strategy for computing the context window length for OllamaClient. Different implementations define specific approaches to computing the context window length. Based on the context window length computed by this strategy, Ollama will truncate the context window accordingly.

Link copied to clipboard
class OllamaClient @JvmOverloads constructor(httpClient: KoogHttpClient, clock: KoogClock = KoogClock.System, contextWindowStrategy: ContextWindowStrategy = ContextWindowStrategy.Companion.None, toolDescriptorConverter: ToolDescriptorSchemaGenerator = OllamaToolDescriptorSchemaGenerator()) : LLMClient

Client for interacting with the Ollama API with comprehensive model support.

Link copied to clipboard

Custom converters for specific Ollama models.

Link copied to clipboard

Represents metadata and configuration details about an Ollama model card. This class contains descriptive properties about the model, such as its name, family of models it belongs to, capabilities it supports, and specific technical attributes like parameter count and size.

Link copied to clipboard

Represents a collection of predefined Large Language Models (LLM) categorized by makers. Each maker contains specific models with configurations such as unique identifiers and capabilities.

Link copied to clipboard
class OllamaParams(temperature: Double? = null, maxTokens: Int? = null, numberOfChoices: Int? = null, speculation: String? = null, schema: LLMParams.Schema? = null, toolChoice: LLMParams.ToolChoice? = null, user: String? = null, additionalProperties: Map<String, JsonElement>? = null, val think: Boolean? = null) : LLMParams

Represents the parameters for configuring an Ollama Chat interaction with an LLM.

Properties

Link copied to clipboard

Returns the model name without any associated tags. This property extracts and provides a clean version of the name property from the OllamaModelCard by removing any tags or additional decorations.

Functions

Link copied to clipboard
fun List<OllamaModelCard>.findBestSuitedModels(family: String? = null, maxSize: Long? = null, minParameterCount: Long? = null, minContextLength: Long? = null, minEmbeddingLength: Long? = null, requiredCapabilities: List<LLMCapability>? = null): List<OllamaModelCard>

Filters a list of model cards by the given criteria.

Link copied to clipboard

Finds a model card by name.

Link copied to clipboard
fun OllamaClient(baseUrl: String = OllamaClient.DEFAULT_BASE_URL, headers: Map<String, String> = emptyMap(), queryParameters: Map<String, String> = emptyMap(), timeoutConfig: ERROR CLASS: Symbol not found for ConnectionTimeoutConfig = ConnectionTimeoutConfig(), clock: ERROR CLASS: Symbol not found for KoogClock = KoogClock.System, contextWindowStrategy: ContextWindowStrategy = ContextWindowStrategy.Companion.None, toolDescriptorConverter: ERROR CLASS: Symbol not found for ToolDescriptorSchemaGenerator = OllamaToolDescriptorSchemaGenerator()): OllamaClient

JVM convenience for constructing OllamaClient without an explicit ai.koog.http.client.KoogHttpClient.Factory: the default factory is resolved at call time from HttpClientFactoryResolver.

Link copied to clipboard

Converts an instance of OllamaModelCard to an LLModel representation.