ClinicianFOCUS / freescribe-copilot

Chrome and Firefox Plugin to assist healthcare providers interacting with patients with transcribing and preparing notes, and other active assistance; under development.
GNU Affero General Public License v3.0
0 stars 0 forks source link

Using Whisper and Jan AI to generate SOAP notes #2

Closed n41tik closed 1 week ago

n41tik commented 1 week ago

Description:

  1. Implementing whisper to get audio transcription
  2. Using JAN AI to generate SOAP notes from the transcription

Summary by Sourcery

Integrate Whisper and JAN AI to enable audio transcription and SOAP note generation from recorded audio. Enhance the user interface with a configuration section for setting service parameters and a toggle button for managing its visibility.

New Features:

Enhancements:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This pull request implements audio transcription using Whisper API and SOAP note generation using Jan AI. It also simplifies the user interface by removing audio output device selection and adds configuration options for the APIs used.

Sequence diagram for audio transcription and SOAP note generation

sequenceDiagram
    actor User
    participant Browser
    participant WhisperAPI as Whisper API
    participant JanAI as Jan AI

    User->>Browser: Click Record
    Browser->>User: Record audio
    User->>Browser: Click Stop
    Browser->>WhisperAPI: Send audio for transcription
    WhisperAPI-->>Browser: Return transcribed text
    Browser->>JanAI: Send transcribed text for SOAP note generation
    JanAI-->>Browser: Return SOAP notes
    Browser->>User: Display SOAP notes

User journey diagram for generating SOAP notes

journey
    title User journey for generating SOAP notes
    section Recording Audio
      User: 1: Click Record
      User: 2: Speak into microphone
      User: 3: Click Stop
    section Transcription and SOAP Note Generation
      System: 1: Transcribe audio using Whisper API
      System: 2: Generate SOAP notes using Jan AI
    section Displaying Results
      User: 1: View generated SOAP notes

File-Level Changes

Change Details Files
Implement audio transcription using Whisper API
  • Add configuration for Whisper API URL
  • Implement convertAudioToText function to send audio to Whisper API
  • Update GUI with transcribed text
index.js
Implement SOAP note generation using Jan AI
  • Add configuration for AI Scribe URL, model, and context
  • Implement generateSoapNotes function to send transcribed text to Jan AI
  • Display generated SOAP notes in the UI
index.js
index.html
Simplify user interface by removing audio output device selection
  • Remove audio output device selection from HTML
  • Remove code related to audio output device selection and setting
  • Update event listeners to no longer handle audio output device changes
index.js
index.html
Add configuration management for API settings
  • Implement configuration object with default values
  • Add UI elements for editing configuration
  • Implement save and load functionality for configuration using Chrome storage API
index.js
index.html
Update UI to support new functionalities
  • Add textarea for displaying transcribed text
  • Add button for generating SOAP notes
  • Add pre element for displaying generated SOAP notes
  • Implement toggle for showing/hiding configuration section
index.html

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
n41tik commented 1 week ago

@sourcery-ai review