(init: RequestInit)
| 85 | } |
| 86 | |
| 87 | function getJsonBody(init: RequestInit) { |
| 88 | if (typeof init.body !== "string") { |
| 89 | throw new Error("Expected JSON string request body"); |
| 90 | } |
| 91 | |
| 92 | return JSON.parse(init.body) as Record<string, unknown>; |
| 93 | } |
| 94 | |
| 95 | function createCompletedResponse(finishReason: string) { |
| 96 | return { |
no test coverage detected