public final class TranscriptionRequest

  1. Object
  2. 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

audioPath String
path to the audio file that should be transcribed

Throws

IllegalArgumentException
if audioPath is null or empty

Method details

file

public static TranscriptionRequest file(String audioPath)
Creates a file-based transcription request.

Parameters

audioPath String
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 default

setLanguageTag

public TranscriptionRequest setLanguageTag(String languageTag)
Sets the requested recognition language.

Parameters

languageTag String
BCP 47 language tag, or null to 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 set

setPrompt

public TranscriptionRequest setPrompt(String prompt)
Sets optional provider prompt text.

Parameters

prompt String
prompt text, or null to 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

key String
option key
value String
option value, or null to remove the option

Returns

this request

Throws

IllegalArgumentException
if key is null or empty

getOption

public String getOption(String key)
Gets a provider-specific option value.

Parameters

key String
option key

Returns

option value, or null if it is not set

getOptions

public Map<String, String> getOptions()
Gets all provider-specific options.

Returns

immutable option map