pub struct SyncXaiClient { /* private fields */ }Expand description
Blocking/sync facade for the xAI SDK.
Implementations§
Source§impl SyncXaiClient
impl SyncXaiClient
Sourcepub fn new(api_key: impl Into<String>) -> Result<Self>
pub fn new(api_key: impl Into<String>) -> Result<Self>
Create a blocking client from an API key.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Create a blocking client from the XAI_API_KEY environment variable.
Sourcepub fn with_async_client(client: XaiClient) -> Result<Self>
pub fn with_async_client(client: XaiClient) -> Result<Self>
Create a blocking facade from an existing async client.
Sourcepub fn as_async_client(&self) -> &XaiClient
pub fn as_async_client(&self) -> &XaiClient
Get the wrapped async client.
Sourcepub fn responses(&self) -> SyncResponsesApi
pub fn responses(&self) -> SyncResponsesApi
Access blocking Responses API helpers.
Sourcepub fn auth(&self) -> SyncAuthApi
pub fn auth(&self) -> SyncAuthApi
Access blocking Auth API helpers.
Sourcepub fn models(&self) -> SyncModelsApi
pub fn models(&self) -> SyncModelsApi
Access blocking Models API helpers.
Sourcepub fn chat(&self) -> SyncChatApi
pub fn chat(&self) -> SyncChatApi
Access blocking legacy Chat Completions API helpers.
Sourcepub fn images(&self) -> SyncImagesApi
pub fn images(&self) -> SyncImagesApi
Access blocking Images API helpers.
Sourcepub fn videos(&self) -> SyncVideosApi
pub fn videos(&self) -> SyncVideosApi
Access blocking Videos API helpers.
Sourcepub fn batch(&self) -> SyncBatchApi
pub fn batch(&self) -> SyncBatchApi
Access blocking Batch API helpers.
Sourcepub fn collections(&self) -> SyncCollectionsApi
pub fn collections(&self) -> SyncCollectionsApi
Access blocking Collections API helpers.
Sourcepub fn files(&self) -> SyncFilesApi
pub fn files(&self) -> SyncFilesApi
Access blocking Files API helpers.
Sourcepub fn tokenizer(&self) -> SyncTokenizerApi
pub fn tokenizer(&self) -> SyncTokenizerApi
Access blocking Tokenizer API helpers.
Trait Implementations§
Source§impl Clone for SyncXaiClient
impl Clone for SyncXaiClient
Source§fn clone(&self) -> SyncXaiClient
fn clone(&self) -> SyncXaiClient
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 SyncXaiClient
impl !RefUnwindSafe for SyncXaiClient
impl Send for SyncXaiClient
impl Sync for SyncXaiClient
impl Unpin for SyncXaiClient
impl UnsafeUnpin for SyncXaiClient
impl !UnwindSafe for SyncXaiClient
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