Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f83a1b3957 | |||
| af3a52bac6 | |||
| e7eb40ba4e |
@@ -10,6 +10,15 @@ This project provides a lightweight proxy server that translates OpenAI API requ
|
||||
* **Docker Support:** Includes `Dockerfile` and `docker-compose.yml` for easy containerized deployment.
|
||||
* **Hugging Face Spaces Ready:** Can be easily deployed as a Hugging Face Space.
|
||||
|
||||
## Support the Project
|
||||
|
||||
If you find this project useful, consider supporting its development:
|
||||
|
||||
[![Donate using Liberapay][liberapay-logo]][liberapay-link]
|
||||
|
||||
[liberapay-logo]: https://liberapay.com/assets/widgets/donate.svg "Liberapay Logo"
|
||||
[liberapay-link]: https://liberapay.com/sfiorini/donate
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, ensure you have the following installed:
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gemini-cli-openai-api",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gemini-cli-openai-api",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@google/gemini-cli-core": "^0.1.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gemini-cli-openai-api",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"main": "server.ts",
|
||||
"scripts": {
|
||||
"build": "tsdown",
|
||||
|
||||
@@ -118,6 +118,7 @@ export async function mapRequest(body: RequestBody) {
|
||||
|
||||
return {
|
||||
geminiReq: {
|
||||
model: body.model,
|
||||
contents,
|
||||
generationConfig,
|
||||
stream: body.stream,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user