Update main.py
Browse files
main.py
CHANGED
@@ -12,8 +12,8 @@ from typing import List, Dict, Any, Optional, AsyncGenerator, Union
|
|
12 |
from datetime import datetime
|
13 |
|
14 |
from aiohttp import ClientSession, ClientTimeout, ClientError
|
15 |
-
from fastapi import FastAPI, HTTPException, Request, Depends, Header
|
16 |
-
from fastapi.responses import StreamingResponse, JSONResponse,
|
17 |
from pydantic import BaseModel
|
18 |
|
19 |
# Configure logging
|
@@ -516,8 +516,8 @@ async def chat_completions(request: ChatRequest, req: Request, api_key: str = De
|
|
516 |
# Return 'about:blank' when accessing the endpoint via GET
|
517 |
@app.get("/v1/chat/completions")
|
518 |
async def chat_completions_get():
|
519 |
-
logger.info("GET request made to /v1/chat/completions,
|
520 |
-
return
|
521 |
|
522 |
@app.get("/v1/models")
|
523 |
async def get_models():
|
|
|
12 |
from datetime import datetime
|
13 |
|
14 |
from aiohttp import ClientSession, ClientTimeout, ClientError
|
15 |
+
from fastapi import FastAPI, HTTPException, Request, Depends, Header
|
16 |
+
from fastapi.responses import StreamingResponse, JSONResponse, RedirectResponse
|
17 |
from pydantic import BaseModel
|
18 |
|
19 |
# Configure logging
|
|
|
516 |
# Return 'about:blank' when accessing the endpoint via GET
|
517 |
@app.get("/v1/chat/completions")
|
518 |
async def chat_completions_get():
|
519 |
+
logger.info("GET request made to /v1/chat/completions, redirecting to 'about:blank'")
|
520 |
+
return RedirectResponse(url='about:blank')
|
521 |
|
522 |
@app.get("/v1/models")
|
523 |
async def get_models():
|