pub struct ImageGenRequest<N>{
pub key: String,
/* private fields */
}Expand description
Image generation request structure Provides a typed builder around the image generation API body
Fields§
§key: StringAPI key for authentication
Implementations§
Source§impl<N> ImageGenRequest<N>
impl<N> ImageGenRequest<N>
Sourcepub fn new(model: N, key: String) -> Self
pub fn new(model: N, key: String) -> Self
Create a new image generation request for the given model and API key
Sourcepub fn body_mut(&mut self) -> &mut ImageGenBody<N>
pub fn body_mut(&mut self) -> &mut ImageGenBody<N>
Mutable access to inner body (for advanced customizations)
Sourcepub fn with_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_prompt(self, prompt: impl Into<String>) -> Self
Set prompt text
Sourcepub fn with_quality(self, quality: ImageQuality) -> Self
pub fn with_quality(self, quality: ImageQuality) -> Self
Set image quality
Sourcepub fn with_watermark_enabled(self, watermark_enabled: bool) -> Self
pub fn with_watermark_enabled(self, watermark_enabled: bool) -> Self
Enable/disable watermark
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 user id
pub fn validate(&self) -> ZaiResult<()>
pub async fn send(&self) -> ZaiResult<ImageResponse>
Trait Implementations§
Source§impl<N> HttpClient for ImageGenRequest<N>
impl<N> HttpClient for ImageGenRequest<N>
type Body = ImageGenBody<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 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 ImageGenRequest<N>where
N: Freeze,
impl<N> RefUnwindSafe for ImageGenRequest<N>where
N: RefUnwindSafe,
impl<N> Send for ImageGenRequest<N>where
N: Send,
impl<N> Sync for ImageGenRequest<N>where
N: Sync,
impl<N> Unpin for ImageGenRequest<N>where
N: Unpin,
impl<N> UnsafeUnpin for ImageGenRequest<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for ImageGenRequest<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