Improve MistralAiApi Jackson mapping for message content#5585
Open
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
Open
Improve MistralAiApi Jackson mapping for message content#5585nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
Conversation
c8aa779 to
220088c
Compare
6563ab1 to
830333d
Compare
nicolaskrier
commented
Mar 20, 2026
c5c1c6c to
9a30eae
Compare
6cd972a to
2dfbc35
Compare
2dfbc35 to
f734bfb
Compare
6e3a147 to
8f501d1
Compare
b438062 to
9e7cedf
Compare
9e7cedf to
afb55f9
Compare
- Define different type of chunk instead of media content - Verify that new chunks allow Magistral models and Mistral Small 4 model support - Introduce prompt_mode request parameter for Magistral models - Introduce reasoning_effort request parameter for Mistral Small 4 model - Remove unnecessary null checks in MistralAiChatModel - Improve existing Javadoc - Polish integration tests and unit tests Signed-off-by: Nicolas Krier <7557886+nicolaskrier@users.noreply.github.com>
afb55f9 to
778ddec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
prompt_moderequest parameter for Magistral models,reasoning_effortrequest parameter for Mistral Small 4 model,MistralAiChatModel,Explanations
This PR aligns the Jackson mapping with the content types defined in the Mistral AI OpenAPI Specifications. The changes ensure null safety matches the OpenAPI Specifications requirements and introduce support for new content types used by Magistral 1.2 models. New Mistral Small 4 model reasoning on demand feature is also added in order to cover all Mistral reasoning models.
Proposed milestone
2.0.0-M5
Related work
spring-ai-mistral-ainull-safe #5354,ThinkingAssistantMessageclass reusable for each AI vendor #5698.Remaining tasks
MistralAiApi.ChatCompletionMessageunit tests demonstratingcontentattribute serialization and deserialization,MistralAiApi.ChatCompletionMessage.ContentSerializerunit tests,MistralAiApi.ChatCompletionMessage.ContentDeserializerunit tests,MistralAiApi.ChatCompletionMessage.extractContentunit tests,MistralAiApi.ChatCompletionMessage.extractThinkingContentunit tests,MistralAiApiprompt_modeparameter support indicating reasoning for Magistral models,MistralAiApireasoning_effortparameter support for Mistral Small 4,MistralAiChatOptionsprompt_modeandreasoning_effortparameters support,MistralAiApiintegration tests demonstrating Mistral Small 4 reasoning on demand feature,MistralAiApiintegration test includingMistralAiApi.ChatCompletionMessage.ImageUrlChunk,MistralAiApiintegration test includingMistralAiApi.ChatCompletionMessage.ReferenceChunk.