@@ -1194,11 +1194,11 @@ async def test_generate_content_async_stream(
1194
1194
assert responses [2 ].content .role == "model"
1195
1195
assert responses [2 ].content .parts [0 ].text == "two:"
1196
1196
assert responses [3 ].content .role == "model"
1197
- assert responses [3 ].content .parts [0 ].function_call .name == "test_function"
1198
- assert responses [3 ].content .parts [0 ].function_call .args == {
1197
+ assert responses [3 ].content .parts [- 1 ].function_call .name == "test_function"
1198
+ assert responses [3 ].content .parts [- 1 ].function_call .args == {
1199
1199
"test_arg" : "test_value"
1200
1200
}
1201
- assert responses [3 ].content .parts [0 ].function_call .id == "test_tool_call_id"
1201
+ assert responses [3 ].content .parts [- 1 ].function_call .id == "test_tool_call_id"
1202
1202
mock_completion .assert_called_once ()
1203
1203
1204
1204
_ , kwargs = mock_completion .call_args
@@ -1257,11 +1257,11 @@ async def test_generate_content_async_stream_with_usage_metadata(
1257
1257
assert responses [2 ].content .role == "model"
1258
1258
assert responses [2 ].content .parts [0 ].text == "two:"
1259
1259
assert responses [3 ].content .role == "model"
1260
- assert responses [3 ].content .parts [0 ].function_call .name == "test_function"
1261
- assert responses [3 ].content .parts [0 ].function_call .args == {
1260
+ assert responses [3 ].content .parts [- 1 ].function_call .name == "test_function"
1261
+ assert responses [3 ].content .parts [- 1 ].function_call .args == {
1262
1262
"test_arg" : "test_value"
1263
1263
}
1264
- assert responses [3 ].content .parts [0 ].function_call .id == "test_tool_call_id"
1264
+ assert responses [3 ].content .parts [- 1 ].function_call .id == "test_tool_call_id"
1265
1265
1266
1266
assert responses [3 ].usage_metadata .prompt_token_count == 10
1267
1267
assert responses [3 ].usage_metadata .candidates_token_count == 5
0 commit comments