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