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 whitespace handling in _has_meaningful_content function
yangdx8b95cd3ed25c
diff --git a/litellm/litellm_core_utils/model_response_utils.py b/litellm/litellm_core_utils/model_response_utils.pyindex 5f6fced9d44..974d12aef6f 100644--- a/litellm/litellm_core_utils/model_response_utils.py+++ b/litellm/litellm_core_utils/model_response_utils.py@@ -84,7 +84,9 @@ def _has_meaningful_content(value: Any) -> bool:return Falseif isinstance(value, str):- return len(value.strip()) > 0+ # Don't strip whitespace - preserve all content including newlines, spaces, etc.+ # Even pure whitespace characters like '\n' or ' ' are meaningful content+ return len(value) > 0if isinstance(value, (list, dict)):return len(value) > 0