Class OpenAiAudioSpeechModel

java.lang.Object
org.springframework.ai.openai.OpenAiAudioSpeechModel
All Implemented Interfaces:
StreamingTextToSpeechModel, TextToSpeechModel, Model<TextToSpeechPrompt,TextToSpeechResponse>, StreamingModel<TextToSpeechPrompt,TextToSpeechResponse>

public class OpenAiAudioSpeechModel extends Object implements TextToSpeechModel
OpenAI audio speech client implementation for backed by OpenAiAudioApi.
Since:
1.0.0-M1
Author:
Ahmed Yousri, Hyunjoon Choi, Thomas Vitale, Jonghoon Park
See Also:
  • Constructor Details

    • OpenAiAudioSpeechModel

      public OpenAiAudioSpeechModel(OpenAiAudioApi audioApi)
      Initializes a new instance of the OpenAiAudioSpeechModel class with the provided OpenAiAudioApi. It uses the model tts-1, response format mp3, voice alloy, and the default speed of 1.0.
      Parameters:
      audioApi - The OpenAiAudioApi to use for speech synthesis.
    • OpenAiAudioSpeechModel

      public OpenAiAudioSpeechModel(OpenAiAudioApi audioApi, OpenAiAudioSpeechOptions options)
      Initializes a new instance of the OpenAiAudioSpeechModel class with the provided OpenAiAudioApi and options.
      Parameters:
      audioApi - The OpenAiAudioApi to use for speech synthesis.
      options - The OpenAiAudioSpeechOptions containing the speech synthesis options.
    • OpenAiAudioSpeechModel

      public OpenAiAudioSpeechModel(OpenAiAudioApi audioApi, OpenAiAudioSpeechOptions options, org.springframework.retry.support.RetryTemplate retryTemplate)
      Initializes a new instance of the OpenAiAudioSpeechModel class with the provided OpenAiAudioApi and options.
      Parameters:
      audioApi - The OpenAiAudioApi to use for speech synthesis.
      options - The OpenAiAudioSpeechOptions containing the speech synthesis options.
      retryTemplate - The retry template.
  • Method Details