Skip to content

Commit

Permalink
Merge pull request #49 from dongri/add-model-to-image
Browse files Browse the repository at this point in the history
Add model to image api
  • Loading branch information
Dongri Jin authored Nov 27, 2023
2 parents 48d33cb + 103c488 commit 9f36e65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/v1/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl ImageGenerationRequest {

impl_builder_methods!(
ImageGenerationRequest,
model: String,
n: i32,
size: String,
response_format: String,
Expand All @@ -57,6 +58,8 @@ pub struct ImageEditRequest {
pub mask: Option<String>,
pub prompt: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub model: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub n: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<String>,
Expand All @@ -72,6 +75,7 @@ impl ImageEditRequest {
image,
prompt,
mask: None,
model: None,
n: None,
size: None,
response_format: None,
Expand All @@ -83,6 +87,7 @@ impl ImageEditRequest {
impl_builder_methods!(
ImageEditRequest,
mask: String,
model: String,
n: i32,
size: String,
response_format: String,
Expand All @@ -101,6 +106,8 @@ pub struct ImageVariationRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub n: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub model: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_format: Option<String>,
Expand All @@ -112,6 +119,7 @@ impl ImageVariationRequest {
pub fn new(image: String) -> Self {
Self {
image,
model: None,
n: None,
size: None,
response_format: None,
Expand All @@ -122,6 +130,7 @@ impl ImageVariationRequest {

impl_builder_methods!(
ImageVariationRequest,
model: String,
n: i32,
size: String,
response_format: String,
Expand Down

0 comments on commit 9f36e65

Please sign in to comment.