Package org.springframework.ai.mistralai
Class MistralAiChatModel
java.lang.Object
org.springframework.ai.chat.model.AbstractToolCallSupport
org.springframework.ai.mistralai.MistralAiChatModel
- All Implemented Interfaces:
ChatModel
,StreamingChatModel
,Model<Prompt,
,ChatResponse> StreamingModel<Prompt,
ChatResponse>
Represents a Mistral AI Chat Model.
- Since:
- 1.0.0
- Author:
- Ricken Bazolo, Christian Tzolov, Grogdunn, Thomas Vitale, luocongqiu, Ilayaperumal Gopinathan, Alexandros Pappas
-
Field Summary
Fields inherited from class org.springframework.ai.chat.model.AbstractToolCallSupport
functionCallbackRegister, functionCallbackResolver, IS_RUNTIME_CALL
-
Constructor Summary
ConstructorDescriptionMistralAiChatModel
(MistralAiApi mistralAiApi) MistralAiChatModel
(MistralAiApi mistralAiApi, MistralAiChatOptions options) MistralAiChatModel
(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate) MistralAiChatModel
(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) MistralAiChatModel
(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, org.springframework.retry.support.RetryTemplate retryTemplate) -
Method Summary
Modifier and TypeMethodDescriptionExecutes a method call to the AI model.static ChatResponseMetadata
from
(MistralAiApi.ChatCompletion result) static ChatResponseMetadata
from
(MistralAiApi.ChatCompletion result, Usage usage) internalCall
(Prompt prompt, ChatResponse previousChatResponse) reactor.core.publisher.Flux<ChatResponse>
internalStream
(Prompt prompt, ChatResponse previousChatResponse) void
setObservationConvention
(ChatModelObservationConvention observationConvention) Use the provided convention for reporting observation datareactor.core.publisher.Flux<ChatResponse>
Executes a method call to the AI model.Methods inherited from class org.springframework.ai.chat.model.AbstractToolCallSupport
buildToolCallConversation, executeFunctions, getFunctionCallbackRegister, handleToolCalls, isProxyToolCalls, isToolCall, isToolCall, resolveFunctionCallbacks, runtimeFunctionCallbackConfigurations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.model.StreamingChatModel
stream, stream
-
Constructor Details
-
MistralAiChatModel
-
MistralAiChatModel
-
MistralAiChatModel
public MistralAiChatModel(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, org.springframework.retry.support.RetryTemplate retryTemplate) -
MistralAiChatModel
public MistralAiChatModel(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate) -
MistralAiChatModel
public MistralAiChatModel(MistralAiApi mistralAiApi, MistralAiChatOptions options, FunctionCallbackResolver functionCallbackResolver, List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
from
-
from
-
call
Description copied from interface:Model
Executes a method call to the AI model. -
internalCall
-
stream
Description copied from interface:StreamingModel
Executes a method call to the AI model.- Specified by:
stream
in interfaceChatModel
- Specified by:
stream
in interfaceStreamingChatModel
- Specified by:
stream
in interfaceStreamingModel<Prompt,
ChatResponse> - Parameters:
prompt
- the request object to be sent to the AI model- Returns:
- the streaming response from the AI model
-
internalStream
public reactor.core.publisher.Flux<ChatResponse> internalStream(Prompt prompt, ChatResponse previousChatResponse) -
getDefaultOptions
- Specified by:
getDefaultOptions
in interfaceChatModel
-
setObservationConvention
Use the provided convention for reporting observation data- Parameters:
observationConvention
- The provided convention
-