MCPcopy
hub / github.com/anthropics/anthropic-sdk-python / __init__

Method __init__

src/anthropic/_streaming.py:52–65  ·  view source on GitHub ↗
(
        self,
        *,
        cast_to: type[_T],
        response: httpx.Response,
        client: Anthropic,
        options: Optional[FinalRequestOptions] = None,
    )

Source from the content-addressed store, hash-verified

50 _decoder: SSEBytesDecoder
51
52 def __init__(
53 self,
54 *,
55 cast_to: type[_T],
56 response: httpx.Response,
57 client: Anthropic,
58 options: Optional[FinalRequestOptions] = None,
59 ) -> None:
60 self.response = response
61 self._cast_to = cast_to
62 self._client = client
63 self._options = options
64 self._decoder = client._make_sse_decoder()
65 self._iterator = self.__stream__()
66
67 def __next__(self) -> _T:
68 return self._iterator.__next__()

Callers

nothing calls this directly

Calls 2

__stream__Method · 0.95
_make_sse_decoderMethod · 0.45

Tested by

no test coverage detected