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

11 lines
288 B
Python

"""ASRProvider port — 语音转文字能力契约。"""
from typing import Protocol, runtime_checkable
@runtime_checkable
class ASRProvider(Protocol):
async def transcribe(self, audio: bytes, format: str = "m4a") -> str:
"""Transcribe audio bytes to text."""
...