pub struct AsyncImageGenerationRequest { /* private fields */ }Expand description
Request for POST /async/images/generations.
Implementations§
Source§impl AsyncImageGenerationRequest
impl AsyncImageGenerationRequest
Sourcepub fn new(prompt: impl Into<String>) -> Self
pub fn new(prompt: impl Into<String>) -> Self
Create a GLM-Image request from the required prompt.
Sourcepub fn with_quality(self, quality: AsyncImageQuality) -> Self
pub fn with_quality(self, quality: AsyncImageQuality) -> Self
Select the image quality.
Sourcepub fn with_size(self, size: impl Into<String>) -> Self
pub fn with_size(self, size: impl Into<String>) -> Self
Set a recommended or valid custom image size.
Sourcepub fn with_watermark(self, enabled: bool) -> Self
pub fn with_watermark(self, enabled: bool) -> Self
Configure generated-image watermarking.
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 identifier used for abuse monitoring.
Sourcepub const fn quality(&self) -> Option<AsyncImageQuality>
pub const fn quality(&self) -> Option<AsyncImageQuality>
Return the configured quality.
Sourcepub const fn watermark_enabled(&self) -> Option<bool>
pub const fn watermark_enabled(&self) -> Option<bool>
Return the configured watermark flag.
Sourcepub fn validate(&self) -> ZaiResult<()>
pub fn validate(&self) -> ZaiResult<()>
Validate documented prompt, size, and user-id constraints.
Sourcepub async fn send_via(&self, client: &ZaiClient) -> ZaiResult<AsyncResponse>
pub async fn send_via(&self, client: &ZaiClient) -> ZaiResult<AsyncResponse>
Validate, send, and decode the async task response.
Trait Implementations§
Source§impl Clone for AsyncImageGenerationRequest
impl Clone for AsyncImageGenerationRequest
Source§fn clone(&self) -> AsyncImageGenerationRequest
fn clone(&self) -> AsyncImageGenerationRequest
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 Debug for AsyncImageGenerationRequest
impl Debug for AsyncImageGenerationRequest
Auto Trait Implementations§
impl Freeze for AsyncImageGenerationRequest
impl RefUnwindSafe for AsyncImageGenerationRequest
impl Send for AsyncImageGenerationRequest
impl Sync for AsyncImageGenerationRequest
impl Unpin for AsyncImageGenerationRequest
impl UnsafeUnpin for AsyncImageGenerationRequest
impl UnwindSafe for AsyncImageGenerationRequest
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