Merge pull request #232 from AlpinDale/serviceinfo_uri
feat: add serviceinfo URI
This commit is contained in:
commit
b81dcdaf66
1 changed files with 29 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ from sys import maxsize
|
|||
from typing import Optional
|
||||
from common.multimodal import MultimodalEmbeddingWrapper
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, Response
|
||||
from fastapi.responses import JSONResponse
|
||||
from sse_starlette import EventSourceResponse
|
||||
|
||||
from common import model, sampling
|
||||
|
|
@ -65,6 +66,34 @@ async def healthcheck(response: Response) -> HealthCheckResponse:
|
|||
)
|
||||
|
||||
|
||||
@router.get("/.well-known/serviceinfo")
|
||||
async def service_info():
|
||||
return JSONResponse(
|
||||
content={
|
||||
"version": 0.1,
|
||||
"software": {
|
||||
"name": "TabbyAPI",
|
||||
"repository": "https://github.com/theroyallab/tabbyAPI",
|
||||
"homepage": "https://github.com/theroyallab/tabbyAPI",
|
||||
},
|
||||
"api": {
|
||||
"openai": {
|
||||
"name": "OpenAI API",
|
||||
"relative_url": "/v1",
|
||||
"documentation": "https://theroyallab.github.io/tabbyAPI",
|
||||
"version": 1,
|
||||
},
|
||||
"koboldai": {
|
||||
"name": "KoboldAI API",
|
||||
"relative_url": "/api",
|
||||
"documentation": "https://theroyallab.github.io/tabbyAPI",
|
||||
"version": 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
# Model list endpoint
|
||||
@router.get("/v1/models", dependencies=[Depends(check_api_key)])
|
||||
@router.get("/v1/model/list", dependencies=[Depends(check_api_key)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue