Class GoogleGenAiChatAutoConfiguration
java.lang.Object
org.springframework.ai.model.google.genai.autoconfigure.chat.GoogleGenAiChatAutoConfiguration
@AutoConfiguration
@ConditionalOnClass({com.google.genai.Client.class,GoogleGenAiChatModel.class})
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="google-genai",
matchIfMissing=true)
@EnableConfigurationProperties({GoogleGenAiChatProperties.class,GoogleGenAiConnectionProperties.class})
public class GoogleGenAiChatAutoConfiguration
extends Object
Auto-configuration for Google GenAI Chat.
- Since:
- 1.1.0
- Author:
- Christian Tzolov, Soby Chacko, Mark Pollack, Ilayaperumal Gopinathan, Yanming Zhou, Sebastien Deleuze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable GoogleGenAiCachedContentServicegoogleGenAiChatModel(com.google.genai.Client googleGenAiClient, GoogleGenAiChatProperties chatProperties, ToolCallingManager toolCallingManager, org.springframework.context.ApplicationContext context, org.springframework.beans.factory.ObjectProvider<org.springframework.core.retry.RetryTemplate> retryTemplate, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<ChatModelObservationConvention> observationConvention) com.google.genai.ClientgoogleGenAiClient(GoogleGenAiConnectionProperties properties)
-
Constructor Details
-
GoogleGenAiChatAutoConfiguration
public GoogleGenAiChatAutoConfiguration()
-
-
Method Details
-
googleGenAiClient
@Bean @ConditionalOnMissingBean public com.google.genai.Client googleGenAiClient(GoogleGenAiConnectionProperties properties) throws IOException - Throws:
IOException
-
googleGenAiChatModel
@Bean @ConditionalOnMissingBean public GoogleGenAiChatModel googleGenAiChatModel(com.google.genai.Client googleGenAiClient, GoogleGenAiChatProperties chatProperties, ToolCallingManager toolCallingManager, org.springframework.context.ApplicationContext context, org.springframework.beans.factory.ObjectProvider<org.springframework.core.retry.RetryTemplate> retryTemplate, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<ChatModelObservationConvention> observationConvention) -
googleGenAiCachedContentService
@Bean @ConditionalOnBean(GoogleGenAiChatModel.class) @ConditionalOnMissingBean @Conditional(CachedContentServiceCondition.class) @ConditionalOnProperty(prefix="spring.ai.google.genai.chat", name="enable-cached-content", havingValue="true", matchIfMissing=true) public @Nullable GoogleGenAiCachedContentService googleGenAiCachedContentService(GoogleGenAiChatModel chatModel)
-