Class VertexAiGeminiChatOptions
java.lang.Object
org.springframework.ai.vertexai.gemini.VertexAiGeminiChatOptions
- All Implemented Interfaces:
ChatOptions
,ModelOptions
,ToolCallingChatOptions
Options for the Vertex AI Gemini Chat API.
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Thomas Vitale, Grogdunn, Ilayaperumal Gopinathan, Soby Chacko
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
-
Field Summary
Fields inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
DEFAULT_TOOL_EXECUTION_ENABLED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
A builder to create a newToolCallingChatOptions
instance.copy()
Returns a copy of thisChatOptions
.boolean
static VertexAiGeminiChatOptions
fromOptions
(VertexAiGeminiChatOptions fromOptions) Returns the frequency penalty to use for the chat.Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.Returns the maximum number of tokens to use for the chat.getModel()
Returns the model to use for the chat.Returns the presence penalty to use for the chat.Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.ToolCallbacks to be registered with the ChatModel.Get the configured tool context.Names of the tools to register with the ChatModel.getTopK()
Returns the top K to use for the chat.getTopP()
Returns the top P to use for the chat.int
hashCode()
void
setCandidateCount
(Integer candidateCount) void
setFrequencyPenalty
(Double frequencyPenalty) void
setGoogleSearchRetrieval
(Boolean googleSearchRetrieval) void
setInternalToolExecutionEnabled
(Boolean internalToolExecutionEnabled) Set whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.void
setMaxOutputTokens
(Integer maxOutputTokens) void
setMaxTokens
(Integer maxTokens) void
void
setPresencePenalty
(Double presencePenalty) void
setResponseMimeType
(String mimeType) void
setSafetySettings
(List<VertexAiGeminiSafetySetting> safetySettings) void
setStopSequences
(List<String> stopSequences) void
setTemperature
(Double temperature) void
setToolCallbacks
(List<ToolCallback> toolCallbacks) Set the ToolCallbacks to be registered with the ChatModel.void
setToolContext
(Map<String, Object> toolContext) Set the tool context values as map.void
setToolNames
(Set<String> toolNames) Set the names of the tools to register with the ChatModel.void
void
toString()
-
Constructor Details
-
VertexAiGeminiChatOptions
public VertexAiGeminiChatOptions()
-
-
Method Details
-
builder
Description copied from interface:ToolCallingChatOptions
A builder to create a newToolCallingChatOptions
instance.- Returns:
- Returns a new
ChatOptions.Builder
.
-
fromOptions
-
getStopSequences
Description copied from interface:ChatOptions
Returns the stop sequences to use for the chat.- Specified by:
getStopSequences
in interfaceChatOptions
- Returns:
- the stop sequences to use for the chat
-
setStopSequences
-
getTemperature
Description copied from interface:ChatOptions
Returns the temperature to use for the chat.- Specified by:
getTemperature
in interfaceChatOptions
- Returns:
- the temperature to use for the chat
-
setTemperature
-
getTopP
Description copied from interface:ChatOptions
Returns the top P to use for the chat.- Specified by:
getTopP
in interfaceChatOptions
- Returns:
- the top P to use for the chat
-
setTopP
-
getTopK
Description copied from interface:ChatOptions
Returns the top K to use for the chat.- Specified by:
getTopK
in interfaceChatOptions
- Returns:
- the top K to use for the chat
-
setTopK
-
getCandidateCount
-
setCandidateCount
-
getMaxTokens
Description copied from interface:ChatOptions
Returns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokens
in interfaceChatOptions
- Returns:
- the maximum number of tokens to use for the chat
-
setMaxTokens
-
getMaxOutputTokens
-
setMaxOutputTokens
-
getModel
Description copied from interface:ChatOptions
Returns the model to use for the chat.- Specified by:
getModel
in interfaceChatOptions
- Returns:
- the model to use for the chat
-
setModel
-
getResponseMimeType
-
setResponseMimeType
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptions
ToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacks
in interfaceToolCallingChatOptions
-
setToolCallbacks
Description copied from interface:ToolCallingChatOptions
Set the ToolCallbacks to be registered with the ChatModel.- Specified by:
setToolCallbacks
in interfaceToolCallingChatOptions
-
getToolNames
Description copied from interface:ToolCallingChatOptions
Names of the tools to register with the ChatModel.- Specified by:
getToolNames
in interfaceToolCallingChatOptions
-
setToolNames
Description copied from interface:ToolCallingChatOptions
Set the names of the tools to register with the ChatModel.- Specified by:
setToolNames
in interfaceToolCallingChatOptions
-
getInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptions
Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
getInternalToolExecutionEnabled
in interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptions
Set whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
setInternalToolExecutionEnabled
in interfaceToolCallingChatOptions
-
getFrequencyPenalty
Description copied from interface:ChatOptions
Returns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenalty
in interfaceChatOptions
- Returns:
- the frequency penalty to use for the chat
-
getPresencePenalty
Description copied from interface:ChatOptions
Returns the presence penalty to use for the chat.- Specified by:
getPresencePenalty
in interfaceChatOptions
- Returns:
- the presence penalty to use for the chat
-
setFrequencyPenalty
-
setPresencePenalty
-
getGoogleSearchRetrieval
-
setGoogleSearchRetrieval
-
getSafetySettings
-
setSafetySettings
-
getToolContext
Description copied from interface:ToolCallingChatOptions
Get the configured tool context.- Specified by:
getToolContext
in interfaceToolCallingChatOptions
- Returns:
- the tool context map.
-
setToolContext
Description copied from interface:ToolCallingChatOptions
Set the tool context values as map.- Specified by:
setToolContext
in interfaceToolCallingChatOptions
- Parameters:
toolContext
- as map
-
equals
-
hashCode
public int hashCode() -
toString
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-