Repository: microsoft/semantic-kernel
File: dotnet/src/Connectors/Connectors.Google/GeminiPromptExecutionSettings.cs (C#)

Code before:
        }
    }

    /// <summary>
    /// Configuration for the thinking budget in Gemini 2.5.
    /// **This property is specific to Gemini 2.5 and similar experimental models.**
    /// </summary>
    [JsonPropertyName("thinking_config")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public GeminiThinkingConfig? ThinkingConfig
    {
        get => this._thinkingConfig;
        set
        {
            this.ThrowIfFrozen();
            bool isGemini25 = false;
            if (this.ModelId != null)
            {
                isGemini25 = this.ModelId?.StartsWith("gemini-2.5", StringComparison.OrdinalIgnoreCase) ?? false;
            }

            if (!isGemini25 && value != null)
            {
                throw new InvalidOperationException("ThinkingConfig is only applicable to Gemini-2.5 models.");
            }
            this._thinkingConfig = value;
        }
    }

    /// <inheritdoc />
    public override void Freeze()
    {
        if (this.IsFrozen)
        {
            return;
        }

        base.Freeze();

        if (this._stopSequences is not null)
        {
            this._stopSequences = new ReadOnlyCollection<string>(this._stopSequences);
        }

        if (this._safetySettings is not null)
        {
            this._safetySettings = new ReadOnlyCollection<GeminiSafetySetting>(this._safetySettings);
        }
    }

    /// <inheritdoc />

Review comment (suggestion):
Remove any conditional related to the model, we should not validate this on our side, leave it to the server giving back the expected 400.

> [!NOTE]
> Side note here:
> As a good design practice we suggest avoiding as much as possible throwing exceptions from Properties Getters / Setters.

```suggestion
            this._thinkingConfig = value;
```


Code after:
        }
    }

    /// <summary>
    /// Configuration for the thinking budget in Gemini 2.5.
    /// </summary>
    /// <remarks>
    /// This property is specific to Gemini 2.5 and similar experimental models.
    /// </remarks>
    [JsonPropertyName("thinking_config")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public GeminiThinkingConfig? ThinkingConfig
    {
        get => this._thinkingConfig;
        set
        {
            this.ThrowIfFrozen();
            this._thinkingConfig = value;
        }
    }

    /// <inheritdoc />
    public override void Freeze()
    {
        if (this.IsFrozen)
        {
            return;
        }

        base.Freeze();

        if (this._stopSequences is not null)
        {
            this._stopSequences = new ReadOnlyCollection<string>(this._stopSequences);
        }

        if (this._safetySettings is not null)
        {
            this._safetySettings = new ReadOnlyCollection<GeminiSafetySetting>(this._safetySettings);
        }
    }

    /// <inheritdoc />
    public override PromptExecutionSettings Clone()
    {
        return new GeminiPromptExecutionSettings()
        {
            ModelId = this.ModelId,
            ExtensionData = this.ExtensionData is not null ? new Dictionary<string, object>(this.ExtensionData) : null,
            Temperature = this.Temperature,
            TopP = this.TopP,