Skip to content

Commit

Permalink
追加: エンジン情報取得 API にドキュメントを追加 (#1223)
Browse files Browse the repository at this point in the history
add: エンジン情報取得 API にドキュメントを追加
  • Loading branch information
tarepan authored May 14, 2024
1 parent c356918 commit 67dbf5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions voicevox_engine/app/routers/engine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ def generate_engine_info_router(

@router.get("/version", tags=["その他"])
async def version() -> str:
"""エンジンのバージョンを取得します。"""
return __version__

@router.get("/core_versions", response_model=list[str], tags=["その他"])
async def core_versions() -> Response:
"""利用可能なコアのバージョン一覧を取得します。"""
return Response(
content=json.dumps(list(cores.keys())),
media_type="application/json",
Expand All @@ -33,9 +35,8 @@ async def core_versions() -> Response:
@router.get(
"/supported_devices", response_model=SupportedDevicesInfo, tags=["その他"]
)
def supported_devices(
core_version: str | None = None,
) -> Response:
def supported_devices(core_version: str | None = None) -> Response:
"""対応デバイスの一覧を取得します。"""
supported_devices = get_core(core_version).supported_devices
if supported_devices is None:
raise HTTPException(status_code=422, detail="非対応の機能です。")
Expand All @@ -46,6 +47,7 @@ def supported_devices(

@router.get("/engine_manifest", response_model=EngineManifest, tags=["その他"])
async def engine_manifest() -> EngineManifest:
"""エンジンマニフェストを取得します。"""
return engine_manifest_data

return router

0 comments on commit 67dbf5f

Please sign in to comment.