MCPcopy
hub / github.com/openai/openai-python / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

28 _decoder: SSEBytesDecoder
29
30 def __init__(
31 self,
32 *,
33 cast_to: type[_T],
34 response: httpx.Response,
35 client: OpenAI,
36 options: Optional[FinalRequestOptions] = None,
37 ) -> None:
38 self.response = response
39 self._cast_to = cast_to
40 self._client = client
41 self._options = options
42 self._decoder = client._make_sse_decoder()
43 self._iterator = self.__stream__()
44
45 def __next__(self) -> _T:
46 return self._iterator.__next__()

Callers

nothing calls this directly

Calls 2

__stream__Method · 0.95
_make_sse_decoderMethod · 0.80

Tested by

no test coverage detected