mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-01 02:02:20 +00:00
style: apply ruff format to the anthropic stream changes
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
38ee5f1c54
commit
13377dfc48
2 changed files with 12 additions and 4 deletions
|
|
@ -1206,7 +1206,9 @@ class AnthropicSSEStream(AsyncIterator[bytes]):
|
|||
def __init__(self, anthropic_wrapper: AnthropicStreamWrapper) -> None:
|
||||
self._anthropic_wrapper = anthropic_wrapper
|
||||
self._byte_stream: Final[AsyncIterator[bytes]] = anthropic_wrapper.async_anthropic_sse_wrapper()
|
||||
self._hidden_params: dict[str, object] = {} # mutable-ok: the proxy merges provider headers onto _hidden_params in place
|
||||
self._hidden_params: dict[
|
||||
str, object
|
||||
] = {} # mutable-ok: the proxy merges provider headers onto _hidden_params in place
|
||||
|
||||
@property
|
||||
def chunks(self) -> list | None:
|
||||
|
|
|
|||
|
|
@ -637,15 +637,21 @@ class FallbackAwareAnthropicMessagesStream:
|
|||
|
||||
@property
|
||||
def chunks(self) -> list | None:
|
||||
return cast("list | None", getattr(self._source_iterator, "chunks", None)) # cast-ok: the billing helper itself treats chunks as an opaque getattr
|
||||
return cast(
|
||||
"list | None", getattr(self._source_iterator, "chunks", None)
|
||||
) # cast-ok: the billing helper itself treats chunks as an opaque getattr
|
||||
|
||||
@property
|
||||
def messages(self) -> list | None:
|
||||
return cast("list | None", getattr(self._source_iterator, "messages", None)) # cast-ok: messages is a plain list on the inner stream
|
||||
return cast(
|
||||
"list | None", getattr(self._source_iterator, "messages", None)
|
||||
) # cast-ok: messages is a plain list on the inner stream
|
||||
|
||||
@property
|
||||
def model(self) -> str | None:
|
||||
return cast("str | None", getattr(self._source_iterator, "model", None)) # cast-ok: model is a str on the inner stream
|
||||
return cast(
|
||||
"str | None", getattr(self._source_iterator, "model", None)
|
||||
) # cast-ok: model is a str on the inner stream
|
||||
|
||||
def adopt_fallback_source(self, fallback_response: object) -> None:
|
||||
self._source_iterator = fallback_response
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue