| 435 | |
| 436 | |
| 437 | def async_stream_response( |
| 438 | id: str, |
| 439 | text: str = "Hello there!", |
| 440 | *, |
| 441 | tool_use_id: str | None = None, |
| 442 | container: str | None = None, |
| 443 | stop_reason: str | None = None, |
| 444 | iterations: list[Any] | None = None, |
| 445 | ) -> httpx2.Response: |
| 446 | return httpx2.Response( |
| 447 | 200, |
| 448 | headers={"content-type": "text/event-stream"}, |
| 449 | content=to_async_iter( |
| 450 | _sse_body( |
| 451 | id, text, tool_use_id=tool_use_id, container=container, stop_reason=stop_reason, iterations=iterations |
| 452 | ) |
| 453 | ), |
| 454 | ) |
| 455 | |
| 456 | |
| 457 | def partial_tool_use_stream_response(id: str, text: str, *, tool_use_id: str) -> httpx2.Response: |