Spaces:
Sleeping
Sleeping
| """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.""" | |
| 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 |