Update router.py

added t.b.d. OpenAI API compatible endpoints
This commit is contained in:
Alpha Nerd 2025-08-27 09:23:59 +02:00 committed by GitHub
parent f6ab185116
commit cdb4485334
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -742,7 +742,20 @@ async def ps_proxy(request: Request):
)
# -------------------------------------------------------------
# 18. FastAPI startup event load configuration
# 18. OpenAI API compatible endpoints #ToDo
# -------------------------------------------------------------
@app.post("/v1/chat/completions")
@app.post("/v1/completions")
@app.post("/v1/models")
@app.post("/v1/embeddings")
async def not_implemented_yet(request: Request):
return Response(
status_code=501
)
# -------------------------------------------------------------
# 19. FastAPI startup event load configuration
# -------------------------------------------------------------
@app.on_event("startup")
async def startup_event() -> None:
@ -750,4 +763,4 @@ async def startup_event() -> None:
# Load YAML config (or use defaults if not present)
config = Config.from_yaml(Path("config.yaml"))
print(f"Loaded configuration:\n endpoints={config.endpoints},\n "
f"max_concurrent_connections={config.max_concurrent_connections}")
f"max_concurrent_connections={config.max_concurrent_connections}")