Interface SpeechModel

All Superinterfaces:
Model<SpeechPrompt,SpeechResponse>
All Known Implementing Classes:
OpenAiAudioSpeechModel
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SpeechModel extends Model<SpeechPrompt,SpeechResponse>
The SpeechModel interface provides a way to interact with the OpenAI Text-to-Speech (TTS) API. It allows you to convert text input into lifelike spoken audio.
Since:
1.0.0-M1
Author:
Ahmed Yousri
  • Method Summary

    Modifier and Type
    Method
    Description
    default byte[]
    call(String message)
    Generates spoken audio from the provided text message.
    call(SpeechPrompt request)
    Sends a speech request to the OpenAI TTS API and returns the resulting speech response.
  • Method Details

    • call

      default byte[] call(String message)
      Generates spoken audio from the provided text message.
      Parameters:
      message - the text message to be converted to audio
      Returns:
      the resulting audio bytes
    • call

      Sends a speech request to the OpenAI TTS API and returns the resulting speech response.
      Specified by:
      call in interface Model<SpeechPrompt,SpeechResponse>
      Parameters:
      request - the speech prompt containing the input text and other parameters
      Returns:
      the speech response containing the generated audio