pub struct ZaiClient { /* private fields */ }Expand description
Shared HTTP client for Zhipu AI API requests.
Construct via ZaiClient::builder or ZaiClient::from_env. Cloning a
ZaiClient shares the underlying connection pool, secret and config — it
does not duplicate them.
Implementations§
Source§impl ZaiClient
impl ZaiClient
Sourcepub fn builder(api_key: impl Into<String>) -> ZaiClientBuilder
pub fn builder(api_key: impl Into<String>) -> ZaiClientBuilder
Start a builder that requires an API key.
Sourcepub fn from_env() -> ZaiResult<Self>
pub fn from_env() -> ZaiResult<Self>
Read ZHIPU_API_KEY from the environment and build with defaults.
Sourcepub fn endpoints(&self) -> &EndpointConfig
pub fn endpoints(&self) -> &EndpointConfig
Borrow the validated endpoints.
Sourcepub fn transport(&self) -> &HttpTransportConfig
pub fn transport(&self) -> &HttpTransportConfig
Borrow the transport policy.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ZaiClient
impl !UnwindSafe for ZaiClient
impl Freeze for ZaiClient
impl Send for ZaiClient
impl Sync for ZaiClient
impl Unpin for ZaiClient
impl UnsafeUnpin for ZaiClient
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