File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1138,6 +1138,28 @@ def test_message_to_generate_content_response_tool_call():
1138
1138
assert response .content .parts [0 ].function_call .id == "test_tool_call_id"
1139
1139
1140
1140
1141
+ def test_message_to_generate_content_response_with_reasoning_content ():
1142
+ message = ChatCompletionAssistantMessage (
1143
+ role = "assistant" ,
1144
+ reasoning_content = "Thinking step-by-step..." ,
1145
+ content = "Hello!" ,
1146
+ )
1147
+
1148
+ response = _message_to_generate_content_response (message )
1149
+ assert response .content .role == "model"
1150
+ assert len (response .content .parts ) == 2
1151
+
1152
+ # Check that thought part is created first
1153
+ thought_part = response .content .parts [0 ]
1154
+ assert thought_part .text == message ["reasoning_content" ]
1155
+ assert thought_part .thought is True
1156
+
1157
+ # Check that regular content follows
1158
+ text_part = response .content .parts [1 ]
1159
+ assert text_part .text == message ["content" ]
1160
+ assert text_part .thought is False
1161
+
1162
+
1141
1163
def test_get_content_text ():
1142
1164
parts = [types .Part .from_text (text = "Test text" )]
1143
1165
content = _get_content (parts )
You can’t perform that action at this time.
0 commit comments