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: perplexity return both delta and message cause OpenWebUI repect text (#9081)

5aaee942b7921ca109
diff --git a/litellm/types/utils.py b/litellm/types/utils.py
index 8b1385cf1c2..dbc555b0c20 100644
--- a/litellm/types/utils.py
+++ b/litellm/types/utils.py
@@ -836,6 +836,10 @@ class StreamingChoices(OpenAIObject):
self.finish_reason = None
self.index = index
if delta is not None:
+ # Fix Perplexity return both delta and message cause OpenWebUI repect text
+ # https://github.com/BerriAI/litellm/issues/8455
+ if 'message' in params:
+ del self.message
if isinstance(delta, Delta):
self.delta = delta
elif isinstance(delta, dict):