mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(anthropic): satisfy basedpyright on document block path
This commit is contained in:
parent
aab5a3cf91
commit
9f1b470eeb
1 changed files with 4 additions and 4 deletions
|
|
@ -2421,12 +2421,12 @@ def anthropic_messages_pt(
|
|||
url_str = (
|
||||
image_url_value.get("url") if isinstance(image_url_value, dict) else image_url_value
|
||||
)
|
||||
if isinstance(url_str, str) and _is_anthropic_document_data_uri(url_str):
|
||||
image_chunk: Final = convert_to_anthropic_image_obj(
|
||||
if isinstance(url_str, str) and _is_anthropic_document_data_uri(url_str): # pyright: ignore[reportUnnecessaryIsInstance] # malformed payloads can carry a non-str url
|
||||
image_chunk = convert_to_anthropic_image_obj(
|
||||
openai_image_url=url_str,
|
||||
format=None,
|
||||
)
|
||||
_document_content_element: Final = AnthropicMessagesDocumentParam(
|
||||
_document_content_element = AnthropicMessagesDocumentParam(
|
||||
type="document",
|
||||
source=AnthropicContentParamSource(
|
||||
type="base64",
|
||||
|
|
@ -2436,7 +2436,7 @@ def anthropic_messages_pt(
|
|||
)
|
||||
add_cache_control_to_content(
|
||||
anthropic_content_element=_document_content_element,
|
||||
original_content_element=m,
|
||||
original_content_element=m, # pyright: ignore[reportArgumentType] # cache_control lives on the block
|
||||
)
|
||||
user_content.append(_document_content_element)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue