Package org.springframework.ai.mistralai
Class MistralAiChatOptions
java.lang.Object
org.springframework.ai.mistralai.MistralAiChatOptions
- All Implemented Interfaces:
ChatOptions
,FunctionCallingOptions
,ModelOptions
Options for the Mistral AI Chat API.
- Since:
- 0.8.1
- Author:
- Ricken Bazolo, Christian Tzolov, Thomas Vitale
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MistralAiChatOptions.Builder
builder()
copy()
Returns a copy of thisChatOptions
.boolean
static MistralAiChatOptions
fromOptions
(MistralAiChatOptions fromOptions) Returns the frequency penalty to use for the chat.Function Callbacks to be registered with the ChatModel.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.getStop()
Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.getTools()
getTopK()
Returns the top K to use for the chat.getTopP()
Returns the top P to use for the chat.int
hashCode()
void
setFunctionCallbacks
(List<FunctionCallback> functionCallbacks) Set the Function Callbacks to be registered with the ChatModel.void
setFunctions
(Set<String> functions) Set the list of function names from the ChatModel registry to be used in the next chat completion requests.void
setMaxTokens
(Integer maxTokens) void
void
setProxyToolCalls
(Boolean proxyToolCalls) void
setRandomSeed
(Integer randomSeed) void
setResponseFormat
(MistralAiApi.ChatCompletionRequest.ResponseFormat responseFormat) void
setSafePrompt
(Boolean safePrompt) void
void
setStopSequences
(List<String> stopSequences) void
setTemperature
(Double temperature) void
void
setToolContext
(Map<String, Object> toolContext) void
setTools
(List<MistralAiApi.FunctionTool> tools) void
-
Constructor Details
-
MistralAiChatOptions
public MistralAiChatOptions()
-
-
Method Details
-
builder
- Returns:
- Returns FunctionCallingOptionsBuilder to create a new instance of FunctionCallingOptions.
-
fromOptions
-
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
-
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
-
getSafePrompt
-
setSafePrompt
-
getRandomSeed
-
setRandomSeed
-
getResponseFormat
-
setResponseFormat
-
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
-
getStop
-
setStop
-
getTools
-
setTools
-
getToolChoice
-
setToolChoice
-
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
-
getFunctionCallbacks
Description copied from interface:FunctionCallingOptions
Function Callbacks to be registered with the ChatModel. For Prompt Options the functionCallbacks are automatically enabled for the duration of the prompt execution. For Default Options the FunctionCallbacks are registered but disabled by default. You have to use "functions" property to list the function names from the ChatModel registry to be used in the chat completion requests.- Specified by:
getFunctionCallbacks
in interfaceFunctionCallingOptions
- Returns:
- Return the Function Callbacks to be registered with the ChatModel.
-
setFunctionCallbacks
Description copied from interface:FunctionCallingOptions
Set the Function Callbacks to be registered with the ChatModel.- Specified by:
setFunctionCallbacks
in interfaceFunctionCallingOptions
- Parameters:
functionCallbacks
- the Function Callbacks to be registered with the ChatModel.
-
getFunctions
- Specified by:
getFunctions
in interfaceFunctionCallingOptions
- Returns:
Set
of function names from the ChatModel registry to be used in the next chat completion requests.
-
setFunctions
Description copied from interface:FunctionCallingOptions
Set the list of function names from the ChatModel registry to be used in the next chat completion requests.- Specified by:
setFunctions
in interfaceFunctionCallingOptions
- Parameters:
functions
- the list of function names from the ChatModel registry to be used in the next chat completion requests.
-
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
-
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
-
getProxyToolCalls
- Specified by:
getProxyToolCalls
in interfaceFunctionCallingOptions
-
setProxyToolCalls
- Specified by:
setProxyToolCalls
in interfaceFunctionCallingOptions
-
getToolContext
- Specified by:
getToolContext
in interfaceFunctionCallingOptions
-
setToolContext
- Specified by:
setToolContext
in interfaceFunctionCallingOptions
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-
hashCode
public int hashCode() -
equals
-