pub struct ImageGenerationBuilder { /* private fields */ }Expand description
Builder for image generation (/images/generations).
Implementations§
Source§impl ImageGenerationBuilder
impl ImageGenerationBuilder
Sourcepub fn new(prompt: impl Into<String>) -> Self
pub fn new(prompt: impl Into<String>) -> Self
Create a new generation builder with the required prompt text.
Sourcepub fn model(self, model: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
Override the model (gpt-image-1, dall-e-3, etc.).
Sourcepub fn response_format(self, format: ResponseFormat) -> Self
pub fn response_format(self, format: ResponseFormat) -> Self
Select the response format for dall-e-* models.
Sourcepub fn output_format(self, format: OutputFormat) -> Self
pub fn output_format(self, format: OutputFormat) -> Self
Choose the binary output format (only supported for gpt-image-1).
Sourcepub fn output_compression(self, compression: i32) -> Self
pub fn output_compression(self, compression: i32) -> Self
Tune image compression (0-100). Only applies to JPEG/WEBP outputs.
Sourcepub fn partial_images(self, partial_images: Option<i32>) -> Self
pub fn partial_images(self, partial_images: Option<i32>) -> Self
Configure the number of partial images to emit when streaming (0-3).
Sourcepub fn moderation(self, moderation: Moderation) -> Self
pub fn moderation(self, moderation: Moderation) -> Self
Control content moderation (auto/low).
Sourcepub fn background(self, background: Background) -> Self
pub fn background(self, background: Background) -> Self
Configure transparent/opaque backgrounds.
Trait Implementations§
Source§impl Builder<CreateImageRequest> for ImageGenerationBuilder
impl Builder<CreateImageRequest> for ImageGenerationBuilder
Source§fn build(self) -> Result<CreateImageRequest>
fn build(self) -> Result<CreateImageRequest>
Build the final request type.
Source§impl Clone for ImageGenerationBuilder
impl Clone for ImageGenerationBuilder
Source§fn clone(&self) -> ImageGenerationBuilder
fn clone(&self) -> ImageGenerationBuilder
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 ImageGenerationBuilder
impl RefUnwindSafe for ImageGenerationBuilder
impl Send for ImageGenerationBuilder
impl Sync for ImageGenerationBuilder
impl Unpin for ImageGenerationBuilder
impl UnwindSafe for ImageGenerationBuilder
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