This commit is contained in:
Sameer Kankute 2026-05-27 22:07:58 +05:30
parent aad5df50a0
commit df066014ae
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View file

@ -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."""

View file

@ -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: "

View file

@ -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]]],
]: