(headers?: Record<string, string>, signal?: AbortSignal)
| 774 | }) |
| 775 | |
| 776 | function streamRequest(headers?: Record<string, string>, signal?: AbortSignal): RequestInit { |
| 777 | return { |
| 778 | method: "POST", |
| 779 | headers: { |
| 780 | "session-id": "session-1", |
| 781 | authorization: "Bearer test", |
| 782 | ...headers, |
| 783 | }, |
| 784 | body: JSON.stringify({ stream: true, input: "hi" }), |
| 785 | signal, |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | async function readTextError(promise: Promise<string>) { |
| 790 | // Bun 1.3.14 hangs on expect(response.text()).rejects for streams errored from ws callbacks. |