feat: Add TTSBackendMetadata model

This commit is contained in:
Artem Akymenko
2026-07-06 12:58:06 +03:00
parent 56d3e414b3
commit 45e859dac4
2 changed files with 52 additions and 1 deletions
+23 -1
View File
@@ -1,12 +1,30 @@
"""
TTS Backend Interface
This module defines the protocol for TTS backends.
This module defines the protocol for TTS backends and the
metadata model that describes a backend implementation.
"""
from dataclasses import dataclass
from typing import Protocol, List, Dict, Any
@dataclass(frozen=True)
class TTSBackendMetadata:
"""
Immutable metadata describing a TTS backend implementation.
Attributes:
id: Unique backend identifier (e.g. ``"kokoro"``, ``"supertonic"``).
name: Human-readable display name.
description: Short description of the backend.
"""
id: str
name: str
description: str
class TTSBackend(Protocol):
"""
Protocol for TTS backends.
@@ -15,6 +33,10 @@ class TTSBackend(Protocol):
with the application.
"""
@property
def metadata(self) -> TTSBackendMetadata:
...
def __init__(self, **kwargs) -> None:
"""
Initialize the TTS backend.