-
Notifications
You must be signed in to change notification settings - Fork 2k
Use message type during message creation of Mistral AI chat model #4330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use message type during message creation of Mistral AI chat model #4330
Conversation
d8ccc0c to
e9d3c90
Compare
|
@ricken07 Could you help with the review please? Thanks! |
|
@ilayaperumalg All right, no problem |
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
|
Thanks @ilayaperumalg and @ricken07 for your reviews! I have updated the PR description to add more context and clarify the intent behind these changes. |
a77d1e5 to
3453239
Compare
3453239 to
70a54fa
Compare
|
Hi @ilayaperumalg and @ricken07, I wanted to apologize for the initial state of this PR. It clearly needed more work. I’ve incorporated as much of your review feedback as possible, and I believe the remaining points are now ready for discussion, especially with the updated PR description. Thanks for your time and guidance! |
.../spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Nicolas Krier <[email protected]>
Signed-off-by: Nicolas Krier <[email protected]>
Signed-off-by: Nicolas Krier <[email protected]>
Signed-off-by: Nicolas Krier <[email protected]>
70a54fa to
53ac65f
Compare
|
Hi @ricken07 and @ilayaperumalg, I’ve addressed all the feedback from the last review. The changes are now ready for another look. Please let me know if everything looks good or if there’s anything else to adjust. Thanks again for your time! |
|
@nicolaskrier Thanks for the PR and following up with the review comments. @ricken07 Thanks for reviewing the PR. LGTM, rebased, squashed and merged as f9d87fd |
Description
Providers like Azure OpenAI already support flexible conversion of Spring AI messages to provider-specific formats, enabling custom message types.
This PR adds the same capability for Mistral AI, introducing a dedicated conversion method to ensure consistency across the project.
Key Changes
New Conversion Method
createChatCompletionMessagesinMistralAiChatModelto map Spring AIMessageobjects to Mistral AI’sChatCompletionMessagestream, based onMessageType.Unit Tests
@SpringBootTestannotation.Backward Compatibility
Related Work
This PR aligns with #3999, which implements a similar conversion mechanism for Ollama.
The goal is to standardize message handling across all LLM providers in Spring AI.