mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 16:19:45 +00:00
fix(anthropic): guard against non-dict messages in strip_advisor_blocks_from_messages
This commit is contained in:
@@ -650,7 +650,7 @@ def strip_advisor_blocks_from_messages(messages: List[Any]) -> List[Any]:
|
||||
control or on a follow-up turn.
|
||||
"""
|
||||
for message in messages:
|
||||
if message.get("role") != "assistant":
|
||||
if not isinstance(message, dict) or message.get("role") != "assistant":
|
||||
continue
|
||||
content = message.get("content")
|
||||
if not isinstance(content, list):
|
||||
|
||||
Reference in New Issue
Block a user