"""Domain-specific plugin interface for audio transcription"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/plugin_interface.ipynb.

# %% auto #0
__all__ = ['TranscriptionPlugin']

# %% ../nbs/plugin_interface.ipynb #9be27cb8
from abc import abstractmethod
from pathlib import Path
from typing import List, Union

from cjm_plugin_system.core.interface import PluginInterface

from .core import AudioData, TranscriptionResult

# %% ../nbs/plugin_interface.ipynb #26808a7c
class TranscriptionPlugin(PluginInterface):
    """
    Abstract base class for all transcription plugins.
    
    Extends PluginInterface with transcription-specific requirements:
    - `supported_formats`: List of audio file extensions this plugin can handle
    - `execute`: Accepts audio path (str) or AudioData, returns TranscriptionResult
    
    NOTE: When running via RemotePluginProxy, AudioData objects are automatically
    serialized to temp files via FileBackedDTO, so the Worker receives a file path.
    """
    
    # Entry point group for discovery (legacy, kept for metadata)
    entry_point_group = "transcription.plugins"

    @property
    @abstractmethod
    def supported_formats(self) -> List[str]: # e.g., ['wav', 'mp3', 'flac']
        """List of supported audio file extensions (without the dot)."""
        ...

    @abstractmethod
    def execute(
        self,
        audio: Union[AudioData, str, Path], # Audio data or file path
        **kwargs
    ) -> TranscriptionResult: # Transcription result with text, confidence, segments
        """
        Transcribe audio to text.
        
        When called via Proxy, AudioData is auto-converted to a file path string
        before reaching this method in the Worker process.
        """
        ...
