Class TranscriptionCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class TranscriptionCreateParams.Body.BuilderA builder for Body.
-
-
Method Summary
-
-
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)
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.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 path)
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. The options are
gpt-4o-transcribe,gpt-4o-mini-transcribe,whisper-1(which is powered by our open source Whisper V2 model), andgpt-4o-transcribe-diarize.
-
model
final TranscriptionCreateParams.Body.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.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.
-
chunkingStrategy
final TranscriptionCreateParams.Body.Builder chunkingStrategy(TranscriptionCreateParams.ChunkingStrategy chunkingStrategy)
Controls how the audio is cut into chunks. When set to
"auto", the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries.server_vadobject can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when usinggpt-4o-transcribe-diarizefor inputs longer than 30 seconds.
-
chunkingStrategy
final TranscriptionCreateParams.Body.Builder chunkingStrategy(Optional<TranscriptionCreateParams.ChunkingStrategy> chunkingStrategy)
Alias for calling Builder.chunkingStrategy with
chunkingStrategy.orElse(null).
-
chunkingStrategy
final TranscriptionCreateParams.Body.Builder chunkingStrategy(MultipartField<TranscriptionCreateParams.ChunkingStrategy> chunkingStrategy)
Sets Builder.chunkingStrategy to an arbitrary multipart value.
You should usually call Builder.chunkingStrategy with a well-typed ChunkingStrategy value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
chunkingStrategy
final TranscriptionCreateParams.Body.Builder chunkingStrategy(TranscriptionCreateParams.ChunkingStrategy.VadConfig vadConfig)
Alias for calling chunkingStrategy with
ChunkingStrategy.ofVadConfig(vadConfig).
-
chunkingStrategyAuto
final TranscriptionCreateParams.Body.Builder chunkingStrategyAuto()
Alias for calling chunkingStrategy with
ChunkingStrategy.ofAuto().
-
include
final TranscriptionCreateParams.Body.Builder include(List<TranscriptionInclude> include)
Additional information to include in the transcription response.
logprobswill return the log probabilities of the tokens in the response to understand the model's confidence in the transcription.logprobsonly works with response_format set tojsonand only with the modelsgpt-4o-transcribeandgpt-4o-mini-transcribe. This field is not supported when usinggpt-4o-transcribe-diarize.
-
include
final TranscriptionCreateParams.Body.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.Body.Builder addInclude(TranscriptionInclude include)
Adds a single TranscriptionInclude to Builder.include.
-
knownSpeakerNames
final TranscriptionCreateParams.Body.Builder knownSpeakerNames(List<String> knownSpeakerNames)
Optional list of speaker names that correspond to the audio samples provided in
known_speaker_references[]. Each entry should be a short identifier (for examplecustomeroragent). Up to 4 speakers are supported.
-
knownSpeakerNames
final TranscriptionCreateParams.Body.Builder knownSpeakerNames(MultipartField<List<String>> knownSpeakerNames)
Sets Builder.knownSpeakerNames to an arbitrary multipart value.
You should usually call Builder.knownSpeakerNames with a well-typed
List<String>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addKnownSpeakerName
final TranscriptionCreateParams.Body.Builder addKnownSpeakerName(String knownSpeakerName)
Adds a single String to knownSpeakerNames.
-
knownSpeakerReferences
final TranscriptionCreateParams.Body.Builder knownSpeakerReferences(List<String> knownSpeakerReferences)
Optional list of audio samples (as data URLs) that contain known speaker references matching
known_speaker_names[]. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported byfile.
-
knownSpeakerReferences
final TranscriptionCreateParams.Body.Builder knownSpeakerReferences(MultipartField<List<String>> knownSpeakerReferences)
Sets Builder.knownSpeakerReferences to an arbitrary multipart value.
You should usually call Builder.knownSpeakerReferences with a well-typed
List<String>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addKnownSpeakerReference
final TranscriptionCreateParams.Body.Builder addKnownSpeakerReference(String knownSpeakerReference)
Adds a single String to knownSpeakerReferences.
-
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)
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.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. This field is not supported when using
gpt-4o-transcribe-diarize.
-
prompt
final TranscriptionCreateParams.Body.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.Body.Builder responseFormat(AudioResponseFormat responseFormat)
The format of the output, in one of these options:
json,text,srt,verbose_json,vtt, ordiarized_json. Forgpt-4o-transcribeandgpt-4o-mini-transcribe, the only supported format isjson. Forgpt-4o-transcribe-diarize, the supported formats arejson,text, anddiarized_json, withdiarized_jsonrequired to receive speaker annotations.
-
responseFormat
final TranscriptionCreateParams.Body.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.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)
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.Body.Builder timestampGranularities(List<TranscriptionCreateParams.TimestampGranularity> timestampGranularities)
The timestamp granularities to populate for this transcription.
response_formatmust be setverbose_jsonto 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. This option is not available forgpt-4o-transcribe-diarize.
-
timestampGranularities
final TranscriptionCreateParams.Body.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.Body.Builder addTimestampGranularity(TranscriptionCreateParams.TimestampGranularity timestampGranularity)
Adds a single TimestampGranularity to timestampGranularities.
-
additionalProperties
final TranscriptionCreateParams.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final TranscriptionCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final TranscriptionCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final TranscriptionCreateParams.Body.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final TranscriptionCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys)
-
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()
-
-
-
-