From cdb44853341f5e32776415b1f9396e4f02cf0555 Mon Sep 17 00:00:00 2001 From: alpha-nerd-nomyo Date: Wed, 27 Aug 2025 09:23:59 +0200 Subject: [PATCH] Update router.py added t.b.d. OpenAI API compatible endpoints --- router.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/router.py b/router.py index 3e864db..c12cd33 100644 --- a/router.py +++ b/router.py @@ -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}") \ No newline at end of file + f"max_concurrent_connections={config.max_concurrent_connections}")