refactor: remove mandatory transcription and image methods in LLMInterface

This commit is contained in:
Igor Ilic 2025-12-16 16:53:56 +01:00
parent 3e041ec12f
commit f27d07d902

View file

@ -14,8 +14,6 @@ class LLMInterface(Protocol):
Methods:
- acreate_structured_output(text_input: str, system_prompt: str, response_model: Type[BaseModel])
- create_transcript(input): Transcribe audio files to text
- transcribe_image(input): Analyze image files and return text description
"""
@abstractmethod
@ -37,39 +35,3 @@ class LLMInterface(Protocol):
output.
"""
raise NotImplementedError
@abstractmethod
async def create_transcript(self, input) -> TranscriptionReturnType:
"""
Transcribe audio content to text.
This method should be implemented by subclasses that support audio transcription.
If not implemented, returns None and should be handled gracefully by callers.
Parameters:
-----------
- input: The path to the audio file that needs to be transcribed.
Returns:
--------
- BaseModel: A structured output containing the transcription, or None if not supported.
"""
raise NotImplementedError
@abstractmethod
async def transcribe_image(self, input) -> BaseModel:
"""
Analyze image content and return text description.
This method should be implemented by subclasses that support image analysis.
If not implemented, returns None and should be handled gracefully by callers.
Parameters:
-----------
- input: The path to the image file that needs to be analyzed.
Returns:
--------
- BaseModel: A structured output containing the image description, or None if not supported.
"""
raise NotImplementedError