Class TranscriptionCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class TranscriptionCreateParams implements Params
Transcribes audio into the input language.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
TranscriptionCreateParams.Builder
A builder for TranscriptionCreateParams.
public final class
TranscriptionCreateParams.Body
public final class
TranscriptionCreateParams.TimestampGranularity
-
Method Summary
Modifier and Type Method Description final 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 AudioModel
model()
ID of the model to use. final Optional<List<TranscriptionInclude>>
include()
Additional information to include in the transcription response. final Optional<String>
language()
The language of the input audio. final Optional<String>
prompt()
An optional text to guide the model's style or continue a previous audio segment. final Optional<AudioResponseFormat>
responseFormat()
The format of the output, in one of these options: json
,text
,srt
,verbose_json
, orvtt
.final Optional<Double>
temperature()
The sampling temperature, between 0 and 1. final Optional<List<TranscriptionCreateParams.TimestampGranularity>>
timestampGranularities()
The timestamp granularities to populate for this transcription. final MultipartField<InputStream>
_file()
Returns the raw multipart value of file. final MultipartField<AudioModel>
_model()
Returns the raw multipart value of model. final MultipartField<List<TranscriptionInclude>>
_include()
Returns the raw multipart value of include. final MultipartField<String>
_language()
Returns the raw multipart value of language. final MultipartField<String>
_prompt()
Returns the raw multipart value of prompt. final MultipartField<AudioResponseFormat>
_responseFormat()
Returns the raw multipart value of responseFormat. final MultipartField<Double>
_temperature()
Returns the raw multipart value of temperature. final MultipartField<List<TranscriptionCreateParams.TimestampGranularity>>
_timestampGranularities()
Returns the raw multipart value of timestampGranularities. final Headers
_additionalHeaders()
final QueryParams
_additionalQueryParams()
final TranscriptionCreateParams.Builder
toBuilder()
Headers
_headers()
The full set of headers in the parameters, including both fixed and additional headers. QueryParams
_queryParams()
The full set of query params in the parameters, including both fixed and additional query params. Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static TranscriptionCreateParams.Builder
builder()
Returns a mutable builder for constructing an instance of TranscriptionCreateParams. -
-
Method Detail
-
file
final 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.
-
model
final 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).
-
include
final Optional<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
.
-
language
final Optional<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 Optional<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 Optional<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
.
-
temperature
final Optional<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 Optional<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.
-
_file
final MultipartField<InputStream> _file()
Returns the raw multipart value of file.
Unlike file, this method doesn't throw if the multipart field has an unexpected type.
-
_model
final MultipartField<AudioModel> _model()
Returns the raw multipart value of model.
Unlike model, this method doesn't throw if the multipart field has an unexpected type.
-
_include
final MultipartField<List<TranscriptionInclude>> _include()
Returns the raw multipart value of include.
Unlike include, this method doesn't throw if the multipart field has an unexpected type.
-
_language
final MultipartField<String> _language()
Returns the raw multipart value of language.
Unlike language, this method doesn't throw if the multipart field has an unexpected type.
-
_prompt
final MultipartField<String> _prompt()
Returns the raw multipart value of prompt.
Unlike prompt, this method doesn't throw if the multipart field has an unexpected type.
-
_responseFormat
final MultipartField<AudioResponseFormat> _responseFormat()
Returns the raw multipart value of responseFormat.
Unlike responseFormat, this method doesn't throw if the multipart field has an unexpected type.
-
_temperature
final MultipartField<Double> _temperature()
Returns the raw multipart value of temperature.
Unlike temperature, this method doesn't throw if the multipart field has an unexpected type.
-
_timestampGranularities
final MultipartField<List<TranscriptionCreateParams.TimestampGranularity>> _timestampGranularities()
Returns the raw multipart value of timestampGranularities.
Unlike timestampGranularities, this method doesn't throw if the multipart field has an unexpected type.
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
toBuilder
final TranscriptionCreateParams.Builder toBuilder()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
builder
final static TranscriptionCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of TranscriptionCreateParams.
The following fields are required:
.file() .model()
-
-
-
-