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

1 Like