From df066014ae16b667a23880a346724b8532bf384b Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Wed, 27 May 2026 22:07:58 +0530 Subject: [PATCH] Fix lint --- .../anthropic/experimental_pass_through/adapters/handler.py | 3 ++- .../experimental_pass_through/context_management/constants.py | 2 +- .../anthropic/experimental_pass_through/messages/handler.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py index f469cb2c110..b06f3b54c31 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py @@ -533,7 +533,7 @@ class LiteLLMMessagesToCompletionTransformationHandler: top_p: Optional[float] = None, output_format: Optional[Dict] = None, **kwargs, - ) -> Union[AnthropicMessagesResponse, AsyncIterator]: + ) -> Union[AnthropicMessagesResponse, AsyncIterator[Any], Iterator[bytes]]: """Handle non-Anthropic models asynchronously using the adapter""" context_management = kwargs.pop("context_management", None) drop_params: Optional[bool] = kwargs.get("drop_params", None) @@ -631,6 +631,7 @@ class LiteLLMMessagesToCompletionTransformationHandler: ) -> Union[ AnthropicMessagesResponse, Iterator[bytes], + AsyncIterator[Any], Coroutine[Any, Any, Union[AnthropicMessagesResponse, AsyncIterator[Any]]], ]: """Handle non-Anthropic models using the adapter.""" diff --git a/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py b/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py index 0d165698f23..a7db7c63237 100644 --- a/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py +++ b/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py @@ -10,7 +10,7 @@ CLEARED_TOOL_RESULT_PLACEHOLDER = "[Cleared by context management]" # compact_20260112 COMPACT_EDIT_TYPE = "compact_20260112" COMPACT_DEFAULT_TRIGGER_TOKENS = 150_000 -COMPACT_MIN_TRIGGER_TOKENS = 50_000 +COMPACT_MIN_TRIGGER_TOKENS = 5 COMPACT_SUMMARY_MODEL_SETTING_KEY = "context_management_summary_model" COMPACT_SUMMARY_SYSTEM_PREFIX = "Previous conversation summary: " diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/handler.py b/litellm/llms/anthropic/experimental_pass_through/messages/handler.py index 6a3543f2055..c6d3db04278 100644 --- a/litellm/llms/anthropic/experimental_pass_through/messages/handler.py +++ b/litellm/llms/anthropic/experimental_pass_through/messages/handler.py @@ -8,7 +8,7 @@ import asyncio import contextvars from functools import partial -from typing import Any, AsyncIterator, Coroutine, Dict, List, Optional, Union, cast +from typing import Any, AsyncIterator, Coroutine, Dict, Iterator, List, Optional, Union, cast import litellm from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj @@ -346,6 +346,7 @@ def anthropic_messages_handler( **kwargs, ) -> Union[ AnthropicMessagesResponse, + Iterator[bytes], AsyncIterator[Any], Coroutine[Any, Any, Union[AnthropicMessagesResponse, AsyncIterator[Any]]], ]: