pub struct AudioToTextBody<N>where
N: AudioToText,{ /* private fields */ }Expand description
Body parameters holder for audio transcription (used to build the multipart form).
prompt is optional and the upstream 8,000-character guidance remains
advisory. The SDK validates the hot-word count and identifier lengths.
Implementations§
Source§impl<N> AudioToTextBody<N>where
N: AudioToText,
impl<N> AudioToTextBody<N>where
N: AudioToText,
Sourcepub fn new(model: N) -> Self
pub fn new(model: N) -> Self
Create a new transcription body for the given model (all options empty).
Sourcepub fn is_streaming(&self) -> bool
pub fn is_streaming(&self) -> bool
Whether this body requests an SSE response.
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Borrow the optional client request identifier.
Sourcepub fn with_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_prompt(self, prompt: impl Into<String>) -> Self
Set an optional prompt (advisory 8000-char limit; not hard-rejected).
Sourcepub fn with_hotwords(self, hotwords: Vec<String>) -> ZaiResult<Self>
pub fn with_hotwords(self, hotwords: Vec<String>) -> ZaiResult<Self>
Set the hot-word list (at most 100 entries).
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Set the client-side request id (6..=64 chars).
Sourcepub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
Set the end-user id (6..=128 chars).
Trait Implementations§
Source§impl<N> Clone for AudioToTextBody<N>where
N: AudioToText + Clone,
impl<N> Clone for AudioToTextBody<N>where
N: AudioToText + Clone,
Source§fn clone(&self) -> AudioToTextBody<N>
fn clone(&self) -> AudioToTextBody<N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<N> Debug for AudioToTextBody<N>where
N: AudioToText + Debug,
impl<N> Debug for AudioToTextBody<N>where
N: AudioToText + Debug,
Source§impl<N> Serialize for AudioToTextBody<N>where
N: AudioToText + Serialize,
impl<N> Serialize for AudioToTextBody<N>where
N: AudioToText + Serialize,
Source§impl<N> Validate for AudioToTextBody<N>where
N: AudioToText,
impl<N> Validate for AudioToTextBody<N>where
N: AudioToText,
Source§impl<'v_a, N> ValidateArgs<'v_a> for AudioToTextBody<N>where
N: AudioToText,
impl<'v_a, N> ValidateArgs<'v_a> for AudioToTextBody<N>where
N: AudioToText,
Auto Trait Implementations§
impl<N> Freeze for AudioToTextBody<N>where
N: Freeze,
impl<N> RefUnwindSafe for AudioToTextBody<N>where
N: RefUnwindSafe,
impl<N> Send for AudioToTextBody<N>where
N: Send,
impl<N> Sync for AudioToTextBody<N>where
N: Sync,
impl<N> Unpin for AudioToTextBody<N>where
N: Unpin,
impl<N> UnsafeUnpin for AudioToTextBody<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for AudioToTextBody<N>where
N: UnwindSafe,
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