Skip to content

Commit 9f36e65

Browse files
author
Dongri Jin
authored
Merge pull request #49 from dongri/add-model-to-image
Add model to image api
2 parents 48d33cb + 103c488 commit 9f36e65

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/v1/image.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ impl ImageGenerationRequest {
3838

3939
impl_builder_methods!(
4040
ImageGenerationRequest,
41+
model: String,
4142
n: i32,
4243
size: String,
4344
response_format: String,
@@ -57,6 +58,8 @@ pub struct ImageEditRequest {
5758
pub mask: Option<String>,
5859
pub prompt: String,
5960
#[serde(skip_serializing_if = "Option::is_none")]
61+
pub model: Option<String>,
62+
#[serde(skip_serializing_if = "Option::is_none")]
6063
pub n: Option<i32>,
6164
#[serde(skip_serializing_if = "Option::is_none")]
6265
pub size: Option<String>,
@@ -72,6 +75,7 @@ impl ImageEditRequest {
7275
image,
7376
prompt,
7477
mask: None,
78+
model: None,
7579
n: None,
7680
size: None,
7781
response_format: None,
@@ -83,6 +87,7 @@ impl ImageEditRequest {
8387
impl_builder_methods!(
8488
ImageEditRequest,
8589
mask: String,
90+
model: String,
8691
n: i32,
8792
size: String,
8893
response_format: String,
@@ -101,6 +106,8 @@ pub struct ImageVariationRequest {
101106
#[serde(skip_serializing_if = "Option::is_none")]
102107
pub n: Option<i32>,
103108
#[serde(skip_serializing_if = "Option::is_none")]
109+
pub model: Option<String>,
110+
#[serde(skip_serializing_if = "Option::is_none")]
104111
pub size: Option<String>,
105112
#[serde(skip_serializing_if = "Option::is_none")]
106113
pub response_format: Option<String>,
@@ -112,6 +119,7 @@ impl ImageVariationRequest {
112119
pub fn new(image: String) -> Self {
113120
Self {
114121
image,
122+
model: None,
115123
n: None,
116124
size: None,
117125
response_format: None,
@@ -122,6 +130,7 @@ impl ImageVariationRequest {
122130

123131
impl_builder_methods!(
124132
ImageVariationRequest,
133+
model: String,
125134
n: i32,
126135
size: String,
127136
response_format: String,

0 commit comments

Comments
 (0)