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
Fix OCI streaming (#13437)
breno-aumo7484a19edf1a
diff --git a/litellm/llms/oci/chat/transformation.py b/litellm/llms/oci/chat/transformation.pyindex 3524817da63..3e05473630d 100644--- a/litellm/llms/oci/chat/transformation.py+++ b/litellm/llms/oci/chat/transformation.py@@ -2,7 +2,7 @@ import base64import datetimeimport hashlibimport json-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union+from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, List, Optional, Tuple, Unionfrom urllib.parse import urlparseimport httpx@@ -586,8 +586,15 @@ class OCIChatConfig(BaseConfig):completion_stream = response.aiter_text()+ async def split_chunks(completion_stream: AsyncIterator[str]):+ async for item in completion_stream:+ for chunk in item.split("\n\n"):+ if not chunk:+ continue+ yield chunk.strip()+streaming_response = OCIStreamWrapper(- completion_stream=completion_stream,+ completion_stream=split_chunks(completion_stream),model=model,custom_llm_provider=custom_llm_provider,logging_obj=logging_obj,