Skip to content

.NET: Bug: extra-parameters needed in HttpClient for Mistral #11634

@williambohrmann3

Description

@williambohrmann3

Describe the bug
I am getting a 400 bad request exception for Mistral chat completions when I don't specify an HttpClient with the following header

DefaultRequestHeaders =
{
    {  "extra-parameters", "pass-through" },
}

Expected behavior
A clear and concise description of what you expected to happen.

To Reproduce
Run reproducer code
https://github.com/williambohrmann3/SemanticKernelMistralBug/blob/master/Program.cs

Expected behavior
The HttpRequest parameter is marked as optional, so this header shouldn't be required. It should "just work".

Platform

  • Language: C#
  • Source: NuGet 1.47.0-alpha
  • AI model: MistralAI:mistral-large-latest
  • IDE: Visual Studio
  • OS: Windows

Additional context
Interestingly, Python devs using the Mistral connector for LangChain are getting the same error message.
https://learn.microsoft.com/en-us/answers/questions/2117664/my-mistral-large-2407-serverless-deployment-api-is

https://learn.microsoft.com/en-us/answers/questions/2113323/((detail-extra-parameters-(safe-prompt)-are-not-al

Deep in the stack trace, after enabling language runtime exceptions, my colleague found the following error

Error code: 400 - {'detail': "Extra parameters ['n'] are not allowed when extra-parameters is not set or set to be 'error'. Set extra-parameters to 'pass-through' to pass to the model."}

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET codeai connectorAnything related to AI connectors

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions