Class TranslationCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class TranslationCreateParams implements Params
Translates audio into English.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classTranslationCreateParams.BuilderA builder for TranslationCreateParams.
public final classTranslationCreateParams.Bodypublic final classTranslationCreateParams.ResponseFormatThe format of the output, in one of these options:
json,text,srt,verbose_json, orvtt.
-
Method Summary
Modifier and Type Method Description final InputStreamfile()The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final AudioModelmodel()ID of the model to use. final Optional<String>prompt()An optional text to guide the model's style or continue a previous audio segment. final Optional<TranslationCreateParams.ResponseFormat>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 MultipartField<InputStream>_file()Returns the raw multipart value of file. final MultipartField<AudioModel>_model()Returns the raw multipart value of model. final MultipartField<String>_prompt()Returns the raw multipart value of prompt. final MultipartField<TranslationCreateParams.ResponseFormat>_responseFormat()Returns the raw multipart value of responseFormat. final MultipartField<Double>_temperature()Returns the raw multipart value of temperature. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final TranslationCreateParams.BuildertoBuilder()final Map<String, MultipartField<?>>_body()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. Booleanequals(Object other)IntegerhashCode()StringtoString()final static TranslationCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of TranslationCreateParams. -
-
Method Detail
-
file
final InputStream file()
The audio file object (not file name) translate, 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. Only
whisper-1(which is powered by our open source Whisper V2 model) is currently available.
-
prompt
final Optional<String> prompt()
An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
-
responseFormat
final Optional<TranslationCreateParams.ResponseFormat> responseFormat()
The format of the output, in one of these options:
json,text,srt,verbose_json, orvtt.
-
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.
-
_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.
-
_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<TranslationCreateParams.ResponseFormat> _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.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final TranslationCreateParams.Builder toBuilder()
-
_body
final Map<String, MultipartField<?>> _body()
-
_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 TranslationCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of TranslationCreateParams.
The following fields are required:
.file() .model()
-
-
-
-