-
Notifications
You must be signed in to change notification settings - Fork 4.4k
.Net: Add support for 'minimal' reasoning effort for {Azure}+OpenAI Connectors #12989
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 6 commits into
main
from
copilot/fix-09419b86-e7ad-4940-9c96-b9e980173f29
Aug 25, 2025
Merged
.Net: Add support for 'minimal' reasoning effort for {Azure}+OpenAI Connectors #12989
rogerbarreto
merged 6 commits into
main
from
copilot/fix-09419b86-e7ad-4940-9c96-b9e980173f29
Aug 25, 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
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] As we now have the latest updated OpenAI 2.3.0 we can resolve the issue #12887 adding the extra reasoning level option.
Please use the current patterns and follow the unit and integration test approaches for testing reasoning level in the OpenAIPrompt...
Add support for 'minimal' reasoning effort level in OpenAI 2.3.0
Aug 22, 2025
Member
|
@copilot Please revert the changes in the global.json, they are not necessary. |
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Contributor
Author
dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs
Outdated
Show resolved
Hide resolved
…tps://github.com/microsoft/semantic-kernel into copilot/fix-09419b86-e7ad-4940-9c96-b9e980173f29
rogerbarreto
approved these changes
Aug 23, 2025
westey-m
approved these changes
Aug 25, 2025
markwallace-microsoft
approved these changes
Aug 25, 2025
jcruzmot-te
pushed a commit
to thousandeyes/aia-semantic-kernel
that referenced
this pull request
Sep 15, 2025
…onnectors (microsoft#12989) This PR resolves issue microsoft#12887 by adding support for the new 'minimal' reasoning effort level introduced with gpt-5 models. Interestingly enought the latest 2.3.0 version of OpenAI SDK doesn't have a specific `ChatReasoningEffortLevel.Minimal` option, but this is possible using a string "minimal" effort. ## Problem Users were unable to use the new 'minimal' reasoning effort level with GPT-5 and other reasoning models, receiving the error: ``` The provided reasoning effort 'minimal' is not supported. ``` ## Solution The fix adds support for the "minimal" string value in the `GetEffortLevel` method within `ClientCore.ChatCompletion.cs`. The implementation leverages OpenAI SDK implicit string conversion capability for `ChatReasoningEffortLevel` type. ### Changes Made 1. **Updated `GetEffortLevel` method** to recognize "MINIMAL" (case-insensitive) and convert it to `(ChatReasoningEffortLevel)"minimal"` 2. **Added comprehensive test coverage** for the new "minimal" option in both OpenAI and AzureOpenAI connector unit tests 3. **Updated documentation** in `OpenAIPromptExecutionSettings.cs` to include "minimal" as a supported string value ### Usage Users can now specify reasoning effort in multiple ways: ```csharp // Using string (new minimal option) var settings = new OpenAIPromptExecutionSettings { ReasoningEffort = "minimal" }; // Using existing enum values (unchanged) var settings = new OpenAIPromptExecutionSettings { ReasoningEffort = ChatReasoningEffortLevel.Low }; ``` All supported string values: `"low"`, `"medium"`, `"high"`, `"minimal"` ## Testing - ✅ All existing tests continue to pass (471 OpenAI + 490 AzureOpenAI tests) - ✅ New test cases validate "minimal" support in both connectors - ✅ Backward compatibility maintained for existing reasoning effort values - ✅ Invalid strings still throw appropriate `NotSupportedException` Fixes microsoft#12887 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/semantic-kernel/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
4 tasks
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.
This PR resolves issue #12887 by adding support for the new 'minimal' reasoning effort level introduced with gpt-5 models.
Interestingly enought the latest 2.3.0 version of OpenAI SDK doesn't have a specific
ChatReasoningEffortLevel.Minimaloption, but this is possible using a string "minimal" effort.Problem
Users were unable to use the new 'minimal' reasoning effort level with GPT-5 and other reasoning models, receiving the error:
Solution
The fix adds support for the "minimal" string value in the
GetEffortLevelmethod withinClientCore.ChatCompletion.cs. The implementation leverages OpenAI SDK implicit string conversion capability forChatReasoningEffortLeveltype.Changes Made
GetEffortLevelmethod to recognize "MINIMAL" (case-insensitive) and convert it to(ChatReasoningEffortLevel)"minimal"OpenAIPromptExecutionSettings.csto include "minimal" as a supported string valueUsage
Users can now specify reasoning effort in multiple ways:
All supported string values:
"low","medium","high","minimal"Testing
NotSupportedExceptionFixes #12887
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.