Class TranscriptionCreateParams.Builder
-
- All Implemented Interfaces:
public final class TranscriptionCreateParams.Builder
A builder for TranscriptionCreateParams.
-
-
Method Summary
-
-
Method Detail
-
file
final TranscriptionCreateParams.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.Builder file(MultipartField<InputStream> file)
Sets Builder.file to an arbitrary multipart value.
You should usually call Builder.file with a well-typed InputStream value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
file
final TranscriptionCreateParams.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.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.Builder model(AudioModel model)
ID of the model to use. The options are
gpt-4o-transcribe
,gpt-4o-mini-transcribe
, andwhisper-1
(which is powered by our open source Whisper V2 model).
-
model
final TranscriptionCreateParams.Builder model(MultipartField<AudioModel> model)
Sets Builder.model to an arbitrary multipart value.
You should usually call Builder.model with a well-typed AudioModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final TranscriptionCreateParams.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.
-
include
final TranscriptionCreateParams.Builder include(List<TranscriptionInclude> include)
Additional information to include in the transcription response.
logprobs
will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription.logprobs
only works with response_format set tojson
and only with the modelsgpt-4o-transcribe
andgpt-4o-mini-transcribe
.
-
include
final TranscriptionCreateParams.Builder include(MultipartField<List<TranscriptionInclude>> include)
Sets Builder.include to an arbitrary multipart value.
You should usually call Builder.include with a well-typed
List<TranscriptionInclude>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInclude
final TranscriptionCreateParams.Builder addInclude(TranscriptionInclude include)
Adds a single TranscriptionInclude to Builder.include.
-
language
final TranscriptionCreateParams.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.Builder language(MultipartField<String> language)
Sets Builder.language to an arbitrary multipart value.
You should usually call Builder.language with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
prompt
final TranscriptionCreateParams.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.Builder prompt(MultipartField<String> prompt)
Sets Builder.prompt to an arbitrary multipart value.
You should usually call Builder.prompt with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final TranscriptionCreateParams.Builder responseFormat(AudioResponseFormat responseFormat)
The format of the output, in one of these options:
json
,text
,srt
,verbose_json
, orvtt
. Forgpt-4o-transcribe
andgpt-4o-mini-transcribe
, the only supported format isjson
.
-
responseFormat
final TranscriptionCreateParams.Builder responseFormat(MultipartField<AudioResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary multipart value.
You should usually call Builder.responseFormat with a well-typed AudioResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final TranscriptionCreateParams.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.Builder temperature(MultipartField<Double> temperature)
Sets Builder.temperature to an arbitrary multipart value.
You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
timestampGranularities
final TranscriptionCreateParams.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.Builder timestampGranularities(MultipartField<List<TranscriptionCreateParams.TimestampGranularity>> timestampGranularities)
Sets Builder.timestampGranularities to an arbitrary multipart value.
You should usually call Builder.timestampGranularities with a well-typed
List<TimestampGranularity>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTimestampGranularity
final TranscriptionCreateParams.Builder addTimestampGranularity(TranscriptionCreateParams.TimestampGranularity timestampGranularity)
Adds a single TimestampGranularity to timestampGranularities.
-
additionalHeaders
final TranscriptionCreateParams.Builder additionalHeaders(Headers additionalHeaders)
-
additionalHeaders
final TranscriptionCreateParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
putAdditionalHeader
final TranscriptionCreateParams.Builder putAdditionalHeader(String name, String value)
-
putAdditionalHeaders
final TranscriptionCreateParams.Builder putAdditionalHeaders(String name, Iterable<String> values)
-
putAllAdditionalHeaders
final TranscriptionCreateParams.Builder putAllAdditionalHeaders(Headers additionalHeaders)
-
putAllAdditionalHeaders
final TranscriptionCreateParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
replaceAdditionalHeaders
final TranscriptionCreateParams.Builder replaceAdditionalHeaders(String name, String value)
-
replaceAdditionalHeaders
final TranscriptionCreateParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values)
-
replaceAllAdditionalHeaders
final TranscriptionCreateParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders)
-
replaceAllAdditionalHeaders
final TranscriptionCreateParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
removeAdditionalHeaders
final TranscriptionCreateParams.Builder removeAdditionalHeaders(String name)
-
removeAllAdditionalHeaders
final TranscriptionCreateParams.Builder removeAllAdditionalHeaders(Set<String> names)
-
additionalQueryParams
final TranscriptionCreateParams.Builder additionalQueryParams(QueryParams additionalQueryParams)
-
additionalQueryParams
final TranscriptionCreateParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
putAdditionalQueryParam
final TranscriptionCreateParams.Builder putAdditionalQueryParam(String key, String value)
-
putAdditionalQueryParams
final TranscriptionCreateParams.Builder putAdditionalQueryParams(String key, Iterable<String> values)
-
putAllAdditionalQueryParams
final TranscriptionCreateParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
putAllAdditionalQueryParams
final TranscriptionCreateParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
replaceAdditionalQueryParams
final TranscriptionCreateParams.Builder replaceAdditionalQueryParams(String key, String value)
-
replaceAdditionalQueryParams
final TranscriptionCreateParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values)
-
replaceAllAdditionalQueryParams
final TranscriptionCreateParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
replaceAllAdditionalQueryParams
final TranscriptionCreateParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
removeAdditionalQueryParams
final TranscriptionCreateParams.Builder removeAdditionalQueryParams(String key)
-
removeAllAdditionalQueryParams
final TranscriptionCreateParams.Builder removeAllAdditionalQueryParams(Set<String> keys)
-
build
final TranscriptionCreateParams build()
Returns an immutable instance of TranscriptionCreateParams.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.file() .model()
-
-
-
-