pub struct AudioToTextRequest<N>{
pub key: String,
pub body: AudioToTextBody<N>,
/* private fields */
}Expand description
Audio transcription request (multipart/form-data)
Fields§
§key: String§body: AudioToTextBody<N>Implementations§
Source§impl<N> AudioToTextRequest<N>
impl<N> AudioToTextRequest<N>
pub fn new(model: N, key: String) -> Self
pub fn with_file_path(self, path: impl Into<String>) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_stream(self, stream: bool) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn validate(&self) -> ZaiResult<()>
pub async fn send(&self) -> ZaiResult<AudioToTextResponse>
Trait Implementations§
Source§impl<N> HttpClient for AudioToTextRequest<N>
impl<N> HttpClient for AudioToTextRequest<N>
type Body = AudioToTextBody<N>
type ApiUrl = &'static str
type ApiKey = String
fn api_url(&self) -> &Self::ApiUrl
fn api_key(&self) -> &Self::ApiKey
fn body(&self) -> &Self::Body
Source§fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
Sends a POST request to the API endpoint. Read more
Source§fn http_config(&self) -> Arc<HttpClientConfig> ⓘ
fn http_config(&self) -> Arc<HttpClientConfig> ⓘ
Get HTTP client configuration for this request Read more
Auto Trait Implementations§
impl<N> Freeze for AudioToTextRequest<N>where
N: Freeze,
impl<N> RefUnwindSafe for AudioToTextRequest<N>where
N: RefUnwindSafe,
impl<N> Send for AudioToTextRequest<N>where
N: Send,
impl<N> Sync for AudioToTextRequest<N>where
N: Sync,
impl<N> Unpin for AudioToTextRequest<N>where
N: Unpin,
impl<N> UnsafeUnpin for AudioToTextRequest<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for AudioToTextRequest<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