Class TranslationCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class TranslationCreateParams.Body.BuilderA builder for Body.
-
-
Method Summary
Modifier and Type Method Description final TranslationCreateParams.Body.Builderfile(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. final TranslationCreateParams.Body.Builderfile(MultipartField<InputStream> file)Sets Builder.file to an arbitrary multipart value. final TranslationCreateParams.Body.Builderfile(ByteArray file)The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranslationCreateParams.Body.Builderfile(Path path)The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. final TranslationCreateParams.Body.Buildermodel(AudioModel model)ID of the model to use. final TranslationCreateParams.Body.Buildermodel(MultipartField<AudioModel> model)Sets Builder.model to an arbitrary multipart value. final TranslationCreateParams.Body.Buildermodel(String value)Sets model to an arbitrary String. final TranslationCreateParams.Body.Builderprompt(String prompt)An optional text to guide the model's style or continue a previous audio segment. final TranslationCreateParams.Body.Builderprompt(MultipartField<String> prompt)Sets Builder.prompt to an arbitrary multipart value. final TranslationCreateParams.Body.BuilderresponseFormat(TranslationCreateParams.ResponseFormat responseFormat)The format of the output, in one of these options: json,text,srt,verbose_json, orvtt.final TranslationCreateParams.Body.BuilderresponseFormat(MultipartField<TranslationCreateParams.ResponseFormat> responseFormat)Sets Builder.responseFormat to an arbitrary multipart value. final TranslationCreateParams.Body.Buildertemperature(Double temperature)The sampling temperature, between 0 and 1. final TranslationCreateParams.Body.Buildertemperature(MultipartField<Double> temperature)Sets Builder.temperature to an arbitrary multipart value. final TranslationCreateParams.Body.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final TranslationCreateParams.Body.BuilderputAdditionalProperty(String key, JsonValue value)final TranslationCreateParams.Body.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final TranslationCreateParams.Body.BuilderremoveAdditionalProperty(String key)final TranslationCreateParams.Body.BuilderremoveAllAdditionalProperties(Set<String> keys)final TranslationCreateParams.Bodybuild()Returns an immutable instance of Body. -
-
Method Detail
-
file
final TranslationCreateParams.Body.Builder file(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.
-
file
final TranslationCreateParams.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 TranslationCreateParams.Body.Builder file(ByteArray file)
The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
file
final TranslationCreateParams.Body.Builder file(Path path)
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 TranslationCreateParams.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 TranslationCreateParams.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 TranslationCreateParams.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.
-
prompt
final TranslationCreateParams.Body.Builder prompt(String prompt)
An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
-
prompt
final TranslationCreateParams.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 TranslationCreateParams.Body.Builder responseFormat(TranslationCreateParams.ResponseFormat responseFormat)
The format of the output, in one of these options:
json,text,srt,verbose_json, orvtt.
-
responseFormat
final TranslationCreateParams.Body.Builder responseFormat(MultipartField<TranslationCreateParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary multipart value.
You should usually call Builder.responseFormat with a well-typed ResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final TranslationCreateParams.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 TranslationCreateParams.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.
-
additionalProperties
final TranslationCreateParams.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final TranslationCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final TranslationCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final TranslationCreateParams.Body.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final TranslationCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final TranslationCreateParams.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()
-
-
-
-