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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
ResponsesAPIStreamingResponse
Ishaan Jaff8da714104b31
diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.pyindex 4c0be0014dc..f9e9a7a3344 100644--- a/litellm/types/llms/openai.py+++ b/litellm/types/llms/openai.py@@ -756,3 +756,8 @@ class ResponsesAPIResponse(TypedDict, total=False):truncation: Optional[Literal["auto", "disabled"]]usage: Optional[ResponseUsage]user: Optional[str]+++class ResponsesAPIStreamingResponse(TypedDict, total=False):+ type: str+ response: ResponsesAPIResponsediff --git a/tests/llm_responses_api_testing/test_openai_responses_api.py b/tests/llm_responses_api_testing/test_openai_responses_api.pyindex dc4f9308ef2..59024716d79 100644--- a/tests/llm_responses_api_testing/test_openai_responses_api.py+++ b/tests/llm_responses_api_testing/test_openai_responses_api.py@@ -16,3 +16,16 @@ async def test_basic_openai_responses_api():print("litellm response=", json.dumps(response, indent=4, default=str))# validate_responses_api_response()+++async def test_basic_openai_responses_api_streaming():+ litellm._turn_on_debug()+ response = await litellm.aresponses(+ model="gpt-4o",+ input="Tell me a three sentence bedtime story about a unicorn.",+ stream=True,+ )++ for event in response:+ print("litellm response=", json.dumps(event, indent=4, default=str))