mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
fix(anthropic): use generator expression to stay within LIT002 budget
This commit is contained in:
parent
a83e59af55
commit
b0735eef2e
1 changed files with 2 additions and 2 deletions
|
|
@ -293,13 +293,13 @@ class LiteLLMAnthropicToResponsesAPIAdapter:
|
|||
elif isinstance(inner, str):
|
||||
output_text = inner
|
||||
elif isinstance(inner, list):
|
||||
parts = [
|
||||
parts = (
|
||||
c.get("text", "")
|
||||
if c.get("type") == "text"
|
||||
else f"[Loaded tool: {c.get('tool_name', '')}]"
|
||||
for c in inner
|
||||
if isinstance(c, dict) and c.get("type") in {"text", "tool_reference"}
|
||||
]
|
||||
)
|
||||
output_text = "\n".join(parts)
|
||||
image_candidates = tuple(
|
||||
self._translate_anthropic_image_source_to_url(c.get("source"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue