File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments