pub struct SpeechToTextRequest {
pub file: Vec<u8>,
pub model: Option<String>,
pub temperature: Option<f64>,
pub language: Option<String>,
pub english_text: bool,
pub prompt: Option<String>,
pub response_format: Option<String>,
}
Expand description
Represents a request to the speech-to-text API.
file
: The audio file to be transcribed.model
: The speech recognition model to use.temperature
: The temperature parameter to control the randomness of the transcription.language
: The language of the audio file.english_text
: If true, the API will use the translation endpoint instead of the transcription endpoint.prompt
: An optional prompt to provide context for the transcription.response_format
: The desired format of the transcription response, either “text” or “json”.
Fields§
§file: Vec<u8>
§model: Option<String>
§temperature: Option<f64>
§language: Option<String>
§english_text: bool
If true, the API will use following path: /audio/translations
instead of /audio/transcriptions
prompt: Option<String>
§response_format: Option<String>
Implementations§
Source§impl SpeechToTextRequest
Constructs a new SpeechToTextRequest
with the given audio file.
impl SpeechToTextRequest
Constructs a new SpeechToTextRequest
with the given audio file.
§Arguments
file
- The audio file to be transcribed.
§Returns
A new SpeechToTextRequest
instance with the given audio file and default values for other fields.
pub fn new(file: Vec<u8>) -> Self
Sourcepub fn temperature(self, temperature: f64) -> Self
pub fn temperature(self, temperature: f64) -> Self
Sourcepub fn english_text(self, english_text: bool) -> Self
pub fn english_text(self, english_text: bool) -> Self
Sourcepub fn response_format(self, response_format: &str) -> Self
pub fn response_format(self, response_format: &str) -> Self
Trait Implementations§
Source§impl Clone for SpeechToTextRequest
impl Clone for SpeechToTextRequest
Source§fn clone(&self) -> SpeechToTextRequest
fn clone(&self) -> SpeechToTextRequest
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SpeechToTextRequest
impl RefUnwindSafe for SpeechToTextRequest
impl Send for SpeechToTextRequest
impl Sync for SpeechToTextRequest
impl Unpin for SpeechToTextRequest
impl UnwindSafe for SpeechToTextRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more