mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-01-31 12:54:33 +01:00
API: Add an /v1/internal/health endpoint
This commit is contained in:
parent
bc55feaf3e
commit
35717a088c
|
|
@ -250,6 +250,11 @@ async def handle_moderations(request: Request):
|
|||
return JSONResponse(response)
|
||||
|
||||
|
||||
@app.get("/v1/internal/health", dependencies=check_key)
|
||||
async def handle_health_check():
|
||||
return JSONResponse(content={"status": "ok"})
|
||||
|
||||
|
||||
@app.post("/v1/internal/encode", response_model=EncodeResponse, dependencies=check_key)
|
||||
async def handle_token_encode(request_data: EncodeRequest):
|
||||
response = token_encode(request_data.text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue