Files
life-echo/api/app/ports/tts.py

11 lines
292 B
Python

"""TTSProvider port — 文字转语音能力契约。"""
from typing import Protocol, runtime_checkable
@runtime_checkable
class TTSProvider(Protocol):
async def synthesize(self, text: str, voice: str = "alloy") -> bytes:
"""Convert text to speech audio bytes."""
...