| 13 | const port = parseInt(process.env.AIMOCK_PORT || "4010", 10); |
| 14 | |
| 15 | async function main() { |
| 16 | const mock = new LLMock({ port }); |
| 17 | |
| 18 | // Catch-all fixture: respond to any chat-completion request with a |
| 19 | // short text reply. Predicate returns true unconditionally so we |
| 20 | // don't depend on sequenceIndex bookkeeping. |
| 21 | mock.on( |
| 22 | { predicate: () => true }, |
| 23 | { |
| 24 | content: "hello", |
| 25 | }, |
| 26 | ); |
| 27 | |
| 28 | await mock.start(); |
| 29 | console.log(`aimock-pi listening on http://127.0.0.1:${port}`); |
| 30 | } |
| 31 | |
| 32 | main().catch((err) => { |
| 33 | console.error("aimock-pi failed to start:", err); |