Package org.springframework.ai.mistralai
Class MistralAiChatModel
java.lang.Object
org.springframework.ai.mistralai.MistralAiChatModel
- All Implemented Interfaces:
org.springframework.ai.chat.model.ChatModel,org.springframework.ai.chat.model.StreamingChatModel,org.springframework.ai.model.Model<org.springframework.ai.chat.prompt.Prompt,,org.springframework.ai.chat.model.ChatResponse> org.springframework.ai.model.StreamingModel<org.springframework.ai.chat.prompt.Prompt,org.springframework.ai.chat.model.ChatResponse>
public class MistralAiChatModel
extends Object
implements org.springframework.ai.chat.model.ChatModel
Represents a Mistral AI Chat Model.
- Since:
- 1.0.0
- Author:
- Ricken Bazolo, Christian Tzolov, Grogdunn, Thomas Vitale, luocongqiu, Ilayaperumal Gopinathan, Alexandros Pappas, Nicolas Krier, Jason Smith, Sebastien Deleuze
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMistralAiChatModel(MistralAiApi mistralAiApi, MistralAiChatOptions options, org.springframework.ai.model.tool.ToolCallingManager toolCallingManager, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionstatic MistralAiChatModel.Builderbuilder()org.springframework.ai.chat.model.ChatResponsecall(org.springframework.ai.chat.prompt.Prompt prompt) static org.springframework.ai.chat.metadata.ChatResponseMetadatafrom(MistralAiApi.ChatCompletion result) static org.springframework.ai.chat.metadata.ChatResponseMetadatafrom(MistralAiApi.ChatCompletion result, org.springframework.ai.chat.metadata.Usage usage) voidsetObservationConvention(org.springframework.ai.chat.observation.ChatModelObservationConvention observationConvention) Use the provided convention for reporting observation datareactor.core.publisher.Flux<org.springframework.ai.chat.model.ChatResponse>stream(org.springframework.ai.chat.prompt.Prompt prompt) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.chat.model.ChatModel
call, call, getDefaultOptionsMethods inherited from interface org.springframework.ai.chat.model.StreamingChatModel
stream, stream
-
Field Details
-
REFERENCE_CONTENT_METADATA
- See Also:
-
REFERENCE_THINKING_CONTENT_METADATA
- See Also:
-
THINKING_CONTENT_METADATA
- See Also:
-
-
Constructor Details
-
MistralAiChatModel
public MistralAiChatModel(MistralAiApi mistralAiApi, MistralAiChatOptions options, org.springframework.ai.model.tool.ToolCallingManager toolCallingManager, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
from
public static org.springframework.ai.chat.metadata.ChatResponseMetadata from(MistralAiApi.ChatCompletion result) -
from
public static org.springframework.ai.chat.metadata.ChatResponseMetadata from(MistralAiApi.ChatCompletion result, org.springframework.ai.chat.metadata.Usage usage) -
call
public org.springframework.ai.chat.model.ChatResponse call(org.springframework.ai.chat.prompt.Prompt prompt) - Specified by:
callin interfaceorg.springframework.ai.chat.model.ChatModel- Specified by:
callin interfaceorg.springframework.ai.model.Model<org.springframework.ai.chat.prompt.Prompt,org.springframework.ai.chat.model.ChatResponse>
-
stream
public reactor.core.publisher.Flux<org.springframework.ai.chat.model.ChatResponse> stream(org.springframework.ai.chat.prompt.Prompt prompt) - Specified by:
streamin interfaceorg.springframework.ai.chat.model.ChatModel- Specified by:
streamin interfaceorg.springframework.ai.chat.model.StreamingChatModel- Specified by:
streamin interfaceorg.springframework.ai.model.StreamingModel<org.springframework.ai.chat.prompt.Prompt,org.springframework.ai.chat.model.ChatResponse>
-
getOptions
- Specified by:
getOptionsin interfaceorg.springframework.ai.chat.model.ChatModel- Since:
- 2.0.0
-
setObservationConvention
public void setObservationConvention(org.springframework.ai.chat.observation.ChatModelObservationConvention observationConvention) Use the provided convention for reporting observation data- Parameters:
observationConvention- The provided convention
-
builder
-