pub struct TranscriptionRequest {
pub audio: AudioInput,
pub model: String,
pub language: Option<String>,
pub prompt: Option<String>,
pub response_format: Option<TranscriptFormat>,
pub timestamp_granularities: Option<Vec<TimestampGranularity>>,
}Expand description
Request for transcribing audio to text.
Fields§
§audio: AudioInputThe audio to transcribe.
model: StringThe model to use (e.g., “whisper-1”).
language: Option<String>Language of the audio (ISO-639-1 code).
prompt: Option<String>Prompt to guide transcription style.
response_format: Option<TranscriptFormat>Response format.
timestamp_granularities: Option<Vec<TimestampGranularity>>Timestamp granularities to include.
Implementations§
Source§impl TranscriptionRequest
impl TranscriptionRequest
Sourcepub fn new(model: impl Into<String>, audio: AudioInput) -> Self
pub fn new(model: impl Into<String>, audio: AudioInput) -> Self
Create a new transcription request.
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Set the language.
Sourcepub fn with_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_prompt(self, prompt: impl Into<String>) -> Self
Set a prompt to guide transcription.
Sourcepub fn with_format(self, format: TranscriptFormat) -> Self
pub fn with_format(self, format: TranscriptFormat) -> Self
Set the response format.
Sourcepub fn with_word_timestamps(self) -> Self
pub fn with_word_timestamps(self) -> Self
Enable word-level timestamps.
Sourcepub fn with_segment_timestamps(self) -> Self
pub fn with_segment_timestamps(self) -> Self
Enable segment-level timestamps.
Trait Implementations§
Source§impl Clone for TranscriptionRequest
impl Clone for TranscriptionRequest
Source§fn clone(&self) -> TranscriptionRequest
fn clone(&self) -> TranscriptionRequest
Returns a duplicate 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 TranscriptionRequest
impl RefUnwindSafe for TranscriptionRequest
impl Send for TranscriptionRequest
impl Sync for TranscriptionRequest
impl Unpin for TranscriptionRequest
impl UnwindSafe for TranscriptionRequest
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