class_docstr: Provides the core interface to iterate over a synchronous stream response.
class_docstr_tok: ["Provides","the","core","interface","to","iterate","over","a","synchronous","stream","response","."]
code: def __init__(
      self,
      *,
      cast_to: type[_T],
      response: httpx.Response,
      client: OpenAI,
  ) -> None:
      self.response = response
      self._cast_to = cast_to
      self._client = client
      self._decoder = SSEDecoder()
      self._iterator = self.__stream__()
  
imports: from __future__ import annotations
  import json
  from types import TracebackType
  from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
  from typing_extensions import Self, override
  import httpx
  from ._utils import is_mapping
  from ._exceptions import APIError
label_desc: Use image node_id 1 to create a new Stream object from inherited base classes: Generic with example: obj = Stream()