pub struct WhisperRequestBuilder { /* private fields */ }
Expand description
Builder for WhisperRequest
.
Implementations§
Source§impl WhisperRequestBuilder
impl WhisperRequestBuilder
Sourcepub fn file(&mut self, value: Vec<u8>) -> &mut Self
pub fn file(&mut self, value: Vec<u8>) -> &mut Self
The audio file object (not file name) to transcribe/translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
Sourcepub fn model(&mut self, value: WhisperModel) -> &mut Self
pub fn model(&mut self, value: WhisperModel) -> &mut Self
ID of the model to use. Only whisper-1 is currently available.
Sourcepub fn language<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn language<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency. Should not use this for translation
Sourcepub fn prompt<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn prompt<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
An optional text to guide the model’s style or continue a previous audio segment. The prompt should match the audio language for transcription, and should be English only for translation.
Sourcepub fn response_format(&mut self, value: WhisperResponseFormat) -> &mut Self
pub fn response_format(&mut self, value: WhisperResponseFormat) -> &mut Self
The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
Sourcepub fn temperature(&mut self, value: f32) -> &mut Self
pub fn temperature(&mut self, value: f32) -> &mut Self
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.
pub fn request_type(&mut self, value: WhisperRequestType) -> &mut Self
Sourcepub fn build(&self) -> Result<WhisperRequest, WhisperRequestBuilderError>
pub fn build(&self) -> Result<WhisperRequest, WhisperRequestBuilderError>
Trait Implementations§
Source§impl Clone for WhisperRequestBuilder
impl Clone for WhisperRequestBuilder
Source§fn clone(&self) -> WhisperRequestBuilder
fn clone(&self) -> WhisperRequestBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more