From af3a52bac6d94eb3ddfef02e87a002b893352070 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 30 Jun 2025 18:30:51 -0500 Subject: [PATCH] feat(api): add model field and root endpoint Add a model field to the gemini request mapping and implement a new root endpoint that returns a plain text status message. --- src/mapper.ts | 1 + src/server.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mapper.ts b/src/mapper.ts index 6450670..2fcfcdb 100644 --- a/src/mapper.ts +++ b/src/mapper.ts @@ -118,6 +118,7 @@ export async function mapRequest(body: RequestBody) { return { geminiReq: { + model: body.model, contents, generationConfig, stream: body.stream, diff --git a/src/server.ts b/src/server.ts index adad12f..c55eaa4 100644 --- a/src/server.ts +++ b/src/server.ts @@ -24,7 +24,7 @@ if (VERBOSE) { consola.info('Verbose logging enabled'); } -consola.info('Google CLI OpenAI proxy'); +consola.info('Google CLI OpenAI API'); // ================================================================== // HTTP Server Helpers @@ -101,6 +101,12 @@ ensureOAuthCredentials() return; } + if (pathname === '/') { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('Google CLI OpenAI API server is running......'); + return; + } + if (!isAuthorized(req, res)) { return; }