Skip to content

Commit a33bd40

Browse files
committed
update for image variation
1 parent 484327b commit a33bd40

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

async-openai/src/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'c, C: Config> Images<'c, C> {
9999
self.client.post_form_stream("/images/edits", request).await
100100
}
101101

102-
/// Creates a variation of a given image.
102+
/// Creates a variation of a given image. This endpoint only supports dall-e-2.
103103
#[crate::byot(
104104
T0 = Clone,
105105
R = serde::de::DeserializeOwned,

async-openai/src/types/images/image.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ pub struct CreateImageEditRequest {
395395
#[builder(derive(Debug))]
396396
#[builder(build_fn(error = "OpenAIError"))]
397397
pub struct CreateImageVariationRequest {
398-
/// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
398+
/// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and
399+
/// square.
399400
pub image: ImageInput,
400401

401402
/// The model to use for image generation. Only `dall-e-2` is supported at this time.
@@ -404,12 +405,14 @@ pub struct CreateImageVariationRequest {
404405
/// The number of images to generate. Must be between 1 and 10.
405406
pub n: Option<u8>, // min:1 max:10 default:1
406407

408+
/// The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs
409+
/// are only valid for 60 minutes after the image has been generated.
410+
pub response_format: Option<ImageResponseFormat>,
411+
407412
/// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
408413
pub size: Option<DallE2ImageSize>,
409414

410-
/// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
411-
pub response_format: Option<ImageResponseFormat>,
412-
413-
/// A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/usage-policies/end-user-ids).
415+
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
416+
/// [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
414417
pub user: Option<String>,
415418
}

0 commit comments

Comments
 (0)