pub struct GenerateImageBuilder { /* private fields */ }Expand description
Fluent builder for generate_image (spec §8).
Implementations§
Source§impl GenerateImageBuilder
impl GenerateImageBuilder
Sourcepub fn model(self, model: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
The image model id (e.g. "gpt-image-1", "dall-e-3", "imagen-4").
Required.
Sourcepub fn prompt(self, prompt: impl Into<String>) -> Self
pub fn prompt(self, prompt: impl Into<String>) -> Self
Text description of the desired image(s); 1–32000 characters. Required.
Sourcepub fn size(self, size: impl Into<String>) -> Self
pub fn size(self, size: impl Into<String>) -> Self
Dimensions as a "WxH" string (e.g. "1024x1024"); supported values
differ per model.
Sourcepub fn quality(self, quality: impl Into<String>) -> Self
pub fn quality(self, quality: impl Into<String>) -> Self
Provider-specific quality tier (e.g. "standard", "hd").
Sourcepub fn response_format(self, response_format: impl Into<String>) -> Self
pub fn response_format(self, response_format: impl Into<String>) -> Self
Output delivery: "url" (default, signed download link expiring after
~24 h) or "b64_json" (inline base64 bytes).
Sourcepub fn user(self, user: impl Into<String>) -> Self
pub fn user(self, user: impl Into<String>) -> Self
End-user identifier forwarded to the provider.
pub async fn send(self) -> Result<GenerateImageOutput, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for GenerateImageBuilder
impl !UnwindSafe for GenerateImageBuilder
impl Freeze for GenerateImageBuilder
impl Send for GenerateImageBuilder
impl Sync for GenerateImageBuilder
impl Unpin for GenerateImageBuilder
impl UnsafeUnpin for GenerateImageBuilder
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