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:
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user