Package dev.langchain4j.data.audio
Class Audio.Builder
java.lang.Object
dev.langchain4j.data.audio.Audio.Builder
- Enclosing class:
Audio
Builder for
Audio
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbase64Data
(String base64Data) Set the Base64 encoded string representation of the audio data.binaryData
(byte[] binaryData) Set the raw binary data of the audio as a byte array.build()
Build theAudio
.Set the mime type of the audio.Set the url of the audio.Set the url of the audio.
-
Constructor Details
-
Builder
public Builder()Create a newAudio.Builder
.
-
-
Method Details
-
url
Set the url of the audio.- Parameters:
url
- the url of the audio.- Returns:
this
-
url
Set the url of the audio.- Parameters:
url
- the url of the audio.- Returns:
this
-
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
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
Set the mime type of the audio.- Parameters:
mimeType
- the mime type of the audio.- Returns:
this
-
build
Build theAudio
.- Returns:
- the
Audio
.
-