{"record":{"id":"76edc07cda152367","repo":"microsoft/semantic-kernel","slug":"the-provided-style-style-is-not-supported","errorCode":null,"errorMessage":"The provided style '{style}' is not supported.","messagePattern":"The provided style '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.TextToImage.cs","lineNumber":143,"sourceCode":"            \"MEDIUM\" => GeneratedImageQuality.MediumQuality,\n            \"LOW\" => GeneratedImageQuality.LowQuality,\n            \"AUTO\" => GeneratedImageQuality.Auto,\n            _ => throw new NotSupportedException($\"The provided quality '{quality}' is not supported.\")\n        };\n    }\n\n    private static GeneratedImageStyle? GetGeneratedImageStyle(string? style)\n    {\n        if (style is null)\n        {\n            return null;\n        }\n\n        return style.ToUpperInvariant() switch\n        {\n            \"VIVID\" => GeneratedImageStyle.Vivid,\n            \"NATURAL\" => GeneratedImageStyle.Natural,\n            _ => throw new NotSupportedException($\"The provided style '{style}' is not supported.\")\n        };\n    }\n\n    private static GeneratedImageFormat? GetResponseFormat(object? responseFormat)\n    {\n        if (responseFormat is null)\n        {\n            return null;\n        }\n\n        if (responseFormat is GeneratedImageFormat format)\n        {\n            return format;\n        }\n\n        if (responseFormat is string formatString)\n        {\n            return formatString.ToUpperInvariant() switch","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.TextToImage.cs#L125-L161","documentation":"The image style string is matched case-insensitively against only VIVID and NATURAL. Null is allowed (returns null). Any other value throws NotSupportedException before the request is sent. Style is a DALL-E 3-specific parameter.","triggerScenarios":"Passing an OpenAITextToImageExecutionSettings.Style value like 'artistic', 'photorealistic', or 'cinematic' that isn't in the two-value allow-list.","commonSituations":"Expecting a richer style taxonomy than the two DALL-E 3 options. Passing a style from a different image API (e.g. Stable Diffusion). Misspelling 'vivid' or 'natural'.","solutions":["Use 'vivid' or 'natural' (case-insensitive), or leave Style unset for the API default.","If you need fine-grained stylistic control, express it in the text prompt instead of the style parameter."],"exampleFix":"// before\nvar settings = new OpenAITextToImageExecutionSettings { Style = \"cinematic\" };\n\n// after\nvar settings = new OpenAITextToImageExecutionSettings { Style = \"vivid\" };","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> SupportedStyles = new(StringComparer.OrdinalIgnoreCase)\n{\n    \"vivid\", \"natural\"\n};\n\nvoid ValidateStyle(string? style)\n{\n    if (style is not null && !SupportedStyles.Contains(style.Trim()))\n        throw new ArgumentOutOfRangeException(nameof(style),\n            \"Style must be 'vivid' or 'natural' (or null for default)\");\n}","typeGuard":null,"tryCatchPattern":"try { await imageService.GetTextToImageAsync(prompt, settings); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"style\"))\n{\n    settings.Style = null;\n    await imageService.GetTextToImageAsync(prompt, settings);\n}","preventionTips":["Remember Style is DALL-E 3 only — don't set it for DALL-E 2.","Use the text prompt for stylistic control beyond vivid/natural."],"tags":["text-to-image","style","validation","dalle"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}