test(anthropic): expect no leading empty text block

This commit is contained in:
milo 2026-05-23 00:23:56 +08:00
parent 03ce59394a
commit d2d096f88a

View file

@ -2,7 +2,6 @@ import os
import sys
from typing import List
sys.path.insert(0, os.path.abspath("../../../../.."))
from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (
@ -134,13 +133,6 @@ def test_anthropic_stream_wrapper_single_tool_call():
# Verify the expected sequence of chunk types
expected_types = [
"message_start", # Initial message start
# TODO: for future contributors: if the initial content_block_start
# respects the upstream's starting chunk, the initial empty text block
# should be removed (and this test should be updated accordingly)
# ---------------------------------------------------------------------
"content_block_start", # Initial empty text block start
"content_block_stop", # End of empty text block
# ---------------------------------------------------------------------
"content_block_start", # Start of first tool_use content block
"content_block_delta", # {"city":
"content_block_delta", # "NY"}
@ -196,13 +188,6 @@ def test_anthropic_stream_wrapper_back_to_back_tool_calls():
# Verify the expected sequence of chunk types
expected_types = [
"message_start", # Initial message start
# TODO: for future contributors: if the initial content_block_start
# respects the upstream's starting chunk, the initial empty text block
# should be removed (and this test should be updated accordingly)
# ---------------------------------------------------------------------
"content_block_start", # Initial empty text block start
"content_block_stop", # End of empty text block
# ---------------------------------------------------------------------
"content_block_start", # Start of first tool_use content block
"content_block_delta", # {"city":
"content_block_delta", # "NY"}
@ -267,13 +252,6 @@ def test_anthropic_stream_wrapper_interleaved_tool_calls_and_text():
# Verify the expected sequence of chunk types
expected_types = [
"message_start", # Initial message start
# TODO: for future contributors: if the initial content_block_start
# respects the upstream's starting chunk, the initial empty text block
# should be removed (and this test should be updated accordingly)
# ---------------------------------------------------------------------
"content_block_start", # Initial empty text block start
"content_block_stop", # End of empty text block
# ---------------------------------------------------------------------
"content_block_start", # Start of first tool_use content block
"content_block_delta", # {"city":
"content_block_delta", # "NY"}