Class GoogleGenAiChatAutoConfiguration
java.lang.Object
org.springframework.ai.model.google.genai.autoconfigure.chat.GoogleGenAiChatAutoConfiguration
@AutoConfiguration(after={org.springframework.ai.retry.autoconfigure.SpringAiRetryAutoConfiguration.class,org.springframework.ai.model.tool.autoconfigure.ToolCallingAutoConfiguration.class})
@ConditionalOnClass({com.google.genai.Client.class,org.springframework.ai.google.genai.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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ai.google.genai.cache.GoogleGenAiCachedContentServicegoogleGenAiCachedContentService(org.springframework.ai.google.genai.GoogleGenAiChatModel chatModel) org.springframework.ai.google.genai.GoogleGenAiChatModelgoogleGenAiChatModel(com.google.genai.Client googleGenAiClient, GoogleGenAiChatProperties chatProperties, org.springframework.ai.model.tool.ToolCallingManager toolCallingManager, org.springframework.context.ApplicationContext context, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<org.springframework.ai.chat.observation.ChatModelObservationConvention> observationConvention, org.springframework.beans.factory.ObjectProvider<org.springframework.ai.model.tool.ToolExecutionEligibilityPredicate> toolExecutionEligibilityPredicate) com.google.genai.ClientgoogleGenAiClient(GoogleGenAiConnectionProperties connectionProperties)
-
Constructor Details
-
GoogleGenAiChatAutoConfiguration
public GoogleGenAiChatAutoConfiguration()
-
-
Method Details
-
googleGenAiClient
@Bean @ConditionalOnMissingBean public com.google.genai.Client googleGenAiClient(GoogleGenAiConnectionProperties connectionProperties) throws IOException - Throws:
IOException
-
googleGenAiChatModel
@Bean @ConditionalOnMissingBean public org.springframework.ai.google.genai.GoogleGenAiChatModel googleGenAiChatModel(com.google.genai.Client googleGenAiClient, GoogleGenAiChatProperties chatProperties, org.springframework.ai.model.tool.ToolCallingManager toolCallingManager, org.springframework.context.ApplicationContext context, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.beans.factory.ObjectProvider<io.micrometer.observation.ObservationRegistry> observationRegistry, org.springframework.beans.factory.ObjectProvider<org.springframework.ai.chat.observation.ChatModelObservationConvention> observationConvention, org.springframework.beans.factory.ObjectProvider<org.springframework.ai.model.tool.ToolExecutionEligibilityPredicate> toolExecutionEligibilityPredicate) -
googleGenAiCachedContentService
@Bean @ConditionalOnBean(org.springframework.ai.google.genai.GoogleGenAiChatModel.class) @ConditionalOnMissingBean @Conditional(CachedContentServiceCondition.class) @ConditionalOnProperty(prefix="spring.ai.google.genai.chat", name="enable-cached-content", havingValue="true", matchIfMissing=true) public org.springframework.ai.google.genai.cache.GoogleGenAiCachedContentService googleGenAiCachedContentService(org.springframework.ai.google.genai.GoogleGenAiChatModel chatModel)
-