Struct async_openai::Images
source · pub struct Images<'c, C: Config> { /* private fields */ }
Expand description
Given a prompt and/or an input image, the model will generate a new image.
Related guide: Image generation
Implementations§
source§impl<'c, C: Config> Images<'c, C>
impl<'c, C: Config> Images<'c, C>
pub fn new(client: &'c Client<C>) -> Self
sourcepub async fn create(
&self,
request: CreateImageRequest
) -> Result<ImagesResponse, OpenAIError>
pub async fn create( &self, request: CreateImageRequest ) -> Result<ImagesResponse, OpenAIError>
Creates an image given a prompt.
sourcepub async fn create_edit(
&self,
request: CreateImageEditRequest
) -> Result<ImagesResponse, OpenAIError>
pub async fn create_edit( &self, request: CreateImageEditRequest ) -> Result<ImagesResponse, OpenAIError>
Creates an edited or extended image given an original image and a prompt.
sourcepub async fn create_variation(
&self,
request: CreateImageVariationRequest
) -> Result<ImagesResponse, OpenAIError>
pub async fn create_variation( &self, request: CreateImageVariationRequest ) -> Result<ImagesResponse, OpenAIError>
Creates a variation of a given image.
Auto Trait Implementations§
impl<'c, C> Freeze for Images<'c, C>
impl<'c, C> !RefUnwindSafe for Images<'c, C>
impl<'c, C> Send for Images<'c, C>where
C: Sync,
impl<'c, C> Sync for Images<'c, C>where
C: Sync,
impl<'c, C> Unpin for Images<'c, C>
impl<'c, C> !UnwindSafe for Images<'c, C>
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