mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix(anthropic): guard against non-dict messages in strip_advisor_blocks_from_messages
This commit is contained in:
parent
082f0afb83
commit
011e087939
1 changed files with 1 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue