Package org.springframework.ai.mistralai
Class MistralAiChatOptions
java.lang.Object
org.springframework.ai.mistralai.MistralAiChatOptions
- All Implemented Interfaces:
ChatOptions,ModelOptions,ToolCallingChatOptions
Options for the Mistral AI Chat API.
- Since:
- 0.8.1
- Author:
- Ricken Bazolo, Christian Tzolov, Thomas Vitale, Alexandros Pappas, Jason Smith
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
DEFAULT_TOOL_EXECUTION_ENABLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MistralAiChatOptions.Builderbuilder()A builder to create a newToolCallingChatOptionsinstance.copy()Returns a copy of thisChatOptions.booleanstatic MistralAiChatOptionsfromOptions(MistralAiChatOptions fromOptions) Returns the frequency penalty to use for the chat.Whether theChatModelis 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.getN()Returns the presence penalty to use for the chat.getStop()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.getTools()getTopK()Returns the top K to use for the chat.getTopP()Returns the top P to use for the chat.inthashCode()voidsetFrequencyPenalty(Double frequencyPenalty) voidsetInternalToolExecutionEnabled(Boolean internalToolExecutionEnabled) Set whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.voidsetMaxTokens(Integer maxTokens) voidvoidvoidsetPresencePenalty(Double presencePenalty) voidsetRandomSeed(Integer randomSeed) voidsetResponseFormat(MistralAiApi.ChatCompletionRequest.ResponseFormat responseFormat) voidsetSafePrompt(Boolean safePrompt) voidvoidsetStopSequences(List<String> stopSequences) voidsetTemperature(Double temperature) voidsetToolCallbacks(List<ToolCallback> toolCallbacks) Set the ToolCallbacks to be registered with the ChatModel.voidvoidsetToolContext(Map<String, Object> toolContext) Set the tool context values as map.voidsetToolNames(Set<String> toolNames) Set the names of the tools to register with the ChatModel.voidsetTools(List<MistralAiApi.FunctionTool> tools) void
-
Constructor Details
-
MistralAiChatOptions
public MistralAiChatOptions()
-
-
Method Details
-
builder
Description copied from interface:ToolCallingChatOptionsA builder to create a newToolCallingChatOptionsinstance.- Returns:
- Returns a new
ChatOptions.Builder.
-
fromOptions
-
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
-
setModel
-
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
-
setMaxTokens
-
getSafePrompt
-
setSafePrompt
-
getRandomSeed
-
setRandomSeed
-
getResponseFormat
-
setResponseFormat
-
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
-
setStopSequences
-
getStop
-
setStop
-
getTools
-
setTools
-
getToolChoice
-
setToolChoice
-
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
-
setTemperature
-
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
-
setTopP
-
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
-
setFrequencyPenalty
-
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
-
setPresencePenalty
-
getN
-
setN
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptionsToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacksin interfaceToolCallingChatOptions
-
setToolCallbacks
Description copied from interface:ToolCallingChatOptionsSet the ToolCallbacks to be registered with the ChatModel.- Specified by:
setToolCallbacksin interfaceToolCallingChatOptions
-
getToolNames
Description copied from interface:ToolCallingChatOptionsNames of the tools to register with the ChatModel.- Specified by:
getToolNamesin interfaceToolCallingChatOptions
-
setToolNames
Description copied from interface:ToolCallingChatOptionsSet the names of the tools to register with the ChatModel.- Specified by:
setToolNamesin interfaceToolCallingChatOptions
-
getInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptionsWhether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
getInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptionsSet whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
setInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
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
-
getToolContext
Description copied from interface:ToolCallingChatOptionsGet the configured tool context.- Specified by:
getToolContextin interfaceToolCallingChatOptions- Returns:
- the tool context map.
-
setToolContext
Description copied from interface:ToolCallingChatOptionsSet the tool context values as map.- Specified by:
setToolContextin interfaceToolCallingChatOptions- Parameters:
toolContext- as map
-
copy
Description copied from interface:ChatOptionsReturns a copy of thisChatOptions.- Specified by:
copyin interfaceChatOptions- Returns:
- a copy of this
ChatOptions
-
hashCode
public int hashCode() -
equals
-