Class OpenAiAutoConfiguration

java.lang.Object
org.springframework.ai.autoconfigure.openai.OpenAiAutoConfiguration

@AutoConfiguration(after={org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration.class,SpringAiRetryAutoConfiguration.class}) @ConditionalOnClass(OpenAiApi.class) @EnableConfigurationProperties({OpenAiConnectionProperties.class,OpenAiChatProperties.class,OpenAiEmbeddingProperties.class,OpenAiImageProperties.class,OpenAiAudioTranscriptionProperties.class}) public class OpenAiAutoConfiguration extends Object
Author:
Christian Tzolov
  • Constructor Details

    • OpenAiAutoConfiguration

      public OpenAiAutoConfiguration()
  • Method Details

    • openAiChatClient

      @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="spring.ai.openai.chat", name="enabled", havingValue="true", matchIfMissing=true) public OpenAiChatClient openAiChatClient(OpenAiConnectionProperties commonProperties, OpenAiChatProperties chatProperties, org.springframework.web.client.RestClient.Builder restClientBuilder, List<FunctionCallback> toolFunctionCallbacks, FunctionCallbackContext functionCallbackContext, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
    • openAiEmbeddingClient

      @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="spring.ai.openai.embedding", name="enabled", havingValue="true", matchIfMissing=true) public OpenAiEmbeddingClient openAiEmbeddingClient(OpenAiConnectionProperties commonProperties, OpenAiEmbeddingProperties embeddingProperties, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
    • openAiImageClient

      @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="spring.ai.openai.image", name="enabled", havingValue="true", matchIfMissing=true) public OpenAiImageClient openAiImageClient(OpenAiConnectionProperties commonProperties, OpenAiImageProperties imageProperties, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
    • openAiAudioTranscriptionClient

      @Bean @ConditionalOnMissingBean public OpenAiAudioTranscriptionClient openAiAudioTranscriptionClient(OpenAiConnectionProperties commonProperties, OpenAiAudioTranscriptionProperties transcriptionProperties, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
    • springAiFunctionManager

      @Bean @ConditionalOnMissingBean public FunctionCallbackContext springAiFunctionManager(org.springframework.context.ApplicationContext context)