File size: 559 Bytes
51ee8c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Protocol interfaces for service abstraction and testability."""

from typing import Protocol, runtime_checkable


@runtime_checkable
class Transcriber(Protocol):
    def transcribe(self, audio_bytes: bytes, language: str = "fr") -> dict: ...


@runtime_checkable
class Translator(Protocol):
    async def translate(self, text: str, source_lang: str, target_lang: str) -> dict: ...
    async def health_check(self) -> bool: ...


@runtime_checkable
class Synthesizer(Protocol):
    def synthesize(self, text: str, language: str, speaker: str) -> bytes: ...