Update router.py
added t.b.d. OpenAI API compatible endpoints
This commit is contained in:
parent
f6ab185116
commit
cdb4485334
1 changed files with 15 additions and 2 deletions
17
router.py
17
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")
|
@app.on_event("startup")
|
||||||
async def startup_event() -> None:
|
async def startup_event() -> None:
|
||||||
|
|
@ -750,4 +763,4 @@ async def startup_event() -> None:
|
||||||
# Load YAML config (or use defaults if not present)
|
# Load YAML config (or use defaults if not present)
|
||||||
config = Config.from_yaml(Path("config.yaml"))
|
config = Config.from_yaml(Path("config.yaml"))
|
||||||
print(f"Loaded configuration:\n endpoints={config.endpoints},\n "
|
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}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue