Spaces:
Build error
Build error
File size: 809 Bytes
5009cb8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
"""Speech recognition service interface."""
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..models.audio_content import AudioContent
from ..models.text_content import TextContent
class ISpeechRecognitionService(ABC):
"""Interface for speech recognition services."""
@abstractmethod
def transcribe(self, audio: 'AudioContent', model: str) -> 'TextContent':
"""
Transcribe audio content to text.
Args:
audio: The audio content to transcribe
model: The STT model to use for transcription
Returns:
TextContent: The transcribed text
Raises:
SpeechRecognitionException: If transcription fails
"""
pass |