Class GoogleGenAiChatOptions
java.lang.Object
org.springframework.ai.google.genai.GoogleGenAiChatOptions
- All Implemented Interfaces:
ChatOptions,ModelOptions,StructuredOutputChatOptions,ToolCallingChatOptions
public class GoogleGenAiChatOptions
extends Object
implements ToolCallingChatOptions, StructuredOutputChatOptions
Options for the Google GenAI Chat API.
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Thomas Vitale, Grogdunn, Ilayaperumal Gopinathan, Soby Chacko, Dan Dobrin, Sebastien Deleuze
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGoogleGenAiChatOptions(@Nullable String model, @Nullable Double frequencyPenalty, @Nullable Integer maxOutputTokens, @Nullable Double presencePenalty, @Nullable List<String> stopSequences, @Nullable Double temperature, @Nullable Integer topK, @Nullable Double topP, @Nullable List<ToolCallback> toolCallbacks, @Nullable Map<String, Object> toolContext, @Nullable Integer candidateCount, @Nullable String responseMimeType, @Nullable String responseSchema, @Nullable Integer thinkingBudget, @Nullable Boolean includeThoughts, @Nullable GoogleGenAiThinkingLevel thinkingLevel, @Nullable Boolean includeExtendedUsageMetadata, @Nullable String cachedContentName, @Nullable Boolean useCachedContent, @Nullable Integer autoCacheThreshold, @Nullable Duration autoCacheTtl, @Nullable Boolean googleSearchRetrieval, @Nullable Boolean includeServerSideToolInvocations, @Nullable List<GoogleGenAiSafetySetting> safetySettings, @Nullable Map<String, String> labels, @Nullable GoogleGenAiServiceTier serviceTier) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()A builder to create a newToolCallingChatOptionsinstance.boolean@Nullable Integer@Nullable Duration@Nullable String@Nullable Integer@Nullable DoubleReturns the frequency penalty to use for the chat.@Nullable Boolean@Nullable Boolean@Nullable Boolean@Nullable Boolean@Nullable Integer@Nullable IntegerReturns the maximum number of tokens to use for the chat.getModel()Returns the model to use for the chat.@Nullable String@Nullable DoubleReturns the presence penalty to use for the chat.@Nullable String@Nullable String@Nullable List<GoogleGenAiSafetySetting>@Nullable GoogleGenAiServiceTierReturns the stop sequences to use for the chat.Returns the temperature to use for the chat.@Nullable Integer@Nullable GoogleGenAiThinkingLevel@Nullable List<ToolCallback>ToolCallbacks to be registered with the ChatModel.Get the configured tool context.@Nullable IntegergetTopK()Returns the top K to use for the chat.getTopP()Returns the top P to use for the chat.@Nullable BooleaninthashCode()mutate()Returns a newToolCallingChatOptions.Builderinitialized with the values of thisToolCallingChatOptions.
-
Constructor Details
-
GoogleGenAiChatOptions
protected GoogleGenAiChatOptions(@Nullable String model, @Nullable Double frequencyPenalty, @Nullable Integer maxOutputTokens, @Nullable Double presencePenalty, @Nullable List<String> stopSequences, @Nullable Double temperature, @Nullable Integer topK, @Nullable Double topP, @Nullable List<ToolCallback> toolCallbacks, @Nullable Map<String, Object> toolContext, @Nullable Integer candidateCount, @Nullable String responseMimeType, @Nullable String responseSchema, @Nullable Integer thinkingBudget, @Nullable Boolean includeThoughts, @Nullable GoogleGenAiThinkingLevel thinkingLevel, @Nullable Boolean includeExtendedUsageMetadata, @Nullable String cachedContentName, @Nullable Boolean useCachedContent, @Nullable Integer autoCacheThreshold, @Nullable Duration autoCacheTtl, @Nullable Boolean googleSearchRetrieval, @Nullable Boolean includeServerSideToolInvocations, @Nullable List<GoogleGenAiSafetySetting> safetySettings, @Nullable Map<String, String> labels, @Nullable GoogleGenAiServiceTier serviceTier)
-
-
Method Details
-
builder
Description copied from interface:ToolCallingChatOptionsA builder to create a newToolCallingChatOptionsinstance.- Returns:
- Returns a new
ChatOptions.Builder.
-
getStopSequences
Description copied from interface:ChatOptionsReturns the stop sequences to use for the chat.- Specified by:
getStopSequencesin interfaceChatOptions- Returns:
- the stop sequences to use for the chat
-
getTemperature
Description copied from interface:ChatOptionsReturns the temperature to use for the chat.- Specified by:
getTemperaturein interfaceChatOptions- Returns:
- the temperature to use for the chat
-
getTopP
Description copied from interface:ChatOptionsReturns the top P to use for the chat.- Specified by:
getTopPin interfaceChatOptions- Returns:
- the top P to use for the chat
-
getTopK
Description copied from interface:ChatOptionsReturns the top K to use for the chat.- Specified by:
getTopKin interfaceChatOptions- Returns:
- the top K to use for the chat
-
getCandidateCount
-
getMaxTokens
Description copied from interface:ChatOptionsReturns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokensin interfaceChatOptions- Returns:
- the maximum number of tokens to use for the chat
-
getMaxOutputTokens
-
getModel
Description copied from interface:ChatOptionsReturns the model to use for the chat.- Specified by:
getModelin interfaceChatOptions- Returns:
- the model to use for the chat
-
getResponseMimeType
-
getResponseSchema
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptionsToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacksin interfaceToolCallingChatOptions
-
getFrequencyPenalty
Description copied from interface:ChatOptionsReturns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenaltyin interfaceChatOptions- Returns:
- the frequency penalty to use for the chat
-
getPresencePenalty
Description copied from interface:ChatOptionsReturns the presence penalty to use for the chat.- Specified by:
getPresencePenaltyin interfaceChatOptions- Returns:
- the presence penalty to use for the chat
-
getThinkingBudget
-
getIncludeThoughts
-
getThinkingLevel
-
getIncludeExtendedUsageMetadata
-
getCachedContentName
-
getUseCachedContent
-
getAutoCacheThreshold
-
getAutoCacheTtl
-
getGoogleSearchRetrieval
-
getIncludeServerSideToolInvocations
-
getSafetySettings
-
getLabels
-
getServiceTier
- Since:
- 2.0.0
-
getToolContext
Description copied from interface:ToolCallingChatOptionsGet the configured tool context.- Specified by:
getToolContextin interfaceToolCallingChatOptions- Returns:
- the tool context map.
-
getOutputSchema
- Specified by:
getOutputSchemain interfaceStructuredOutputChatOptions
-
equals
-
hashCode
public int hashCode() -
mutate
Description copied from interface:ToolCallingChatOptionsReturns a newToolCallingChatOptions.Builderinitialized with the values of thisToolCallingChatOptions. Narrows the return type ofChatOptions.mutate()so generic tool calling code can chain methods without casting.- Specified by:
mutatein interfaceChatOptions- Specified by:
mutatein interfaceStructuredOutputChatOptions- Specified by:
mutatein interfaceToolCallingChatOptions
-