Skip to content

Thinking config for 2.5 models #1018

Closed
Closed

Description

@Alexheqingli

When using planner=BuiltInPlanner(thinking_config=types.ThinkingConfig(thinking_budget=1024)) with the new 2.5 models, now we got an error - 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Unable to submit request because thinking is a default and constant feature of this model; To proceed, please remove the thinking_config.thinking_budget setting from your configuration and retry. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini', 'status': 'INVALID_ARGUMENT'}}.

How should we set thinking config for an agent now? Thanks.

Activity

  1. added
    models[Component] This issue is related to model support
    on May 29, 2025
  2. added theissue type on May 29, 2025
  3. edelweiss-group commented on Jun 1, 2025

    @edelweiss-group

    +1

  4. cirovas commented on Jun 7, 2025

    @cirovas

    +1

  5. lupuletic commented on Jun 16, 2025

    @lupuletic
    Contributor

    has anyone figured this one out yet? trying to use flash 2.5, but the default thinking adds unwanted latency ...

  6. cirovas commented on Jun 16, 2025

    @cirovas

    +1

    The update adk version is working, but I’ve noticed from the logs that the thinking tokens exceed the budget I set.

  7. andrewburtnett commented on Jun 22, 2025

    @andrewburtnett

    +1

  8. ksglmehmet commented on Jun 23, 2025

    @ksglmehmet

    +1

  9. maxbaluev commented on Jun 25, 2025

    @maxbaluev

    +1

  10. stefanadelbert commented on Jun 26, 2025

    @stefanadelbert

    I'm seeing the thought tokens exceed the thinking budget too with adk 1.5.0 when using Gemini 2.5 Flash.

    Input

    ...
        "temperature": 0,
        "response_mime_type": "application/json",
        "thinking_config": {
          "thinking_budget": 4096
        }
      },
      "contents": [
        {
          "parts": [
            {
              "text": "Follow the system instructions"
            }
          ],
          "role": "user"
        },
        {
    ...
    

    Output

    ...
        "role": "model"
      },
      "usage_metadata": {
        "candidates_token_count": 2786,
        "prompt_token_count": 15203,
        "prompt_tokens_details": [
          {
            "modality": "TEXT",
            "token_count": 2045
          },
          {
            "modality": "DOCUMENT",
            "token_count": 13158
          }
        ],
        "thoughts_token_count": 7083,
        "total_token_count": 25072
      }
    }
    

    Note that thinking_budget is 4096, but thoughts_token_count is greater (7083).

  11. surajksharma07 commented on Oct 7, 2025

    @surajksharma07
    Collaborator

    Hi @Alexheqingli and thanks to everyone who participated in this thread.

    We're currently doing some housekeeping on our issue tracker. Given the rapid pace of development and the number of updates since this was last active, there's a good chance this issue has been resolved in a newer version. To help us keep our backlog focused on current issues, we are closing this as stale.

    If you're still facing this problem, could you please update to the very latest version of the library and confirm the issue still exists? If it does, please comment here, and we will be happy to reopen this issue and investigate further.

    Thanks for your contribution and understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

models[Component] This issue is related to model support

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions