OllamaClient
constructor(httpClient: KoogHttpClient, clock: KoogClock = KoogClock.System, contextWindowStrategy: ContextWindowStrategy = ContextWindowStrategy.Companion.None, toolDescriptorConverter: ToolDescriptorSchemaGenerator = OllamaToolDescriptorSchemaGenerator())(source)
Parameters
httpClient
A preconfigured Koog HTTP client used for API calls. Must have the Ollama base URL and timeouts already embedded. To create a client with standard defaults, use the secondary constructor that accepts a base URL and a KoogHttpClient.Factory.
clock
Clock instance used for tracking response metadata timestamps.
contextWindowStrategy
The ContextWindowStrategy to use for computing context window lengths. Defaults to ContextWindowStrategy.None.
toolDescriptorConverter
Generates JSON schemas for tool descriptors sent to the model.
constructor(httpClientFactory: KoogHttpClient.Factory, baseUrl: String = DEFAULT_BASE_URL, headers: Map<String, String> = emptyMap(), queryParameters: Map<String, String> = emptyMap(), timeoutConfig: ConnectionTimeoutConfig = ConnectionTimeoutConfig(), clock: KoogClock = KoogClock.System, contextWindowStrategy: ContextWindowStrategy = ContextWindowStrategy.Companion.None, toolDescriptorConverter: ToolDescriptorSchemaGenerator = OllamaToolDescriptorSchemaGenerator())(source)
Secondary constructor that builds the underlying KoogHttpClient from a KoogHttpClient.Factory.