Commit a02d604
.Net: Add support for 'minimal' reasoning effort for {Azure}+OpenAI Connectors (#12989)
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.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 #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>1 parent 4c55424 commit a02d604
File tree
4 files changed
+4
-1
lines changed- dotnet/src/Connectors
- Connectors.AzureOpenAI.UnitTests/Services
- Connectors.OpenAI.UnitTests/Services
- Connectors.OpenAI
- Core
- Settings
4 files changed
+4
-1
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| 1013 | + | |
1013 | 1014 | | |
1014 | 1015 | | |
1015 | 1016 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| 560 | + | |
560 | 561 | | |
561 | 562 | | |
562 | 563 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments