pub struct Client { /* private fields */ }Expand description
Zhipu AI API client wrapper
Provides a unified interface for chat completion and text-to-speech APIs. Supports model selection, thinking mode, and coding plan endpoint.
Implementations§
Source§impl Client
impl Client
Sourcepub fn with_model(self, model: Model) -> Self
pub fn with_model(self, model: Model) -> Self
Set the AI model for chat completion
Sourcepub fn with_thinking(self, enable: bool) -> Self
pub fn with_thinking(self, enable: bool) -> Self
Enable or disable thinking mode for chat completion
Sourcepub fn with_coding_plan(self, enable: bool) -> Self
pub fn with_coding_plan(self, enable: bool) -> Self
Enable or disable coding plan endpoint
Sourcepub async fn chat_completion(&self, prompt: &str) -> Result<String>
pub async fn chat_completion(&self, prompt: &str) -> Result<String>
Perform chat completion
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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