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.
This commit is contained in:
2025-06-30 18:30:51 -05:00
parent e7eb40ba4e
commit af3a52bac6
2 changed files with 8 additions and 1 deletions

View File

@@ -118,6 +118,7 @@ export async function mapRequest(body: RequestBody) {
return { return {
geminiReq: { geminiReq: {
model: body.model,
contents, contents,
generationConfig, generationConfig,
stream: body.stream, stream: body.stream,

View File

@@ -24,7 +24,7 @@ if (VERBOSE) {
consola.info('Verbose logging enabled'); consola.info('Verbose logging enabled');
} }
consola.info('Google CLI OpenAI proxy'); consola.info('Google CLI OpenAI API');
// ================================================================== // ==================================================================
// HTTP Server Helpers // HTTP Server Helpers
@@ -101,6 +101,12 @@ ensureOAuthCredentials()
return; return;
} }
if (pathname === '/') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Google CLI OpenAI API server is running......');
return;
}
if (!isAuthorized(req, res)) { if (!isAuthorized(req, res)) {
return; return;
} }