Package org.springframework.ai.mistralai
Class MistralAiChatOptions
java.lang.Object
org.springframework.ai.mistralai.MistralAiChatOptions
- All Implemented Interfaces:
ChatOptions,ModelOptions,StructuredOutputChatOptions,ToolCallingChatOptions
public class MistralAiChatOptions
extends Object
implements ToolCallingChatOptions, StructuredOutputChatOptions
Options for the Mistral AI Chat API.
- Since:
- 0.8.1
- Author:
- Ricken Bazolo, Christian Tzolov, Thomas Vitale, Alexandros Pappas, Jason Smith, Sebastien Deleuze, Nicolas Krier
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMistralAiChatOptions(@Nullable String model, @Nullable Double temperature, @Nullable Double topP, @Nullable Integer maxTokens, @Nullable Boolean safePrompt, @Nullable Integer randomSeed, @Nullable MistralAiApi.ChatCompletionRequest.ResponseFormat responseFormat, @Nullable List<String> stop, @Nullable MistralAiApi.ChatCompletionRequest.ReasoningEffort reasoningEffort, @Nullable Double frequencyPenalty, @Nullable Double presencePenalty, @Nullable Integer n, @Nullable List<MistralAiApi.FunctionTool> tools, @Nullable MistralAiApi.ChatCompletionRequest.ToolChoice toolChoice, @Nullable List<ToolCallback> toolCallbacks, @Nullable Map<String, Object> toolContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic MistralAiChatOptions.Builderbuilder()A builder to create a newToolCallingChatOptionsinstance.booleanReturns the frequency penalty to use for the chat.@Nullable IntegerReturns the maximum number of tokens to use for the chat.getModel()Returns the model to use for the chat.@Nullable IntegergetN()@Nullable StringReturns the presence penalty to use for the chat.@Nullable IntegergetStop()Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.@Nullable List<ToolCallback>ToolCallbacks to be registered with the ChatModel.Get the configured tool context.@Nullable List<MistralAiApi.FunctionTool>getTools()@Nullable IntegergetTopK()Returns the top K to use for the chat.getTopP()Returns the top P to use for the chat.inthashCode()mutate()Returns a newToolCallingChatOptions.Builderinitialized with the values of thisToolCallingChatOptions.
-
Constructor Details
-
MistralAiChatOptions
protected MistralAiChatOptions(@Nullable String model, @Nullable Double temperature, @Nullable Double topP, @Nullable Integer maxTokens, @Nullable Boolean safePrompt, @Nullable Integer randomSeed, @Nullable MistralAiApi.ChatCompletionRequest.ResponseFormat responseFormat, @Nullable List<String> stop, @Nullable MistralAiApi.ChatCompletionRequest.ReasoningEffort reasoningEffort, @Nullable Double frequencyPenalty, @Nullable Double presencePenalty, @Nullable Integer n, @Nullable List<MistralAiApi.FunctionTool> tools, @Nullable MistralAiApi.ChatCompletionRequest.ToolChoice toolChoice, @Nullable List<ToolCallback> toolCallbacks, @Nullable Map<String, Object> toolContext)
-
-
Method Details
-
builder
Description copied from interface:ToolCallingChatOptionsA builder to create a newToolCallingChatOptionsinstance.- Returns:
- Returns a new
ChatOptions.Builder.
-
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
-
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
-
getSafePrompt
-
getRandomSeed
-
getResponseFormat
-
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
-
getStop
-
getReasoningEffort
-
getTools
-
getToolChoice
-
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
-
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
-
getN
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptionsToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacksin 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.
-
getOutputSchema
- Specified by:
getOutputSchemain interfaceStructuredOutputChatOptions
-
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
-
hashCode
public int hashCode() -
equals
-