A streamed reply cut off in its text block, once `text` has arrived: the body ends there, or reading on raises `error`.
(
id: str, text: str, *, error: type[httpx2.TransportError] | None = None
)
| 490 | |
| 491 | |
| 492 | def interrupted_stream_response( |
| 493 | id: str, text: str, *, error: type[httpx2.TransportError] | None = None |
| 494 | ) -> httpx2.Response: |
| 495 | """A streamed reply cut off in its text block, once `text` has arrived: the body ends there, or reading on raises |
| 496 | `error`.""" |
| 497 | return httpx2.Response( |
| 498 | 200, headers={"content-type": "text/event-stream"}, content=_interrupted_sse_body(id, text, error) |
| 499 | ) |
| 500 | |
| 501 | |
| 502 | def async_interrupted_stream_response( |