Spaces:
Paused
Paused
Commit
·
1ee60d9
1
Parent(s):
8061397
added root page so hf won't error out
Browse files- src/main.py +28 -0
src/main.py
CHANGED
|
@@ -57,6 +57,34 @@ async def handle_preflight(request: Request, full_path: str):
|
|
| 57 |
}
|
| 58 |
)
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
# Health check endpoint for Docker/Hugging Face
|
| 61 |
@app.get("/health")
|
| 62 |
async def health_check():
|
|
|
|
| 57 |
}
|
| 58 |
)
|
| 59 |
|
| 60 |
+
# Root endpoint - no authentication required
|
| 61 |
+
@app.get("/")
|
| 62 |
+
async def root():
|
| 63 |
+
"""
|
| 64 |
+
Root endpoint providing project information.
|
| 65 |
+
No authentication required.
|
| 66 |
+
"""
|
| 67 |
+
return {
|
| 68 |
+
"name": "geminicli2api",
|
| 69 |
+
"description": "OpenAI-compatible API proxy for Google's Gemini models via gemini-cli",
|
| 70 |
+
"purpose": "Provides both OpenAI-compatible endpoints (/v1/chat/completions) and native Gemini API endpoints for accessing Google's Gemini models",
|
| 71 |
+
"version": "1.0.0",
|
| 72 |
+
"endpoints": {
|
| 73 |
+
"openai_compatible": {
|
| 74 |
+
"chat_completions": "/v1/chat/completions",
|
| 75 |
+
"models": "/v1/models"
|
| 76 |
+
},
|
| 77 |
+
"native_gemini": {
|
| 78 |
+
"models": "/v1beta/models",
|
| 79 |
+
"generate": "/v1beta/models/{model}/generateContent",
|
| 80 |
+
"stream": "/v1beta/models/{model}/streamGenerateContent"
|
| 81 |
+
},
|
| 82 |
+
"health": "/health"
|
| 83 |
+
},
|
| 84 |
+
"authentication": "Required for all endpoints except root and health",
|
| 85 |
+
"repository": "https://github.com/user/geminicli2api"
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
# Health check endpoint for Docker/Hugging Face
|
| 89 |
@app.get("/health")
|
| 90 |
async def health_check():
|