Issue with thinking_level Parameter in ChatGoogleGenerativeAI (langchain-google-genai v3.1.0)

I am encountering a ValueError while attempting to utilize the new thinking_level parameter in ChatGoogleGenerativeAI after upgrading to langchain-google-genai version 3.1.0.

The inclusion of this field in the configuration structure suggests that support for advanced thinking features (potentially for models like Gemini 3 Pro) is being rolled out, but I cannot successfully pass the parameter.

The Code and Error:

I initialized the model using the following code, attempting to set thinking_level directly on the class constructor:

from langchain_google_genai import ChatGoogleGenerativeAI

llm_model_gemini_pro = ChatGoogleGenerativeAI(
    thinking_level="low",
    model="gemini-3-pro-preview",
    convert_system_message_to_human=True,
    temperature=1,
    max_tokens=None,
    timeout=None,
    max_retries=3,
    # thinking_budget=-1,
)

This immediately returned the following error:

ValueError: Unknown field for ThinkingConfig: thinking_level

Hi @MihoKey

I see this in the source:

        if self.thinking_level is not None and self.thinking_budget is not None:
            msg = (
                "Both 'thinking_level' and 'thinking_budget' were specified. "
                "'thinking_level' is not yet supported by the current API version, "
                "so 'thinking_budget' will be used instead."
            )
            warnings.warn(msg, UserWarning, stacklevel=2)

And in that package google-ai-generativelanguage · PyPI I see only thinking_budget and include_thoughts.

Support for this param will be added on the next release of langchain-google-genai

Currently, you can use budget and it will map on Google’s backend. The mappings from budget to level are:

1-1000 - > low
1000-32768 → high

It seems like this issue is still persisting with the latest update. I am using gemini 3 flash preview, and when thinking budget is set to low, no thinking occurs, setting budget also does not affect things.

I am on the latest relase (Version: 4.2.6) by this day (July 2026) and I still have the same problem:

UserWarning: WARNING! thinking_level is not default parameter.
thinking_level was transferred to model_kwargs.
Please confirm that thinking_level is what you intended.

Hi @digital-Chairman and @http-idrissi-gh, this thread is already closed, but to clarify and help with your specific concerns:

thinking_budget is for Gemini 2.5 only. On Gemini 3, it is deprecated.

from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatGoogleGenerativeAI(
    model="gemini-3-flash-preview",
    thinking_level="low",      # not thinking_budget
    include_thoughts=True,     # needed to SEE reasoning in the response
)

@digital-Chairman: If you set thinking_budget (or a small budget) on Gemini 3, it will not behave like a “level.” Also, thinking_level="low" minimizes reasoning — on simple prompts, it can look like no thinking occurred. Check response.usage_metadata["output_token_details"]["reasoning"] to confirm that thinking ran.

Please make sure you are on 4.2.6+ for langchain-google-genai:

import langchain_google_genai
print(langchain_google_genai.__version__)  # should be >= 4.2.6

Upgrade with pip install -U langchain-google-genai. In 4.2.6+, thinking_level is a first-class parameter (source), so you should not see that warning. The warning is raised by langchain-core when thinking_level is not recognized as a model field and gets moved into model_kwargs instead.

If you are on < 4.2.6, or still see the warning after upgrading (which you shouldn’t if you are on 4.2.6+ please double check), use this workaround:

llm = ChatGoogleGenerativeAI(
    model="gemini-3-flash-preview",
    thinking_config={
        "thinking_level": "low",
        "include_thoughts": True,
    },
)

I hope this helps, if still not clear, then I would recommend opening a new thread since this one is already closed, and I would love to help you out.