Class OpenAiResponsesChatAutoConfiguration
java.lang.Object
org.springframework.ai.model.openai.autoconfigure.OpenAiResponsesChatAutoConfiguration
@AutoConfiguration(after=OpenAiChatAutoConfiguration.class)
@EnableConfigurationProperties({OpenAiCommonProperties.class,OpenAiResponsesChatProperties.class})
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="openai",
matchIfMissing=true)
public class OpenAiResponsesChatAutoConfiguration
extends Object
Chat
Auto-configuration for the OpenAI Responses API.
OpenAI is the default chat provider, and ChatClient auto-configuration needs
exactly one ChatModel bean, so the two OpenAI endpoints are mutually exclusive
rather than both configured: set spring.ai.openai.chat.api=responses to get
this one instead of OpenAiChatAutoConfiguration's. Applications that genuinely
want both - say Chat Completions for cheap classification and Responses for an agent -
declare the second one with its builder.
- Since:
- 2.1.0
- Author:
- Dimitar Proynov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionopenAiResponsesChatModel(OpenAiCommonProperties commonProperties, OpenAiResponsesChatProperties responsesProperties, ToolCallingManager toolCallingManager, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistry, org.springframework.beans.factory.ObjectProvider<ChatModelObservationConvention> observationConvention, org.springframework.beans.factory.ObjectProvider<OpenAiHttpClientBuilderCustomizer> httpClientBuilderCustomizers)
-
Constructor Details
-
OpenAiResponsesChatAutoConfiguration
public OpenAiResponsesChatAutoConfiguration()
-
-
Method Details
-
openAiResponsesChatModel
@Bean @ConditionalOnMissingBean @ConditionalOnProperty(name="spring.ai.openai.chat.api", havingValue="responses") public OpenAiResponsesChatModel openAiResponsesChatModel(OpenAiCommonProperties commonProperties, OpenAiResponsesChatProperties responsesProperties, ToolCallingManager toolCallingManager, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistry, org.springframework.beans.factory.ObjectProvider<ChatModelObservationConvention> observationConvention, org.springframework.beans.factory.ObjectProvider<OpenAiHttpClientBuilderCustomizer> httpClientBuilderCustomizers)
-