-
Notifications
You must be signed in to change notification settings - Fork 4.4k
.Net: Ensure Required Headers in Mistral ChatCompletion HttpClient #11646
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
Merged
rogerbarreto
merged 12 commits into
microsoft:main
from
shethaadit:shethaadit/FixBug11634
Apr 24, 2025
Merged
.Net: Ensure Required Headers in Mistral ChatCompletion HttpClient #11646
rogerbarreto
merged 12 commits into
microsoft:main
from
shethaadit:shethaadit/FixBug11634
Apr 24, 2025
Conversation
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
dotnet/src/Connectors/Connectors.MistralAI/MistralAIKernelBuilderExtensions.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.MistralAI.UnitTests/MistralAIExtensionTests.cs
Outdated
Show resolved
Hide resolved
rogerbarreto
approved these changes
Apr 22, 2025
markwallace-microsoft
previously approved these changes
Apr 23, 2025
Member
markwallace-microsoft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shethaadit Can you confirm you have enabled the integration tests locally and they all pass?
- https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/IntegrationTests/Connectors/MistralAI/ChatCompletion/MistralAIChatCompletionTests.cs
- https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/IntegrationTests/Connectors/MistralAI/TextEmbedding/MistralAITextEmbeddingTests.cs
Need confirmation the integration tests are passing
Member
markwallace-microsoft
approved these changes
Apr 24, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 24, 2025
…11646) ### Description This PR addresses a known issue where omitting the `"extra-parameters": "pass-through"` header in `HttpClient` results in a `400 Bad Request` when calling Mistral chat completions. - **Fixes a critical integration bug** by enforcing the required header at the extension level if not provided by the user. - **Adds a unit test** to validate correct injection of the header, improving coverage and reliability for MistralAI scenarios. These changes improve robustness, eliminate manual setup pitfalls, and enhance maintainability for developers integrating Mistral models. ### Contribution Checklist - [Y] The code builds clean without any errors or warnings - [Y] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [Y] All unit tests pass, and I have added new tests where possible - [Y] I didn't break anyone 😄 Fixes #11634 --------- Co-authored-by: Adit Sheth <adsheth@microsoft.com> Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
glorious-beard
pushed a commit
to glorious-beard/semantic-kernel
that referenced
this pull request
May 6, 2025
…icrosoft#11646) ### Description This PR addresses a known issue where omitting the `"extra-parameters": "pass-through"` header in `HttpClient` results in a `400 Bad Request` when calling Mistral chat completions. - **Fixes a critical integration bug** by enforcing the required header at the extension level if not provided by the user. - **Adds a unit test** to validate correct injection of the header, improving coverage and reliability for MistralAI scenarios. These changes improve robustness, eliminate manual setup pitfalls, and enhance maintainability for developers integrating Mistral models. ### Contribution Checklist - [Y] The code builds clean without any errors or warnings - [Y] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [Y] All unit tests pass, and I have added new tests where possible - [Y] I didn't break anyone 😄 Fixes microsoft#11634 --------- Co-authored-by: Adit Sheth <adsheth@microsoft.com> Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
jcruzmot-te
pushed a commit
to thousandeyes/aia-semantic-kernel
that referenced
this pull request
Sep 15, 2025
…icrosoft#11646) ### Description This PR addresses a known issue where omitting the `"extra-parameters": "pass-through"` header in `HttpClient` results in a `400 Bad Request` when calling Mistral chat completions. - **Fixes a critical integration bug** by enforcing the required header at the extension level if not provided by the user. - **Adds a unit test** to validate correct injection of the header, improving coverage and reliability for MistralAI scenarios. These changes improve robustness, eliminate manual setup pitfalls, and enhance maintainability for developers integrating Mistral models. ### Contribution Checklist - [Y] The code builds clean without any errors or warnings - [Y] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [Y] All unit tests pass, and I have added new tests where possible - [Y] I didn't break anyone 😄 Fixes microsoft#11634 --------- Co-authored-by: Adit Sheth <adsheth@microsoft.com> Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ai connector
Anything related to AI connectors
kernel
Issues or pull requests impacting the core kernel
.NET
Issue or Pull requests regarding .NET code
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
This PR addresses a known issue where omitting the
"extra-parameters": "pass-through"header inHttpClientresults in a400 Bad Requestwhen calling Mistral chat completions.These changes improve robustness, eliminate manual setup pitfalls, and enhance maintainability for developers integrating Mistral models.
Contribution Checklist
Fixes #11634