Class MistralAiChatModel

java.lang.Object
org.springframework.ai.mistralai.MistralAiChatModel
All Implemented Interfaces:
ChatModel, StreamingChatModel, Model<Prompt,ChatResponse>, StreamingModel<Prompt,ChatResponse>

public class MistralAiChatModel extends Object implements ChatModel
Represents a Mistral AI Chat Model.

The assistant message of each choice is built from ordered MessageParts that follow the content chunks Mistral returns: a text chunk, or a plain string content, becomes a TextPart, a thinking chunk a ReasoningPart, and any other chunk, such as the reference of a citation, an UnknownPart that holds it verbatim. Tool calls are a separate field of a Mistral message, so their ToolCallParts always follow the content.

An assistant message that carries Mistral reasoning or other Mistral chunks is replayed as content chunks in part order, so a reasoning model gets its earlier thinking back next to the answer it led to, as Mistral recommends. Any other assistant message is sent as its text, as before.

Since:
1.0.0
Author:
Ricken Bazolo, Christian Tzolov, Grogdunn, Thomas Vitale, luocongqiu, Ilayaperumal Gopinathan, Alexandros Pappas, Nicolas Krier, Jason Smith, Sebastien Deleuze, Dimitar Proynov