OpenAILLMAutoConfiguration

@AutoConfiguration
@PropertySource(value = ["classpath:/META-INF/config/koog/openai-llm.properties"])
@EnableConfigurationProperties(value = [OpenAIKoogProperties::class])
class OpenAILLMAutoConfiguration(properties: OpenAIKoogProperties)(source)

Auto-configuration class for setting up OpenAI LLM client and related beans. This class utilizes the properties defined in OpenAIKoogProperties to configure and initialize OpenAI-related components, including the client and executor.

The configuration is conditionally applied if the property ai.koog.openai.api-key is set to true. It reads additional configuration from the properties file located at classpath:/META-INF/config/koog/openai-llm.properties.

Key Features:

Usage Notes:

  • To activate, ensure the ai.koog.openai.api-key property is defined in your application configuration.

  • Customize behavior and settings using the ai.koog.openai.* configuration properties.

See also

Constructors

Link copied to clipboard
constructor(properties: OpenAIKoogProperties)

Functions

Link copied to clipboard
@Bean
@ConditionalOnBean(value = [OpenAILLMClient::class])
fun openAIExecutor(client: OpenAILLMClient): SingleLLMPromptExecutor

Creates and returns a SingleLLMPromptExecutor bean configured with the given OpenAILLMClient. This bean is conditionally initialized only when an OpenAILLMClient bean is present in the application context.

Link copied to clipboard
@Bean
@ConditionalOnProperty(prefix = "ai.koog.openai", name = ["enabled"], havingValue = "true")
fun openAILLMClient(): OpenAILLMClient

Creates an OpenAILLMClient bean configured with application properties.