mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 19:50:59 +02:00
feat: Add TTSBackendMetadata model
This commit is contained in:
+23
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user