Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(responses): assert the streamed response.completed event echoes the named tool_choice

mateo-berri7563d94e6559
diff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py b/tests/test_litellm/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py
index 29061db97dc..70f0957890d 100644
--- a/tests/test_litellm/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py
+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py
@@ -679,6 +679,9 @@ def test_streamed_named_tool_choice_is_echoed_in_responses_api_shape() -> None:
"response.in_progress",
"response.completed",
]
- assert response_events[0].response.tool_choice == {"type": "function", "name": "run_command"}
- assert response_events[1].response.tool_choice == {"type": "function", "name": "run_command"}
+ assert [event.response.tool_choice for event in response_events] == [
+ {"type": "function", "name": "run_command"},
+ {"type": "function", "name": "run_command"},
+ {"type": "function", "name": "run_command"},
+ ]
assert any(getattr(event, "type", None) == "response.output_item.done" for event in events)