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]

fix: forward eager_input_streaming through the Responses API tool bridge

mateo-berrie5fd2bec832b
diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py
index 01fb6cb483d..0d1297f63e2 100644
--- a/litellm/responses/litellm_completion_transformation/transformation.py
+++ b/litellm/responses/litellm_completion_transformation/transformation.py
@@ -2020,6 +2020,8 @@ class LiteLLMCompletionResponsesConfig:
chat_completion_tool["allowed_callers"] = tool.get("allowed_callers")
if tool.get("input_examples"):
chat_completion_tool["input_examples"] = tool.get("input_examples")
+ if tool.get("eager_input_streaming") is not None:
+ chat_completion_tool["eager_input_streaming"] = tool.get("eager_input_streaming")
return ResponsesToolChatForm(
chat_tools=(cast(ChatCompletionToolParam, chat_completion_tool),), web_search_options=None
)
@@ -2096,6 +2098,8 @@ class LiteLLMCompletionResponsesConfig:
responses_tool["allowed_callers"] = tool.get("allowed_callers")
if tool.get("input_examples") is not None:
responses_tool["input_examples"] = tool.get("input_examples")
+ if tool.get("eager_input_streaming") is not None:
+ responses_tool["eager_input_streaming"] = tool.get("eager_input_streaming")
result.append(responses_tool)
else:
# mcp or other: pass through unchanged
diff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py b/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py
index 0ed101952be..f1924b87a20 100644
--- a/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py
+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py
@@ -1900,6 +1900,38 @@ class TestToolTransformation:
assert "defer_loading" not in result_tool
assert "allowed_callers" not in result_tool
assert "input_examples" not in result_tool
+ assert "eager_input_streaming" not in result_tool
+
+ @pytest.mark.parametrize("eager_input_streaming", [True, False])
+ def test_transform_function_tools_forwards_eager_input_streaming(self, eager_input_streaming: bool) -> None:
+ function_tool: Final = {
+ "type": "function",
+ "name": "write_file",
+ "parameters": {"type": "object", "properties": {"path": {"type": "string"}}},
+ "eager_input_streaming": eager_input_streaming,
+ }
+
+ result_tools, _ = LiteLLMCompletionResponsesConfig.transform_responses_api_tools_to_chat_completion_tools(
+ tools=[function_tool]
+ )
+
+ assert result_tools[0]["eager_input_streaming"] is eager_input_streaming
+
+ @pytest.mark.parametrize("eager_input_streaming", [True, False])
+ def test_chat_completion_tools_to_responses_tools_keeps_eager_input_streaming(
+ self, eager_input_streaming: bool
+ ) -> None:
+ chat_tool: Final = {
+ "type": "function",
+ "function": {"name": "write_file", "parameters": {"type": "object"}},
+ "eager_input_streaming": eager_input_streaming,
+ }
+
+ result_tools: Final = LiteLLMCompletionResponsesConfig.transform_chat_completion_tool_params_to_responses_api_tools(
+ [chat_tool]
+ )
+
+ assert result_tools[0]["eager_input_streaming"] is eager_input_streaming
def test_transform_code_execution_tools(self):
"""Test that code_execution tools are passed through as-is"""