(url2, fetchOptions, fetchFn = fetch)
| 78900 | url: url2.toString(), |
| 78901 | fetchOptions: Object.assign(Object.assign({}, buildFetchOptions(requestOptions)), { method: "POST", headers: await getHeaders(url2), body }) |
| 78902 | }; |
| 78903 | } |
| 78904 | async function makeModelRequest(model, task, apiKey, stream4, body, requestOptions = {}, fetchFn = fetch) { |
| 78905 | const { url: url2, fetchOptions } = await constructModelRequest(model, task, apiKey, stream4, body, requestOptions); |
| 78906 | return makeRequest(url2, fetchOptions, fetchFn); |
| 78907 | } |
| 78908 | async function makeRequest(url2, fetchOptions, fetchFn = fetch) { |
| 78909 | let response; |
| 78910 | try { |
| 78911 | response = await fetchFn(url2, fetchOptions); |
| 78912 | } catch (e3) { |
| 78913 | handleResponseError(e3, url2); |
| 78914 | } |
| 78915 | if (!response.ok) { |
| 78916 | await handleResponseNotOk(response, url2); |
no test coverage detected