feat: implement api server, refactor benchmark, fix tests#1
Conversation
- Installed express, cors, helmet, dotenv. - Modified `src/index.js` to run the Express API server when the `--server` flag is present, and execute the benchmark logic otherwise. - Maintained legacy `main()` benchmark logic. - Fixed the `t.end is not a function` error in `tests/test.js` by removing unsupported `t.end()` calls in the native test runner. - Added API endpoints `/health` and `/v1/chat/completions` (with mocked output). - Created `tests/api.test.js` to run supertest queries against the new server structure. - Updated `package.json` with accurate dependencies, scripts (`npm start`, `npm dev`), and tests. Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This branch implements the promised Unified LLM API Gateway using Express.js while keeping backward compatibility with the existing benchmark scripts. It sets up proper unhandled process exception handlers, tests via node's native runner with
supertest, and manages necessary dependencies.PR created automatically by Jules for task 1883177825872962423 started by @shenald-dev