8000 fix: liteLLM test failures · google/adk-python@88cd330 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 88cd330

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: liteLLM test failures
Fix liteLLM test failures for function call responses. PiperOrigin-RevId: 772199602
1 parent fe1d5aa commit 88cd330

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/unittests/models/test_litellm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,11 +1194,11 @@ async def test_generate_content_async_stream(
11941194
assert responses[2].content.role == "model"
11951195
assert responses[2].content.parts[0].text == "two:"
11961196
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 == {
11991199
"test_arg": "test_value"
12001200
}
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"
12021202
mock_completion.assert_called_once()
12031203

12041204
_, kwargs = mock_completion.call_args
@@ -1257,11 +1257,11 @@ async def test_generate_content_async_stream_with_usage_metadata(
12571257
assert responses[2].content.role == "model"
12581258
assert responses[2].content.parts[0].text == "two:"
12591259
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 == {
12621262
"test_arg": "test_value"
12631263
}
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"
12651265

12661266
assert responses[3].usage_metadata.prompt_token_count == 10
12671267
assert responses[3].usage_metadata.candidates_token_count == 5

0 commit comments

Comments
 (0)
0