MCPcopy Create free account
hub / github.com/EvoMap/evolver / call

Function call

test/proxyChatCompletionsE2E.test.js:57–66  ·  view source on GitHub ↗
({ headers, body })

Source from the content-addressed store, hash-verified

55 srv.actualPort = port;
56
57 const call = ({ headers, body }) => new Promise((resolve, reject) => {
58 const req = http.request({ host: '127.0.0.1', port, path: '/v1/chat/completions', method: 'POST',
59 headers: { 'content-type': 'application/json', authorization: 'Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'x-api-key': 'sk-client', ...headers } }, (res) => {
60 const chunks = [];
61 res.on('data', (d) => chunks.push(d));
62 res.on('end', () => resolve({ status: res.statusCode, bytes: Buffer.concat(chunks) }));
63 });
64 req.on('error', reject);
65 req.end(JSON.stringify(body));
66 });
67
68 const readRows = async (expected = 1) => {
69 let lines = [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected