public final class TranscriptionRequest
- Object
- TranscriptionRequest
File transcription request shared by transcription providers.
Constructors
public TranscriptionRequest(String audioPath) | Creates a file-based transcription request. |
Methods
public static TranscriptionRequest file(String audioPath) | Creates a file-based transcription request. |
public String getAudioPath() | Gets the audio file path. |
public String getLanguageTag() | Gets the requested recognition language. |
public TranscriptionRequest setLanguageTag(String languageTag) | Sets the requested recognition language. |
public String getPrompt() | Gets the optional provider prompt. |
public TranscriptionRequest setPrompt(String prompt) | Sets optional provider prompt text. |
public TranscriptionRequest setOption(String key, String value) | Sets an optional provider-specific value. |
public String getOption(String key) | Gets a provider-specific option value. |
public Map<String, String> getOptions() | Gets all provider-specific options. |
Inherited methods
Constructor details
TranscriptionRequest
public TranscriptionRequest(String audioPath)Creates a file-based transcription request.
Parameters
audioPathString- path to the audio file that should be transcribed
Throws
IllegalArgumentException- if
audioPathisnullor empty
Method details
file
public static TranscriptionRequest file(String audioPath)Creates a file-based transcription request.
Parameters
audioPathString- path to the audio file that should be transcribed
Returns
a new transcription request
getAudioPath
public String getAudioPath()Gets the audio file path.
Returns
audio file path
getLanguageTag
public String getLanguageTag()Gets the requested recognition language.
Returns
BCP 47 language tag, or
null if the provider should choose its defaultsetLanguageTag
public TranscriptionRequest setLanguageTag(String languageTag)Sets the requested recognition language.
Parameters
languageTagString- BCP 47 language tag, or
nullto let the provider choose
Returns
this request
getPrompt
public String getPrompt()Gets the optional provider prompt.
Returns
prompt text, or
null if no prompt is setsetPrompt
public TranscriptionRequest setPrompt(String prompt)Sets optional provider prompt text.
Parameters
promptString- prompt text, or
nullto clear it
Returns
this request
setOption
public TranscriptionRequest setOption(String key, String value)Sets an optional provider-specific value.
Passing null as the value removes the option.
Parameters
keyString- option key
valueString- option value, or
nullto remove the option
Returns
this request
Throws
IllegalArgumentException- if
keyisnullor empty
getOption
public String getOption(String key)Gets a provider-specific option value.
Parameters
keyString- option key
Returns
option value, or
null if it is not setgetOptions
public Map<String, String> getOptions()Gets all provider-specific options.
Returns
immutable option map