MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / makeRequest

Function makeRequest

out/cli.cjs:78902–78913  ·  view source on GitHub ↗
(url2, fetchOptions, fetchFn = fetch)

Source from the content-addressed store, hash-verified

78900 url: url2.toString(),
78901 fetchOptions: Object.assign(Object.assign({}, buildFetchOptions(requestOptions)), { method: "POST", headers: await getHeaders(url2), body })
78902 };
78903}
78904async 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}
78908async 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);

Callers 1

makeModelRequestFunction · 0.85

Calls 2

handleResponseErrorFunction · 0.85
handleResponseNotOkFunction · 0.85

Tested by

no test coverage detected