Skip to content

Improve MistralAiApi Jackson mapping for message content#5585

Open
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
nicolaskrier:mistral-ai-api
Open

Improve MistralAiApi Jackson mapping for message content#5585
nicolaskrier wants to merge 1 commit intospring-projects:mainfrom
nicolaskrier:mistral-ai-api

Conversation

@nicolaskrier
Copy link
Copy Markdown
Contributor

@nicolaskrier nicolaskrier commented Mar 10, 2026

Description

  • 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.

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

Remaining tasks

  • MistralAiApi.ChatCompletionMessage unit tests demonstrating content attribute serialization and deserialization,
  • MistralAiApi.ChatCompletionMessage.ContentSerializer unit tests,
  • MistralAiApi.ChatCompletionMessage.ContentDeserializer unit tests,
  • MistralAiApi.ChatCompletionMessage.extractContent unit tests,
  • MistralAiApi.ChatCompletionMessage.extractThinkingContent unit tests,
  • MistralAiApi prompt_mode parameter support indicating reasoning for Magistral models,
  • MistralAiApi reasoning_effort parameter support for Mistral Small 4,
  • MistralAiChatOptions prompt_mode and reasoning_effort parameters support,
  • MistralAiApi integration tests demonstrating Mistral Small 4 reasoning on demand feature,
  • MistralAiApi integration test including MistralAiApi.ChatCompletionMessage.ImageUrlChunk,
  • MistralAiApi integration test including MistralAiApi.ChatCompletionMessage.ReferenceChunk.

@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 5 times, most recently from c8aa779 to 220088c Compare March 14, 2026 16:50
@sdeleuze sdeleuze self-assigned this Mar 16, 2026
@sdeleuze sdeleuze added enhancement New feature or request mistral labels Mar 16, 2026
@sdeleuze sdeleuze added this to the 2.0.0-M4 milestone Mar 16, 2026
@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 6 times, most recently from 6563ab1 to 830333d Compare March 20, 2026 20:54
@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 5 times, most recently from c5c1c6c to 9a30eae Compare March 21, 2026 18:20
@nicolaskrier nicolaskrier changed the title Improve MistralAiApi Jackson mapping Improve MistralAiApi Jackson mapping for message content Mar 21, 2026
@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 7 times, most recently from 6cd972a to 2dfbc35 Compare March 24, 2026 21:15
@nicolaskrier nicolaskrier marked this pull request as ready for review March 24, 2026 21:19
@sdeleuze sdeleuze modified the milestones: 2.0.0-M4, 2.0.0-M5 Mar 25, 2026
@nicolaskrier nicolaskrier marked this pull request as draft March 26, 2026 11:23
@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 2 times, most recently from 6e3a147 to 8f501d1 Compare March 26, 2026 20:40
@nicolaskrier nicolaskrier marked this pull request as ready for review March 26, 2026 21:14
@nicolaskrier nicolaskrier force-pushed the mistral-ai-api branch 2 times, most recently from b438062 to 9e7cedf Compare April 14, 2026 21:34
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mistral

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants