Skip to content

Commit 793880f

Browse files
committed
chore: finalize LiteLLM anthropic rebase resolution
1 parent bfe1db2 commit 793880f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/google/adk/models/lite_llm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ def _convert_reasoning_value_to_parts(reasoning_value: Any) -> List[types.Part]:
428428
signature = block.get("signature")
429429
if signature:
430430
decoded_signature = _decode_thought_signature(signature)
431-
part.thought_signature = (
432-
decoded_signature or str(signature).encode("utf-8")
433-
)
431+
part.thought_signature = decoded_signature or str(
432+
signature
433+
).encode("utf-8")
434434
parts.append(part)
435435
continue
436436
# Fall back to text extraction for non-thinking-block items.

tests/unittests/models/test_litellm.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4836,13 +4836,11 @@ async def test_content_to_message_param_anthropic_outputs_thinking_blocks():
48364836
content, model="anthropic/claude-4-sonnet"
48374837
)
48384838
assert result["role"] == "assistant"
4839-
assert result["thinking_blocks"] == [
4840-
{
4841-
"type": "thinking",
4842-
"thinking": "deep thought",
4843-
"signature": "sig_round_trip",
4844-
}
4845-
]
4839+
assert result["thinking_blocks"] == [{
4840+
"type": "thinking",
4841+
"thinking": "deep thought",
4842+
"signature": "sig_round_trip",
4843+
}]
48464844
assert result.get("reasoning_content") is None
48474845
assert result["content"] == "Hello!"
48484846

0 commit comments

Comments
 (0)