Class Audio.Builder

java.lang.Object
dev.langchain4j.data.audio.Audio.Builder
Enclosing class:
Audio

public static class Audio.Builder extends Object
Builder for Audio.
  • Constructor Details

  • Method Details

    • url

      public Audio.Builder url(URI url)
      Set the url of the audio.
      Parameters:
      url - the url of the audio.
      Returns:
      this
    • url

      public Audio.Builder url(String url)
      Set the url of the audio.
      Parameters:
      url - the url of the audio.
      Returns:
      this
    • binaryData

      public Audio.Builder binaryData(byte[] binaryData)
      Set the raw binary data of the audio as a byte array. This is the preferred format for implementations like Azure OpenAI that require raw binary audio data for processing.
      Parameters:
      binaryData - the raw binary data of the audio as a byte array.
      Returns:
      this
    • base64Data

      public Audio.Builder base64Data(String base64Data)
      Set the Base64 encoded string representation of the audio data. This is the preferred format for implementations like OpenAI that accept Base64 encoded audio data in API requests.
      Parameters:
      base64Data - the Base64 encoded string representation of the audio.
      Returns:
      this
    • mimeType

      public Audio.Builder mimeType(String mimeType)
      Set the mime type of the audio.
      Parameters:
      mimeType - the mime type of the audio.
      Returns:
      this
    • build

      public Audio build()
      Build the Audio.
      Returns:
      the Audio.