mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(anthropic): satisfy basedpyright loop binding rules
This commit is contained in:
parent
a62b79b90c
commit
cb8d5f42d8
2 changed files with 3 additions and 3 deletions
|
|
@ -2407,7 +2407,7 @@ def anthropic_messages_pt(
|
|||
) = messages[msg_i]
|
||||
if user_message_types_block["role"] == "user":
|
||||
if isinstance(user_message_types_block["content"], list):
|
||||
user_content_start: Final = len(user_content)
|
||||
user_content_start: int = len(user_content)
|
||||
for m in user_message_types_block["content"]:
|
||||
if m.get("type", "") == "image_url":
|
||||
m = cast(ChatCompletionImageObject, m)
|
||||
|
|
@ -2691,7 +2691,7 @@ def anthropic_messages_pt(
|
|||
): # IMPORTANT: ADD THIS FIRST, ELSE ANTHROPIC WILL RAISE AN ERROR
|
||||
assistant_content.extend(thinking_blocks)
|
||||
if _content_is_list and _content_list is not None:
|
||||
assistant_content_start: Final = len(assistant_content)
|
||||
assistant_content_start: int = len(assistant_content)
|
||||
for m in _content_list:
|
||||
if not isinstance(m, dict):
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -1719,7 +1719,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
anthropic_system_message_content["cache_control"] = system_message_block["cache_control"]
|
||||
anthropic_system_message_list.append(anthropic_system_message_content)
|
||||
elif isinstance(message["content"], list):
|
||||
content_start: Final = len(anthropic_system_message_list)
|
||||
content_start: int = len(anthropic_system_message_list)
|
||||
for _content in message["content"]:
|
||||
# Skip empty text blocks - Anthropic API raises errors for empty text
|
||||
text_value = _content.get("text")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue