KoogAutoConfiguration

@AutoConfiguration
@EnableConfigurationProperties(value = [KoogProperties::class])
class KoogAutoConfiguration(source)

KoogAutoConfiguration is a Spring Boot auto-configuration class that configures and provides beans for various LLM (Large Language Model) provider clients. It ensures that the beans are only created if the corresponding properties are defined in the application's configuration.

This configuration includes support for Anthropic, Google, Ollama, OpenAI, and OpenRouter providers. Each provider is configured with specific settings and logic encapsulated within a SingleLLMPromptExecutor instance backed by a respective client implementation.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog", name = ["anthropic.api-key"])
fun anthropicExecutor(properties: KoogProperties): SingleLLMPromptExecutor

Creates and configures a SingleLLMPromptExecutor using an AnthropicLLMClient. This is conditioned on the presence of an API key in the application properties.

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog", name = ["google.api-key"])
fun googleExecutor(properties: KoogProperties): SingleLLMPromptExecutor

Provides a SingleLLMPromptExecutor bean configured with a GoogleLLMClient using the settings from the given KoogProperties. The bean is only created if the google.api-key property is set.

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog", name = ["ollama"])
fun ollamaExecutor(properties: KoogProperties): SingleLLMPromptExecutor

Creates and configures a SingleLLMPromptExecutor instance using Ollama properties.

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog", name = ["openai.api-key"])
fun openAIExecutor(properties: KoogProperties): SingleLLMPromptExecutor

Provides a bean of type SingleLLMPromptExecutor configured for OpenAI interaction. The bean will only be instantiated if the property ai.koog.openai.api-key is defined in the application properties.

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog", name = ["openrouter.api-key"])
fun openRouterExecutor(properties: KoogProperties): SingleLLMPromptExecutor

Creates a SingleLLMPromptExecutor bean configured to use the OpenRouter LLM client.