From e52b64065041f9c013e64aa970996d0bf1568479 Mon Sep 17 00:00:00 2001 From: Drew Afromsky Date: Mon, 2 Mar 2026 21:09:58 +0000 Subject: [PATCH] Fix issue 4680 --- tests/unittests/models/test_litellm.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/unittests/models/test_litellm.py b/tests/unittests/models/test_litellm.py index 8e353efb21..6f83393682 100644 --- a/tests/unittests/models/test_litellm.py +++ b/tests/unittests/models/test_litellm.py @@ -2819,7 +2819,12 @@ def test_to_litellm_role(): "content": "this is a test", } } - ] + ], + usage={ + "prompt_tokens": 0, + "completion_tokens": 0, + "total_tokens": 0, + }, ), [TextChunk(text="this is a test")], UsageMetadataChunk( @@ -2877,7 +2882,14 @@ def test_to_litellm_role(): (None, "stop"), ), ( - ModelResponse(choices=[{"finish_reason": "tool_calls"}]), + ModelResponse( + choices=[{"finish_reason": "tool_calls"}], + usage={ + "prompt_tokens": 0, + "completion_tokens": 0, + "total_tokens": 0, + }, + ), [None], UsageMetadataChunk( prompt_tokens=0, completion_tokens=0, total_tokens=0 @@ -2885,7 +2897,14 @@ def test_to_litellm_role(): "tool_calls", ), ( - ModelResponse(choices=[{}]), + ModelResponse( + choices=[{}], + usage={ + "prompt_tokens": 0, + "completion_tokens": 0, + "total_tokens": 0, + }, + ), [None], UsageMetadataChunk( prompt_tokens=0, completion_tokens=0, total_tokens=0