Skip to content

Support for thinking_level on ThinkingConfig generative_service #14941

@fvalencia

Description

@fvalencia

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

Context
langchain_google_genai added the support for thinking_level (you can see here), But this library uses GenerationConfig from google.ai.generativelanguage_v1beta.types when preparing the request to google, the issue is that it causes this method to break because currently:

GenerationConfigThinkingConfig does not support thinking_level making impossible to use different thinking levels on the requests to Gemini 3 models.

generative_service.py

Expected Behavior:
You should be able to provide a thinking_level field to ThinkingConfig to utilize the latest Gemini 3 models.

Actual Behavior:
You get an error when providing thinking_level to ThinkingConfig because it currently does not support that field.

API client name and version

google-ai-generativelanguage v0.9.0

Reproduction steps: code

file: main.py

   from google.ai.generativelanguage_v1beta.types import GenerationConfig

   def reproduce():
     gen_config = { ... , "thinking_config" : { "thinking_level": "high" } }
     GenerationConfig(**gen_config)
    

OS & version + platform

No response

Python environment

Python 3.13.17

Python dependencies

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions