mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
style: apply ruff format to responses system-text extraction
This commit is contained in:
parent
8330be3221
commit
7d279da7e1
1 changed files with 2 additions and 6 deletions
|
|
@ -516,15 +516,11 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
|
|||
return content
|
||||
if isinstance(content, list):
|
||||
if any(
|
||||
not isinstance(block, dict)
|
||||
or block.get("type") != "text"
|
||||
or "cache_control" in block
|
||||
not isinstance(block, dict) or block.get("type") != "text" or "cache_control" in block
|
||||
for block in content
|
||||
):
|
||||
return None
|
||||
text_parts: Final = tuple(
|
||||
block["text"] for block in content if isinstance(block.get("text"), str)
|
||||
)
|
||||
text_parts: Final = tuple(block["text"] for block in content if isinstance(block.get("text"), str))
|
||||
return "".join(text_parts) if text_parts else None
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue