({ reqPath, body })
| 51 | srv.actualPort = port; |
| 52 | |
| 53 | const call = ({ reqPath, body }) => new Promise((resolve, reject) => { |
| 54 | const req = http.request({ host: '127.0.0.1', port, path: reqPath, method: 'POST', |
| 55 | headers: { 'content-type': 'application/json', authorization: 'Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'user-agent': 'ollama/0.5.1' } }, (res) => { |
| 56 | const chunks = []; |
| 57 | res.on('data', (d) => chunks.push(d)); |
| 58 | res.on('end', () => resolve({ status: res.statusCode, bytes: Buffer.concat(chunks) })); |
| 59 | }); |
| 60 | req.on('error', reject); |
| 61 | req.end(JSON.stringify(body)); |
| 62 | }); |
| 63 | |
| 64 | const readRows = async (expected = 1) => { |
| 65 | let lines = []; |
no outgoing calls
no test coverage detected