pub struct TranscriptionBuilder { /* private fields */ }Expand description
Builder for audio transcription requests.
Implementations§
Source§impl TranscriptionBuilder
impl TranscriptionBuilder
Sourcepub fn new(file: impl AsRef<Path>, model: impl Into<String>) -> Self
pub fn new(file: impl AsRef<Path>, model: impl Into<String>) -> Self
Create a new transcription builder for the given audio file and model.
Sourcepub fn language(self, language: impl Into<String>) -> Self
pub fn language(self, language: impl Into<String>) -> Self
Provide the input language to improve accuracy.
Sourcepub fn prompt(self, prompt: impl Into<String>) -> Self
pub fn prompt(self, prompt: impl Into<String>) -> Self
Supply a prompt to guide the transcription style.
Sourcepub fn response_format(self, format: AudioResponseFormat) -> Self
pub fn response_format(self, format: AudioResponseFormat) -> Self
Set the desired response format (json, text, srt, verbose_json, vtt).
Sourcepub fn temperature(self, temperature: f64) -> Self
pub fn temperature(self, temperature: f64) -> Self
Control randomness (0.0–1.0). 0.0 yields deterministic output.
Sourcepub fn stream(self, stream: bool) -> Self
pub fn stream(self, stream: bool) -> Self
Enable or disable server-side streaming for partial results.
Sourcepub fn chunking_strategy_auto(self) -> Self
pub fn chunking_strategy_auto(self) -> Self
Use the default automatic chunking strategy.
Sourcepub fn chunking_strategy_vad(self, config: VadConfig) -> Self
pub fn chunking_strategy_vad(self, config: VadConfig) -> Self
Provide a custom VAD configuration for chunking.
Sourcepub fn clear_chunking_strategy(self) -> Self
pub fn clear_chunking_strategy(self) -> Self
Disable chunking hints and fall back to API defaults.
Sourcepub fn timestamp_granularities(
self,
granularities: impl IntoIterator<Item = TimestampGranularity>,
) -> Self
pub fn timestamp_granularities( self, granularities: impl IntoIterator<Item = TimestampGranularity>, ) -> Self
Request specific timestamp granularities.
Sourcepub fn add_timestamp_granularity(
self,
granularity: TimestampGranularity,
) -> Self
pub fn add_timestamp_granularity( self, granularity: TimestampGranularity, ) -> Self
Append a timestamp granularity option.
Sourcepub fn include(self, include: TranscriptionInclude) -> Self
pub fn include(self, include: TranscriptionInclude) -> Self
Include additional metadata (e.g., log probabilities).
Sourcepub fn language_ref(&self) -> Option<&str>
pub fn language_ref(&self) -> Option<&str>
Access the selected language.
Sourcepub fn response_format_ref(&self) -> Option<AudioResponseFormat>
pub fn response_format_ref(&self) -> Option<AudioResponseFormat>
Access the selected response format.
Trait Implementations§
Source§impl Builder<TranscriptionRequest> for TranscriptionBuilder
impl Builder<TranscriptionRequest> for TranscriptionBuilder
Source§fn build(self) -> Result<TranscriptionRequest>
fn build(self) -> Result<TranscriptionRequest>
Build the final request type.
Source§impl Clone for TranscriptionBuilder
impl Clone for TranscriptionBuilder
Source§fn clone(&self) -> TranscriptionBuilder
fn clone(&self) -> TranscriptionBuilder
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 TranscriptionBuilder
impl RefUnwindSafe for TranscriptionBuilder
impl Send for TranscriptionBuilder
impl Sync for TranscriptionBuilder
impl Unpin for TranscriptionBuilder
impl UnwindSafe for TranscriptionBuilder
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