**Pull Request Title:** Integrate OpenAI Whisper API Support and Service Abstraction Layer (Fixes #137) #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Overview
This pull request addresses Issue #137: Support Additional Whisper Services (Focus on OpenAI Whisper API) by integrating the OpenAI Whisper API as a transcription backend alongside the existing AWS Whisper. This enhancement improves the flexibility and options available to users for voice message transcription within the Telegram bot.
Key Changes
Transcription Service Architecture:
TranscriptionService
that establishes a common interface for all transcription services. This includes:transcribe_audio(file_url: str)
for implementing specific transcription logic._download_audio(file_url: str)
to standardize audio file downloads and reduce code duplication.AWS Integration:
AWSTranscriber
class to inherit from the newTranscriptionService
, thus standardizing its interface with the new architecture.OpenAI Integration:
OpenAITranscriber
class that encapsulates logic for utilizing the OpenAI Whisper API. This new module handles:Factory Pattern Implementation:
TranscriptionServiceFactory
to simplify the instantiation of the appropriate transcriber. It allows users to create instances of eitherAWSTranscriber
orOpenAITranscriber
based on their specified preferences.Usage Examples:
Documentation Updates:
Acceptance Criteria
Additional Context
The integration of the OpenAI Whisper API provides an alternative transcription option known for its accuracy across various languages and accents, potentially enhancing user experience and transcription quality.
Fixes #137
Thank you for reviewing this pull request! Please let me know if you have any questions or require further adjustments.