Integrate OpenAI Whisper API Support for Enhanced Transcription Options #137 #142
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
Title: Support for Additional Whisper Services with OpenAI Whisper API Integration
Overview:
This pull request addresses issue #137, which requests the integration of additional transcription services into the Telegram bot currently utilizing AWS Whisper. Specifically, this update includes support for the OpenAI Whisper API, enhancing versatility and providing users with flexible transcription options.
Key Changes:
Integration of OpenAI Whisper API:
OpenAITranscriber
to handle interactions with the OpenAI API for voice message transcription.BaseTranscriber
that encapsulates shared functionality for different transcription services.AWSTranscriber
, promoting cleaner and modular code.Configuration Adjustments:
config.py
file to allow for seamless configuration of the chosen transcription service:OPENAI_API_KEY
: Added for authenticating requests to the OpenAI API.TRANSCRIPTION_SERVICE
: Introduced a new setting, allowing the user to specify their preferred transcription service (default set to 'aws').Updates to Bot Handlers:
bot_handlers.py
to facilitate a dynamic initialization of theAudioTranscriber
class based on the specified configuration, enabling clear separation of concern and functionality.New Features:
TRANSCRIPTION_SERVICE
environment variable. When selecting OpenAI, users must ensure to provide theirOPENAI_API_KEY
for successful integration.Testing:
All new features have been rigorously tested, ensuring compatibility and performance expectations meet the needs outlined in the original issue description.
Conclusion:
This implementation provides a step forward in supporting diverse transcription services, ultimately leading to improved user experiences and operational efficiency. We welcome any feedback or questions regarding this enhancement.
Related Links:
Thank you for considering this pull request!