.Net: Fix #13232: Add empty parameters schema for NonInvocableTool placeholder#13278
Merged
dmytrostruk merged 2 commits intoNov 3, 2025
Merged
Conversation
… placeholder - Updated the `s_nonInvocableFunctionTool` to include a function description and parameters schema for better clarity and compatibility. - Added unit tests to validate the parameters schema of `NonInvocableTool`, ensuring it meets Mistral's requirements and does not cause errors with Mistral APIs
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
Author
|
Hello, what are these 3 pending checks? |
markwallace-microsoft
approved these changes
Nov 3, 2025
rogerbarreto
approved these changes
Nov 3, 2025
dmytrostruk
enabled auto-merge
November 3, 2025 15:57
rogerbarreto
temporarily deployed
to
integration
November 3, 2025 15:58 — with
GitHub Actions
Inactive
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation and Context
Why is this change required?
NonInvocableTool placeholder is created without a parameters field, which causes 422 errors when used with Mistral models via LiteLLM since Mistral enforces stricter JSON schema validation than other AI providers.
What problem does it solve?
Current Issue:
When Semantic Kernel has no invocable tools but needs to send tools to keep the service happy, it includes the NonInvocableTool placeholder. This lacks a parameters field, causing Mistral APIs to reject requests.
What scenario does it contribute to?
This fix enables SK to work with:
Use Cases:
Applications using Mistral as their AI provider
Enterprise applications with strict API validation requirements
Description
Solution
Updated the NonInvocableTool creation to include a proper empty parameters schema that satisfies Mistral's validation requirements while maintaining backward compatibility with all other providers
Changes Made
File: src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs
Line 61-64: Enhanced s_nonInvocableFunctionTool with proper parameters schema
Added: Comprehensive unit tests verifying schema structure and Mistral compatibility
Existing Tests: All 474 OpenAI connector tests pass (1 skipped)
Integration Tests: Verified with local Mistral via Ollama + LiteLLM
Backward Compatibility: Confirmed no breaking changes with OpenAI and other providers
Note: I 've noticed that this similar empty schema is used as a property called
s_zeroFunctionParametersSchemathat exists atOpenAIFunction.csContribution Checklist