{"record":{"id":"2eab63044a59bb1e","repo":"microsoft/semantic-kernel","slug":"the-provided-reasoning-effort-texteffortlevel","errorCode":null,"errorMessage":"The provided reasoning effort '{textEffortLevel}' is not supported.","messagePattern":"The provided reasoning effort '(.+?)' is not supported\\.","errorType":"validation","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs","lineNumber":577,"sourceCode":"        if (effortLevelObject is null)\n        {\n            return null;\n        }\n\n        if (effortLevelObject is ChatReasoningEffortLevel effort)\n        {\n            return effort;\n        }\n\n        if (effortLevelObject is string textEffortLevel)\n        {\n            return textEffortLevel.ToUpperInvariant() switch\n            {\n                \"LOW\" => ChatReasoningEffortLevel.Low,\n                \"MEDIUM\" => ChatReasoningEffortLevel.Medium,\n                \"HIGH\" => ChatReasoningEffortLevel.High,\n                \"MINIMAL\" => new(\"minimal\"),\n                _ => throw new NotSupportedException($\"The provided reasoning effort '{textEffortLevel}' is not supported.\")\n            };\n        }\n\n        throw new NotSupportedException($\"The provided reasoning effort '{effortLevelObject.GetType()}' is not supported.\");\n    }\n\n    protected static ChatWebSearchOptions? GetWebSearchOptions(OpenAIPromptExecutionSettings executionSettings)\n    {\n        if (executionSettings.WebSearchOptions is null)\n        {\n            return null;\n        }\n\n        if (executionSettings.WebSearchOptions is ChatWebSearchOptions webSearchOptions)\n        {\n            return webSearchOptions;\n        }\n","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.ChatCompletion.cs#L559-L595","documentation":"Thrown while converting the ReasoningEffort execution-settings value into a ChatReasoningEffortLevel. When the value is a string it is upper-cased and matched against LOW, MEDIUM, HIGH, and MINIMAL (the reasoning_effort values accepted by OpenAI o-series models). An unrecognized token means the caller asked for a reasoning budget the model or connector does not expose.","triggerScenarios":"OpenAIPromptExecutionSettings.ReasoningEffort is set to a string that is not low/medium/high/minimal (case-insensitive), e.g. 'ultra', 'max', '0.5', or a typo like 'hihg'. The connector then cannot build the request payload for the model.","commonSituations":"Mixing vocabulary from a different vendor (e.g. Anthropic 'thinking budget' tokens), reading the value from config with a stray value, or using a value added in a newer OpenAI API than the connector supports.","solutions":["Set ReasoningEffort to one of 'low', 'medium', 'high', or 'minimal' (any case).","If you need a budget expressed as a number, remove ReasoningEffort and use a model/settings field that accepts numeric token budgets instead.","Upgrade Connectors.OpenAI if the model genuinely supports a new effort level.","Validate the config-sourced string against the allowed set before assigning it."],"exampleFix":"// before\nsettings.ReasoningEffort = \"ultra\";\n// after\nsettings.ReasoningEffort = \"high\";","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> ValidEfforts = new(StringComparer.OrdinalIgnoreCase) { \"low\",\"medium\",\"high\",\"minimal\" };\nstatic string NormalizeEffort(string? e) => (e is not null && ValidEfforts.Contains(e)) ? e!.ToLowerInvariant() : throw new ArgumentException($\"ReasoningEffort must be one of: {string.Join(\", \", ValidEfforts)}\");","typeGuard":"static bool IsValidReasoningEffort(string? e) => e is not null && ValidEfforts.Contains(e);","tryCatchPattern":"try { await client.GetChatCompletionAsync(...); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"reasoning effort\")) { settings.ReasoningEffort = \"medium\"; /* retry */ }","preventionTips":["Validate reasoning effort at the config layer.","Keep the value as a string token from the OpenAI set."],"tags":["openai","reasoning","chat-completion","settings-validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}