MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / __stream__

Method __stream__

src/opencode_ai/_streaming.py:51–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

49 yield from self._decoder.iter_bytes(self.response.iter_bytes())
50
51 def __stream__(self) -> Iterator[_T]:
52 cast_to = cast(Any, self._cast_to)
53 response = self.response
54 process_data = self._client._process_response_data
55 iterator = self._iter_events()
56
57 for sse in iterator:
58 yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59
60 # Ensure the entire stream is consumed
61 for _sse in iterator:
62 ...
63
64 def __enter__(self) -> Self:
65 return self

Callers 1

__init__Method · 0.95

Calls 2

_iter_eventsMethod · 0.95
jsonMethod · 0.45

Tested by

no test coverage detected