Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for OpenAI Whisper API Integration as Transcription Backend #151

Conversation

agentmarketbot
Copy link
Contributor

Pull Request Description

Title: Support Additional Whisper Services: Integration of OpenAI Whisper API

Related Issue: #137

Summary:
This pull request introduces support for the OpenAI Whisper API as an additional transcription service in the grouplang-secretary-bot. The implementation enhances flexibility and performance, allowing users to choose between AWS Transcribe and OpenAI Whisper based on their individual needs and preferences.

Changes Made:

  1. Integration of OpenAI Whisper API:

    • A new OpenAITranscriber class has been added to handle voice message transcriptions using the OpenAI Whisper API.
    • Introduced a TranscriberFactory that manages the selection between AWS and OpenAI transcription services.
  2. Configuration Updates:

    • Updated config.py to include new environment variables:
      • OPENAI_API_KEY: Required for authentication with the OpenAI service.
      • TRANSCRIPTION_SERVICE: A new variable to specify the desired transcription service, with options for 'aws' (default) and 'openai'.
  3. Code Adjustments:

    • The bot_handlers.py file has been modified to utilize the TranscriberFactory, enabling dynamic selection of the transcription service based on the current configuration.
  4. Documentation Enhancements:

    • The README.md file has been updated with:
      • New features related to the integration of the OpenAI Whisper API.
      • Detailed configuration instructions for both OpenAI Whisper API and AWS Transcribe.
      • Expanded prerequisites highlighting the requirement for OpenAI API access alongside AWS credentials.
      • An added API reference section that clarifies usage for both transcription services.

User Instructions:

  • To enable the OpenAI Whisper API, set the environment variable:

    TRANSCRIPTION_SERVICE=openai
    

    Ensure you also provide your OpenAI API key by setting the variable:

    OPENAI_API_KEY=<your_api_key>
    
  • For AWS Transcribe, maintain the following settings:

    TRANSCRIPTION_SERVICE=aws
    

    Provide the necessary AWS credentials as before.

This update significantly enhances the bot's capability by allowing users to choose their preferred transcription service, thereby catering to a broader range of needs while keeping backward compatibility intact.

Testing:

  • Please ensure you test both transcription services after pulling to validate that the implementation works as intended across both configurations.

Next Steps:

  • Review and merge this PR upon successful validation of the new features.
  • Monitor any feedback or issues that arise post-merge to ensure robust service performance across both APIs.

* Implement OpenAI Whisper API as alternative transcription service
* Add TranscriberFactory to manage transcription service selection
* Create new OpenAITranscriber class alongside existing AWS implementation
* Update configuration to support service selection via TRANSCRIPTION_SERVICE env var
* Update documentation with setup instructions for both transcription services
* Add required environment variables for OpenAI API integration
* Improve error logging with service-specific messages

This change allows users to choose between AWS Transcribe and OpenAI Whisper API for voice message transcription, providing more flexibility in service selection based on their needs and preferences.
@vadanrod14 vadanrod14 closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants