(
content: Iterator[bytes],
*,
sync: bool,
client: Anthropic,
async_client: AsyncAnthropic,
)
| 264 | await iter_next(iter) |
| 265 | |
| 266 | |
| 267 | def make_event_iterator( |
| 268 | content: Iterator[bytes], |
| 269 | *, |
| 270 | sync: bool, |
| 271 | client: Anthropic, |
| 272 | async_client: AsyncAnthropic, |
| 273 | ) -> Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]: |
| 274 | if sync: |
| 275 | return Stream(cast_to=object, client=client, response=httpx.Response(200, content=content))._iter_events() |
| 276 | |
| 277 | return AsyncStream( |
| 278 | cast_to=object, client=async_client, response=httpx.Response(200, content=to_aiter(content)) |
| 279 | )._iter_events() |
| 280 | |
| 281 |
no test coverage detected