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(azure_text.py): fix streaming parsing

Krrish Dholakia1b2f73c2202f
diff --git a/litellm/llms/azure_text.py b/litellm/llms/azure_text.py
index d8d7e9d1403..fb6e4875e27 100644
--- a/litellm/llms/azure_text.py
+++ b/litellm/llms/azure_text.py
@@ -446,9 +446,10 @@ class AzureTextCompletion(BaseLLM):
"complete_input_dict": data,
},
)
- response = azure_client.completions.with_raw_response.create(
+ raw_response = azure_client.completions.with_raw_response.create(
**data, timeout=timeout
)
+ response = raw_response.parse()
streamwrapper = CustomStreamWrapper(
completion_stream=response,
model=model,
@@ -506,9 +507,10 @@ class AzureTextCompletion(BaseLLM):
"complete_input_dict": data,
},
)
- response = await azure_client.completions.with_raw_response.create(
+ raw_response = await azure_client.completions.with_raw_response.create(
**data, timeout=timeout
)
+ response = raw_response.parse()
# return response
streamwrapper = CustomStreamWrapper(
completion_stream=response,