pub struct ImageGenerationRequest {
pub model: String,
pub prompt: String,
pub n: Option<u8>,
pub response_format: Option<ImageResponseFormat>,
}Expand description
Request to generate images.
Fields§
§model: StringThe model to use for generation (e.g., “grok-2-image”).
prompt: StringThe text prompt describing the image to generate.
n: Option<u8>Number of images to generate (1-10).
response_format: Option<ImageResponseFormat>Response format (URL or base64).
Implementations§
Source§impl ImageGenerationRequest
impl ImageGenerationRequest
Sourcepub fn new(model: impl Into<String>, prompt: impl Into<String>) -> Self
pub fn new(model: impl Into<String>, prompt: impl Into<String>) -> Self
Create a new image generation request.
Sourcepub fn response_format(self, format: ImageResponseFormat) -> Self
pub fn response_format(self, format: ImageResponseFormat) -> Self
Set the response format.
Sourcepub fn url_format(self) -> Self
pub fn url_format(self) -> Self
Request URL format.
Sourcepub fn base64_format(self) -> Self
pub fn base64_format(self) -> Self
Request base64 format.
Trait Implementations§
Source§impl Clone for ImageGenerationRequest
impl Clone for ImageGenerationRequest
Source§fn clone(&self) -> ImageGenerationRequest
fn clone(&self) -> ImageGenerationRequest
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 moreSource§impl Debug for ImageGenerationRequest
impl Debug for ImageGenerationRequest
Auto Trait Implementations§
impl Freeze for ImageGenerationRequest
impl RefUnwindSafe for ImageGenerationRequest
impl Send for ImageGenerationRequest
impl Sync for ImageGenerationRequest
impl Unpin for ImageGenerationRequest
impl UnsafeUnpin for ImageGenerationRequest
impl UnwindSafe for ImageGenerationRequest
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