From f6d53dcb1810767f42d638c7f8703a5f4e58087b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 18 Mar 2026 01:41:32 +0000 Subject: [PATCH] fix: format merged files from main and regenerate poetry.lock Co-authored-by: Ishaan Jaff --- .../prompt_templates/factory.py | 16 +++++++++++++--- .../response_polling/background_streaming.py | 5 ++++- poetry.lock | 8 ++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index 2b838ad1f80..f6004616712 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -2442,7 +2442,9 @@ def anthropic_messages_pt( # noqa: PLR0915 _document_content_element = cast( AnthropicMessagesDocumentParam, add_cache_control_to_content( - anthropic_content_element=cast(AnthropicMessagesDocumentParam, m), + anthropic_content_element=cast( + AnthropicMessagesDocumentParam, m + ), original_content_element=dict(m), ), ) @@ -2454,10 +2456,18 @@ def anthropic_messages_pt( # noqa: PLR0915 ) ) _file_content_element = add_cache_control_to_content( - anthropic_content_element=cast(AnthropicMessagesDocumentParam, _file_content_element), + anthropic_content_element=cast( + AnthropicMessagesDocumentParam, + _file_content_element, + ), original_content_element=dict(m), ) - user_content.append(cast(AnthropicMessagesDocumentParam,_file_content_element)) + user_content.append( + cast( + AnthropicMessagesDocumentParam, + _file_content_element, + ) + ) elif isinstance(user_message_types_block["content"], str): _anthropic_content_text_element: AnthropicMessagesTextParam = { "type": "text", diff --git a/litellm/proxy/response_polling/background_streaming.py b/litellm/proxy/response_polling/background_streaming.py index 654453ed666..7583f30eb2d 100644 --- a/litellm/proxy/response_polling/background_streaming.py +++ b/litellm/proxy/response_polling/background_streaming.py @@ -261,7 +261,10 @@ async def background_streaming_task( # noqa: PLR0915 ) # Extract error for failed and incomplete responses - if event_type == "response.failed" or event_type == "response.incomplete": + if ( + event_type == "response.failed" + or event_type == "response.incomplete" + ): terminal_error = response_data.get("error") # Core response fields diff --git a/poetry.lock b/poetry.lock index 9ede2f8e2ec..be87e51f801 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3222,15 +3222,15 @@ files = [ [[package]] name = "litellm-proxy-extras" -version = "0.4.56" +version = "0.4.57" description = "Additional files for the LiteLLM Proxy. Reduces the size of the main litellm package." optional = true python-versions = "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8" groups = ["main"] markers = "extra == \"proxy\"" files = [ - {file = "litellm_proxy_extras-0.4.56-py3-none-any.whl", hash = "sha256:52dbe3b5358c790e77e12f1ec5ef8e7508b383c2aaf41299750b6fb400908ee7"}, - {file = "litellm_proxy_extras-0.4.56.tar.gz", hash = "sha256:63ad59baa0defccc5c929cfd933ee7e32a6614b0fc5fa0fc45a12d7608e33f08"}, + {file = "litellm_proxy_extras-0.4.57-py3-none-any.whl", hash = "sha256:04538223cd80318a72d70c6e10f701598e58c763368296a6503c674c92fbdb62"}, + {file = "litellm_proxy_extras-0.4.57.tar.gz", hash = "sha256:ef9b95dc42237614216833bd5d46ebf9dea1caa5ea14ea1a66d7f7842b224ec2"}, ] [[package]] @@ -8003,4 +8003,4 @@ utils = ["numpydoc"] [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "1f3bbf967451633fb6290ba88980bdf4fbf83420024b14e862d1da717d903684" +content-hash = "22cdc8096e0c8296827734393f5ab6e66088f397b5295caa1d277466d1fde1e8"