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

Method __stream__

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

Source from the content-addressed store, hash-verified

113 yield sse
114
115 async def __stream__(self) -> AsyncIterator[_T]:
116 cast_to = cast(Any, self._cast_to)
117 response = self.response
118 process_data = self._client._process_response_data
119 iterator = self._iter_events()
120
121 async for sse in iterator:
122 yield process_data(data=sse.json(), cast_to=cast_to, response=response)
123
124 # Ensure the entire stream is consumed
125 async for _sse in iterator:
126 ...
127
128 async def __aenter__(self) -> Self:
129 return self

Callers 1

__init__Method · 0.95

Calls 2

_iter_eventsMethod · 0.95
jsonMethod · 0.45

Tested by

no test coverage detected