Interface GPTDictationService

  • All Known Implementing Classes:
    GPTDictationServiceImpl

    public interface GPTDictationService
    Services related to dictation.
    • Method Detail

      • isAvailable

        boolean isAvailable​(@Nullable
                            GPTConfiguration configuration)
        Whether the service is enabled and properly configured.
      • transcribe

        String transcribe​(@Nonnull
                          InputStream audioStream,
                          @Nonnull
                          String contentType,
                          @Nullable
                          String language,
                          @Nullable
                          GPTConfiguration configuration,
                          @Nullable
                          String prompt)
                   throws IllegalStateException
        Transcribes the input audio to text.
        Parameters:
        audioStream - the audio stream to transcribe, will be closed
        contentType - the content type of the audio, e.g. "audio/mpeg" for mp3, "audio/wav" for wav
        language - the language code to use, e.g. "en" for English, or null for automatic detection
        configuration - the configuration to use, or null for the default configuration
        prompt - an optional prompt to give the AI some context, e.g. previous sentences
        Throws:
        IllegalStateException - if the service is not available / configured