Skip to content

Commit

Permalink
refactor: コアバージョンを扱う core_version_list を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tarepan committed Jun 28, 2024
1 parent f3bc747 commit 927fbf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion voicevox_engine/app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def generate_app(
resource_manager = ResourceManager(is_development())
resource_manager.register_dir(character_info_dir)

core_version_list = core_manager.versions()

def _get_core_characters(version: str | None) -> list[CoreCharacter]:
version = version or core_manager.latest_version()
core = core_manager.get_core(version)
Expand All @@ -93,7 +95,7 @@ def _get_core_characters(version: str | None) -> list[CoreCharacter]:
)
app.include_router(generate_user_dict_router(user_dict, verify_mutability_allowed))
app.include_router(
generate_engine_info_router(core_manager, tts_engines, engine_manifest)
generate_engine_info_router(core_version_list, tts_engines, engine_manifest)
)
app.include_router(
generate_setting_router(
Expand Down
6 changes: 3 additions & 3 deletions voicevox_engine/app/routers/engine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from voicevox_engine.core.core_adapter import DeviceSupport
from voicevox_engine.core.core_initializer import CoreManager
from voicevox_engine.engine_manifest import EngineManifest
from voicevox_engine.tts_pipeline.tts_engine import TTSEngineManager
from voicevox_engine.tts_pipeline.tts_engine import LATEST_VERSION, TTSEngineManager


class SupportedDevicesInfo(BaseModel):
Expand All @@ -33,7 +33,7 @@ def generate_from(cls, device_support: DeviceSupport) -> Self:


def generate_engine_info_router(
core_manager: CoreManager,
core_version_list: list[str],
tts_engine_manager: TTSEngineManager,
engine_manifest_data: EngineManifest,
) -> APIRouter:
Expand All @@ -48,7 +48,7 @@ async def version() -> str:
@router.get("/core_versions")
async def core_versions() -> list[str]:
"""利用可能なコアのバージョン一覧を取得します。"""
return core_manager.versions()
return core_version_list

@router.get("/supported_devices")
def supported_devices(
Expand Down

0 comments on commit 927fbf8

Please sign in to comment.