Skip to content

Commit

Permalink
test: update test to handle gemini token counter change
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Feb 4, 2025
1 parent c8494ab commit 7ddb034
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/local_testing/test_stream_chunk_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_stream_chunk_builder_litellm_usage_chunks():

usage: litellm.Usage = Usage(
completion_tokens=27,
prompt_tokens=55,
prompt_tokens=50,
total_tokens=82,
completion_tokens_details=None,
prompt_tokens_details=None,
Expand All @@ -213,7 +213,9 @@ def test_stream_chunk_builder_litellm_usage_chunks():

# assert prompt tokens are the same

assert gemini_pt == stream_rebuilt_pt
assert (
gemini_pt == stream_rebuilt_pt
), f"Stream builder is not able to rebuild usage correctly. Got={stream_rebuilt_pt}, expected={gemini_pt}"


def test_stream_chunk_builder_litellm_mixed_calls():
Expand Down Expand Up @@ -730,6 +732,7 @@ def test_stream_chunk_builder_openai_audio_output_usage():
usage_dict == response_usage_dict
), f"\nExpected: {usage_dict}\nGot: {response_usage_dict}"


def test_stream_chunk_builder_empty_initial_chunk():
from litellm.litellm_core_utils.streaming_chunk_builder_utils import (
ChunkProcessor,
Expand Down

0 comments on commit 7ddb034

Please sign in to comment.