Skip to content

fix: preserve Gemini thinking blocks#5713

Open
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/gemini-thinking-block-signatures
Open

fix: preserve Gemini thinking blocks#5713
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/gemini-thinking-block-signatures

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • recognize Gemini-shaped thinking_blocks even when blocks do not carry Anthropic-style per-block signatures
  • merge LiteLLM's parallel provider_specific_fields.thought_signatures into those blocks before converting them to ADK thought parts
  • add regression coverage for Gemini blocks with and without signatures, plus the generated response conversion path

Fixes #5712.

To verify

  • python -m pytest tests/unittests/models/test_litellm.py -q -k "thinking_blocks or thought_signature" --basetemp .tmp/pytest
  • python -m pytest tests/unittests/models/test_litellm.py -q --basetemp .tmp/pytest
  • python -m py_compile src/google/adk/models/lite_llm.py tests/unittests/models/test_litellm.py
  • python -m pyink --check src/google/adk/models/lite_llm.py tests/unittests/models/test_litellm.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LiteLLM] _is_thinking_blocks_format drops Gemini thinking_blocks (only matches Anthropic 'signature' key)

1 participant