semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: New Feature: IncludeThoughts for Google Connector

Open roldengarm opened this issue 1 year ago • 5 comments


name: IncludeThoughts for Google Connector about: Add ability to get thoughts in response from Google Gemini models.


The official C# SDK for Google supports a parameter "IncludeThoughts" on the ThinkingConfig. Setting that to true, will return the thoughts in the response.

Image

This parameter is missing in Microsoft.SemanticKernel.Connectors.Google.GeminiThinkingConfig

Image

Additionally, I believe the response logic for (at least) streaming should be updated as well to indicate if a part is a thought or not. Right now, InnerContent is just a string, not a POCO object as I would expect. See official docs here. It doesn't include C# in the docs, but it's definitely there.

roldengarm avatar Nov 13 '25 18:11 roldengarm

Thought Signatures are mandatory for Gemini 3 Pro with Function Calling

We've tested Gemini-3-Pro-Preview with Semantic Kernel and encountered the exact issue described in this thread. When using function calling, the API returns a 400 Bad Request with the error:

"Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance."

According to Google's documentation, Thought Signatures are mandatory for Gemini 3 Pro when making function calls. Without this feature, Gemini 3 Pro cannot be used with Semantic Kernel for any function calling scenarios.

This is a blocking issue for production use of Gemini 3 Pro.

Cozmopolit avatar Nov 19 '25 15:11 Cozmopolit

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Feb 18 '26 02:02 github-actions[bot]

I have IncludeThoughts = false, but I receive al output with only one item and with the THOUGHT.

I use this:

private static string RemoveThink(ChatMessageContent content)
{
    var value = string.Join("", content.Items
        .Where(item =>
            item is TextContent text &&
            // Verify thinking
            (text.Metadata is null ||
             (!text.Metadata.ContainsKey("IsThinking") &&
              !text.Metadata.ContainsKey("IsThought")))
        )
        .Select(item => item.ToString()?.Trim() ?? ""))
        .Trim();


    if (value.StartsWith("THOUGHT", StringComparison.OrdinalIgnoreCase))
    {
        throw new Exception("THOUGHT");
    }

but it doesn't work sometimes

shargon avatar Feb 24 '26 22:02 shargon

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Oct 07 '26 01:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 22 '26 01:10 github-actions[bot]