Skip to content

.Net: Add ThinkingLevel parameter to GeminiThinkingConfig for Gemini 3.0+ - #13396

Merged
Roger Barreto (rogerbarreto) merged 5 commits into
mainfrom
copilot/add-thinking-level-parameter
Dec 1, 2025
Merged

Roger Barreto (rogerbarreto) merged 5 commits into
mainfrom
copilot/add-thinking-level-parameter

Conversation

Copilot AI commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Gemini 3.0 introduces a new ThinkingLevel string parameter with values: "none", "low", "medium", "high". The existing ThinkingBudget parameter remains valid for older Gemini 2.5 models.

Fixes #11920

Description

  • Added ThinkingLevel property to GeminiThinkingConfig
  • Kept ThinkingBudget property as-is (still applicable for older Gemini 2.5 models)
  • Updated GeminiRequestThinkingConfig to serialize both properties
  • Added unit tests for ThinkingLevel serialization and deserialization
  • Converted PromptExecutionSettingsCloneWorksAsExpected to a Theory that tests both ThinkingBudget and ThinkingLevel clone work as expected
  • Kept existing ThinkingBudget unit tests unchanged
  • Renamed sample file to Google_GeminiChatCompletionWithThinking.cs to demonstrate both APIs

Usage:

// Gemini 3.0+
var settings = new GeminiPromptExecutionSettings
{
    ThinkingConfig = new GeminiThinkingConfig { ThinkingLevel = "high" }
};

// Gemini 2.5
var settings = new GeminiPromptExecutionSettings
{
    ThinkingConfig = new GeminiThinkingConfig { ThinkingBudget = 2000 }
};

Contribution Checklist

Original prompt

This section details on the original issue you should resolve

<issue_title>New Feature: .NET Gemini 3.0 Thinking Level parameter</issue_title>
<issue_description>---
name: NET Gemini 3.0 Thinking Level parameter
about: Gemini 3.0 Thinking parameter


In gemini 3.0 the thinking budget is depricated instead we have a new parameter which is a string and its called ThinkingLevel where we can specify what thinking level we want , high, low, default is high
</issue_description>

<agent_instructions>Update GeminiThinkingConfig.cs to support ThinkingLevel. Mark the existing ThinkingBudget parameter as deprecated.</agent_instructions>

Comments on the Issue (you are Copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add ThinkingLevel parameter for Gemini 3.0 Add ThinkingLevel parameter to GeminiThinkingConfig for Gemini 3.0 Nov 28, 2025
@rogerbarreto

Copy link
Copy Markdown
Member

Copilot, Don't obsolete the other property as it is still applicable for older models.

Remove the added #pragma warning disable CS0618 added because of this.

Keep as is all unit tests that were checking for the thinking budget, and additionally add the thinking level tests validating that either can be used and work as expected.

Move/Rename concept test file to "dotnet/samples/Concepts/ChatCompletion/Google_GeminiChatCompletionWithThinking.cs" as this now contains both ways.

…emove pragma warnings, rename sample file

Co-authored-by: rogerbarreto <[email protected]>

Copilot AI commented Nov 28, 2025

Copy link
Copy Markdown
Contributor Author

Copilot, Don't obsolete the other property as it is still applicable for older models.

Remove the added #pragma warning disable CS0618 added because of this.
...

Done in 20705e0:

  • Removed [Obsolete] attribute from ThinkingBudget
  • Removed all #pragma warning disable CS0618 added for this change
  • Kept existing ThinkingBudget unit tests unchanged
  • Added ThinkingLevel tests alongside them
  • Renamed sample file to Google_GeminiChatCompletionWithThinking.cs

@rogerbarreto

Copy link
Copy Markdown
Member

Copilot I see you changed the PromptExecutionSettingsCloneWorksAsExpected test, please keep it or make it a theory where you check for both ThinkingBudget and ThinkingLevel Clone work as expected.

…h ThinkingBudget and ThinkingLevel, restore Freeze test

Co-authored-by: rogerbarreto <[email protected]>

Copilot AI commented Nov 28, 2025

Copy link
Copy Markdown
Contributor Author

Copilot I see you changed the PromptExecutionSettingsCloneWorksAsExpected test, please keep it or make it a theory where you check for both ThinkingBudget and ThinkingLevel Clone work as expected.

Done in 6df9a1f - Converted PromptExecutionSettingsCloneWorksAsExpected to a Theory with two test cases for both ThinkingBudget and ThinkingLevel. Also restored PromptExecutionSettingsFreezeWorksAsExpected to its original state using ThinkingBudget.

@rogerbarreto
Roger Barreto (rogerbarreto) marked this pull request as ready for review November 28, 2025 15:12
@rogerbarreto Roger Barreto (rogerbarreto) changed the title Add ThinkingLevel parameter to GeminiThinkingConfig for Gemini 3.0 .Net: Add ThinkingLevel parameter to GeminiThinkingConfig for Gemini 3.0+ Nov 28, 2025
@rogerbarreto
Roger Barreto (rogerbarreto) added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit 460521a Dec 1, 2025
18 checks passed
@rogerbarreto
Roger Barreto (rogerbarreto) deleted the copilot/add-thinking-level-parameter branch December 1, 2025 11:12
S.J. (cstolting-collab) pushed a commit to cstolting-collab/semantic-kernel that referenced this pull request Nov 3, 2026
…ion (microsoft#14715)

### Motivation and Context

A full link-integrity scan of the repository's README files found 13
dead internal links in 4 files. The underlying sample files were deleted
or moved by recent refactors (planner removal microsoft#12399, MEVD Preview 2
microsoft#11028, MsGraph V5 update microsoft#12962, and the Gemini thinking-budget sample
rename in microsoft#13396), but the README entries still point at the old paths.

### Description

- **dotnet/samples/Concepts/README.md**
- `Google_GeminiChatCompletionWithThinkingBudget` -> renamed sample
`Google_GeminiChatCompletionWithThinking` (renamed in microsoft#13396)
- Removed the `VectorStore_DataIngestion_CustomMapper` entry (sample
deleted in microsoft#11028, no replacement)
- Removed the entire `Planners` section (all three samples deleted in
microsoft#12399)
- Removed `MsGraph_ContactsPlugin` / `MsGraph_DrivePlugin` /
`MsGraph_TasksPlugin` entries (no longer present after the MsGraph V5
update in microsoft#12962)
- Removed `WithFunctionCallingStepwisePlanner` entry (deleted together
with the planners in microsoft#12399)
- **dotnet/samples/Demos/OnnxSimpleRAG/README.md**
- Vector Store abstractions link ->
[Microsoft.Extensions.VectorData.Abstractions in
dotnet/extensions](https://github.com/dotnet/extensions/tree/main/src/Libraries/Microsoft.Extensions.VectorData.Abstractions)
(the `dotnet/src/VectorData/VectorData.Abstractions` README itself
points there)
- `InMemoryVectorStore` -> [CommunityToolkit/AI
MEVD/src/InMemory/InMemoryVectorStore.cs](https://github.com/CommunityToolkit/AI/blob/main/MEVD/src/InMemory/InMemoryVectorStore.cs)
(same pointer as `dotnet/src/VectorData/InMemory/README.md`)
- **python/semantic_kernel/connectors/memory_stores/redis/README.md**
- .NET README link -> `dotnet/src/VectorData/Redis/README.md` (current
in-repo location, which forwards to the CommunityToolkit repository)
- **python/samples/concepts/README.md**
- Search section link -> `python/semantic_kernel/connectors/search.py`
(the `connectors/search` directory no longer exists; search now lives in
`search.py`)

### Verification

All 5 new URLs were checked and return HTTP 200. All 13 removed/updated
links were verified to return HTTP 404 against `main` before this
change.

Docs-only change: no code is touched, so builds and unit tests are
unaffected.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Feature: .NET Gemini 3.0 Thinking Level parameter

4 participants