Improve MistralAiApi Jackson mapping for message content#5585
Improve MistralAiApi Jackson mapping for message content#5585nicolaskrier wants to merge 1 commit into
Conversation
c8aa779 to
220088c
Compare
6563ab1 to
830333d
Compare
c5c1c6c to
9a30eae
Compare
6cd972a to
2dfbc35
Compare
ddc0909 to
7423a7e
Compare
1e8f523 to
0207947
Compare
|
Hi Sébastien, I wanted to give you a quick heads-up here: I am currently reworking the solution. I have implemented four different methods at the
I plan to finish this by the end of the long weekend. Feel free to ping me if you think this approach is not suitable. |
e702b7a to
fc85886
Compare
|
@nicolaskrier Is this PR ready for a new review? |
|
@sdeleuze: I am currently working on a last integration test verifying that reference content metadata is properly filled and then it will be over. |
fc85886 to
70d190e
Compare
70d190e to
0bc3803
Compare
|
@sdeleuze: I have slightly modified the proposed solution to use a list of integers for the It is ready to be reviewed now. |
0bc3803 to
19c4ca2
Compare
- Define different type of chunk instead of media content - Verify that new chunks allow reasoning models support - Introduce reasoning_effort request parameter for reasoning models - Introduce reference_content, reference_thinking_content and thinking_content metadata in MistralAiChatModel - 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>
|
Merged with additional documentation and configuration property, let's polish in RC1 if needed. @nicolaskrier Does #5020 still make sense of should we close it? |
|
@sdeleuze: I think that you can close the other PR and the associated issue. |
Description
reasoning_effortrequest parameter for reasoning models,reference_content,reference_thinking_contentandthinking_contentmetadata inMistralAiChatModel,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 reasoning on demand feature for Mistral Small 4 and Mistral Medium 3.5 models is also added in order to cover all Mistral reasoning models.
Proposed milestone
2.0.0-M6
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,MistralAiApireasoning_effortparameter support for Mistral Small 4 and Mistral Medium 3.5,MistralAiChatOptionsreasoning_effortparameter support,MistralAiApiintegration tests demonstrating Mistral Small 4 and Mistral Medium 3.5 reasoning on demand feature,MistralAiApiintegration test includingMistralAiApi.ChatCompletionMessage.ImageUrlChunk,MistralAiApiintegration test includingMistralAiApi.ChatCompletionMessage.ReferenceChunk.