Spaces:
Running
Running
added 0506
Browse files- app/main.py +12 -2
app/main.py
CHANGED
@@ -1369,6 +1369,15 @@ def create_final_chunk(model: str, response_id: str, candidate_count: int = 1) -
|
|
1369 |
async def list_models(api_key: str = Depends(get_api_key)):
|
1370 |
# Based on current information for Vertex AI models
|
1371 |
models = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1372 |
{
|
1373 |
"id": "gemini-2.5-pro-exp-03-25",
|
1374 |
"object": "model",
|
@@ -1772,7 +1781,8 @@ async def chat_completions(request: OpenAIRequest, api_key: str = Depends(get_ap
|
|
1772 |
extra_body=openai_extra_body # Pass safety settings here
|
1773 |
)
|
1774 |
async for chunk in stream:
|
1775 |
-
|
|
|
1776 |
yield "data: [DONE]\n\n"
|
1777 |
except Exception as stream_error:
|
1778 |
error_msg = f"Error during OpenAI client streaming for {request.model}: {str(stream_error)}"
|
@@ -2355,4 +2365,4 @@ def health_check(api_key: str = Depends(get_api_key)):
|
|
2355 |
}
|
2356 |
}
|
2357 |
|
2358 |
-
# Removed /debug/credentials endpoint
|
|
|
1369 |
async def list_models(api_key: str = Depends(get_api_key)):
|
1370 |
# Based on current information for Vertex AI models
|
1371 |
models = [
|
1372 |
+
{
|
1373 |
+
"id": "gemini-2.5-pro-preview-05-06",
|
1374 |
+
"object": "model",
|
1375 |
+
"created": int(time.time()),
|
1376 |
+
"owned_by": "google",
|
1377 |
+
"permission": [],
|
1378 |
+
"root": "gemini-2.5-pro-pre-05-06",
|
1379 |
+
"parent": None,
|
1380 |
+
},
|
1381 |
{
|
1382 |
"id": "gemini-2.5-pro-exp-03-25",
|
1383 |
"object": "model",
|
|
|
1781 |
extra_body=openai_extra_body # Pass safety settings here
|
1782 |
)
|
1783 |
async for chunk in stream:
|
1784 |
+
print(chunk.model_dump_json())
|
1785 |
+
yield f"data: {chunk.model_dump_json()}\n\n"
|
1786 |
yield "data: [DONE]\n\n"
|
1787 |
except Exception as stream_error:
|
1788 |
error_msg = f"Error during OpenAI client streaming for {request.model}: {str(stream_error)}"
|
|
|
2365 |
}
|
2366 |
}
|
2367 |
|
2368 |
+
# Removed /debug/credentials endpoint
|