This commit is contained in:
Sameer Kankute 2026-05-27 22:31:02 +05:30
parent 55d702bd1c
commit f74a0599a1
No known key found for this signature in database
3 changed files with 11 additions and 4 deletions

View file

@ -10,7 +10,7 @@ This is an __init__.py file to allow the following interface
"""
from typing import Any, AsyncIterator, Coroutine, Dict, List, Optional, Union
from typing import Any, AsyncIterator, Coroutine, Dict, Iterator, List, Optional, Union
from litellm.llms.anthropic.experimental_pass_through.messages.handler import (
anthropic_messages as _async_anthropic_messages,
@ -100,8 +100,11 @@ def create(
**kwargs,
) -> Union[
AnthropicMessagesResponse,
Iterator[bytes],
AsyncIterator[Any],
Coroutine[Any, Any, Union[AnthropicMessagesResponse, AsyncIterator[Any]]],
Coroutine[
Any, Any, Union[AnthropicMessagesResponse, AsyncIterator[Any], Iterator[bytes]]
],
]:
"""
Async wrapper for Anthropic's messages API

View file

@ -632,7 +632,11 @@ class LiteLLMMessagesToCompletionTransformationHandler:
AnthropicMessagesResponse,
Iterator[bytes],
AsyncIterator[Any],
Coroutine[Any, Any, Union[AnthropicMessagesResponse, AsyncIterator[Any]]],
Coroutine[
Any,
Any,
Union[AnthropicMessagesResponse, AsyncIterator[Any], Iterator[bytes]],
],
]:
"""Handle non-Anthropic models using the adapter."""
if _is_async is True:

View file

@ -199,7 +199,7 @@ async def anthropic_messages(
client: Optional[AsyncHTTPHandler] = None,
custom_llm_provider: Optional[str] = None,
**kwargs,
) -> Union[AnthropicMessagesResponse, AsyncIterator]:
) -> Union[AnthropicMessagesResponse, Iterator[bytes], AsyncIterator[Any]]:
"""
Async: Make llm api request in Anthropic /messages API spec.