Update app/main.py
Browse files- app/main.py +12 -1
app/main.py
CHANGED
|
@@ -1320,7 +1320,18 @@ async def chat_completions(request: OpenAIRequest, api_key: str = Depends(get_ap
|
|
| 1320 |
# --- Need to import asyncio ---
|
| 1321 |
# import asyncio # Add this import at the top of the file # Already added below
|
| 1322 |
|
| 1323 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1324 |
@app.get("/health")
|
| 1325 |
def health_check(api_key: str = Depends(get_api_key)):
|
| 1326 |
# Refresh the credentials list to get the latest status
|
|
|
|
| 1320 |
# --- Need to import asyncio ---
|
| 1321 |
# import asyncio # Add this import at the top of the file # Already added below
|
| 1322 |
|
| 1323 |
+
# Root endpoint for basic status check
|
| 1324 |
+
@app.get("/")
|
| 1325 |
+
async def root():
|
| 1326 |
+
# Optionally, add a check here to see if the client initialized successfully
|
| 1327 |
+
client_status = "initialized" if client else "not initialized"
|
| 1328 |
+
return {
|
| 1329 |
+
"status": "ok",
|
| 1330 |
+
"message": "OpenAI to Gemini Adapter is running.",
|
| 1331 |
+
"vertex_ai_client": client_status
|
| 1332 |
+
}
|
| 1333 |
+
|
| 1334 |
+
# Health check endpoint (requires API key)
|
| 1335 |
@app.get("/health")
|
| 1336 |
def health_check(api_key: str = Depends(get_api_key)):
|
| 1337 |
# Refresh the credentials list to get the latest status
|