mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Fix whitespace handling in _has_meaningful_content function
• Preserve newlines and spaces as content • Remove .strip() call on strings • Treat all non-empty strings as meaningful • Update logic comment for clarity • Fix edge case with whitespace-only text
This commit is contained in:
parent
94a89cd7de
commit
8b95cd3ed2
1 changed files with 3 additions and 1 deletions
|
|
@ -84,7 +84,9 @@ def _has_meaningful_content(value: Any) -> bool:
|
|||
return False
|
||||
|
||||
if 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) > 0
|
||||
|
||||
if isinstance(value, (list, dict)):
|
||||
return len(value) > 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue