Skip to content

Commit

Permalink
feat(images-api): implement images api
Browse files Browse the repository at this point in the history
 - https://platform.openai.com/docs/api-reference/images
add more parameters control for create
  • Loading branch information
hanrw committed Feb 13, 2024
1 parent 3d851c7 commit 691f4f3
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,27 @@ data class ImageCreate(
prompt = prompt,
model = model
)

/**
* Create an instance of [ImageCreate].
* @param prompt A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
* @param model The model to use for image generation. Defaults to dall-e-2
* @param size The size of the generated images. Defaults to 1024x1024
* @param style The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.
* @param quality The quality of the image that will be generated. `Quality.HD` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.
*/
fun create(
prompt: String,
model: Model? = null,
size: Size? = null,
style: Style? = null,
quality: Quality? = null,
): ImageCreate = ImageCreate(
prompt = prompt,
model = model,
size = size,
style = style,
quality = quality
)
}
}

0 comments on commit 691f4f3

Please sign in to comment.