Class TranscriptionCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class TranscriptionCreateParams.Body.Builder
A builder for Body.
-
-
Method Summary
Modifier and Type Method Description final TranscriptionCreateParams.Body.Builder
file(InputStream file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranscriptionCreateParams.Body.Builder
file(MultipartField<InputStream> file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranscriptionCreateParams.Body.Builder
file(ByteArray file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranscriptionCreateParams.Body.Builder
file(Path file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranscriptionCreateParams.Body.Builder
model(AudioModel model)
ID of the model to use. final TranscriptionCreateParams.Body.Builder
model(MultipartField<AudioModel> model)
ID of the model to use. final TranscriptionCreateParams.Body.Builder
model(String value)
Sets model to an arbitrary String. final TranscriptionCreateParams.Body.Builder
language(String language)
The language of the input audio. final TranscriptionCreateParams.Body.Builder
language(MultipartField<String> language)
The language of the input audio. final TranscriptionCreateParams.Body.Builder
prompt(String prompt)
An optional text to guide the model's style or continue a previous audio segment. final TranscriptionCreateParams.Body.Builder
prompt(MultipartField<String> prompt)
An optional text to guide the model's style or continue a previous audio segment. final TranscriptionCreateParams.Body.Builder
responseFormat(AudioResponseFormat responseFormat)
The format of the output, in one of these options: json
,text
,srt
,verbose_json
, orvtt
.final TranscriptionCreateParams.Body.Builder
responseFormat(MultipartField<AudioResponseFormat> responseFormat)
The format of the output, in one of these options: json
,text
,srt
,verbose_json
, orvtt
.final TranscriptionCreateParams.Body.Builder
temperature(Double temperature)
The sampling temperature, between 0 and 1. final TranscriptionCreateParams.Body.Builder
temperature(MultipartField<Double> temperature)
The sampling temperature, between 0 and 1. final TranscriptionCreateParams.Body.Builder
timestampGranularities(List<TranscriptionCreateParams.TimestampGranularity> timestampGranularities)
The timestamp granularities to populate for this transcription. final TranscriptionCreateParams.Body.Builder
timestampGranularities(MultipartField<List<TranscriptionCreateParams.TimestampGranularity>> timestampGranularities)
The timestamp granularities to populate for this transcription. final TranscriptionCreateParams.Body.Builder
addTimestampGranularity(TranscriptionCreateParams.TimestampGranularity timestampGranularity)
Adds a single TimestampGranularity to timestampGranularities. final TranscriptionCreateParams.Body
build()
Returns an immutable instance of Body. -
-
Method Detail
-
file
final TranscriptionCreateParams.Body.Builder file(InputStream file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
file
final TranscriptionCreateParams.Body.Builder file(MultipartField<InputStream> file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
file
final TranscriptionCreateParams.Body.Builder file(ByteArray file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
file
final TranscriptionCreateParams.Body.Builder file(Path file)
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
model
final TranscriptionCreateParams.Body.Builder model(AudioModel model)
ID of the model to use. Only
whisper-1
(which is powered by our open source Whisper V2 model) is currently available.
-
model
final TranscriptionCreateParams.Body.Builder model(MultipartField<AudioModel> model)
ID of the model to use. Only
whisper-1
(which is powered by our open source Whisper V2 model) is currently available.
-
model
final TranscriptionCreateParams.Body.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed AudioModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
language
final TranscriptionCreateParams.Body.Builder language(String language)
The language of the input audio. Supplying the input language in ISO-639-1 (e.g.
en
) format will improve accuracy and latency.
-
language
final TranscriptionCreateParams.Body.Builder language(MultipartField<String> language)
The language of the input audio. Supplying the input language in ISO-639-1 (e.g.
en
) format will improve accuracy and latency.
-
prompt
final TranscriptionCreateParams.Body.Builder prompt(String prompt)
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
-
prompt
final TranscriptionCreateParams.Body.Builder prompt(MultipartField<String> prompt)
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
-
responseFormat
final TranscriptionCreateParams.Body.Builder responseFormat(AudioResponseFormat responseFormat)
The format of the output, in one of these options:
json
,text
,srt
,verbose_json
, orvtt
.
-
responseFormat
final TranscriptionCreateParams.Body.Builder responseFormat(MultipartField<AudioResponseFormat> responseFormat)
The format of the output, in one of these options:
json
,text
,srt
,verbose_json
, orvtt
.
-
temperature
final TranscriptionCreateParams.Body.Builder temperature(Double temperature)
The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
-
temperature
final TranscriptionCreateParams.Body.Builder temperature(MultipartField<Double> temperature)
The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
-
timestampGranularities
final TranscriptionCreateParams.Body.Builder timestampGranularities(List<TranscriptionCreateParams.TimestampGranularity> timestampGranularities)
The timestamp granularities to populate for this transcription.
response_format
must be setverbose_json
to use timestamp granularities. Either or both of these options are supported:word
, orsegment
. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
-
timestampGranularities
final TranscriptionCreateParams.Body.Builder timestampGranularities(MultipartField<List<TranscriptionCreateParams.TimestampGranularity>> timestampGranularities)
The timestamp granularities to populate for this transcription.
response_format
must be setverbose_json
to use timestamp granularities. Either or both of these options are supported:word
, orsegment
. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
-
addTimestampGranularity
final TranscriptionCreateParams.Body.Builder addTimestampGranularity(TranscriptionCreateParams.TimestampGranularity timestampGranularity)
Adds a single TimestampGranularity to timestampGranularities.
-
build
final TranscriptionCreateParams.Body build()
Returns an immutable instance of Body.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.file() .model()
-
-
-
-