mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Merge pull request #49 from dongri/add-model-to-image
Add model to image api
This commit is contained in:
@ -38,6 +38,7 @@ impl ImageGenerationRequest {
|
|||||||
|
|
||||||
impl_builder_methods!(
|
impl_builder_methods!(
|
||||||
ImageGenerationRequest,
|
ImageGenerationRequest,
|
||||||
|
model: String,
|
||||||
n: i32,
|
n: i32,
|
||||||
size: String,
|
size: String,
|
||||||
response_format: String,
|
response_format: String,
|
||||||
@ -57,6 +58,8 @@ pub struct ImageEditRequest {
|
|||||||
pub mask: Option<String>,
|
pub mask: Option<String>,
|
||||||
pub prompt: String,
|
pub prompt: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub model: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub n: Option<i32>,
|
pub n: Option<i32>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub size: Option<String>,
|
pub size: Option<String>,
|
||||||
@ -72,6 +75,7 @@ impl ImageEditRequest {
|
|||||||
image,
|
image,
|
||||||
prompt,
|
prompt,
|
||||||
mask: None,
|
mask: None,
|
||||||
|
model: None,
|
||||||
n: None,
|
n: None,
|
||||||
size: None,
|
size: None,
|
||||||
response_format: None,
|
response_format: None,
|
||||||
@ -83,6 +87,7 @@ impl ImageEditRequest {
|
|||||||
impl_builder_methods!(
|
impl_builder_methods!(
|
||||||
ImageEditRequest,
|
ImageEditRequest,
|
||||||
mask: String,
|
mask: String,
|
||||||
|
model: String,
|
||||||
n: i32,
|
n: i32,
|
||||||
size: String,
|
size: String,
|
||||||
response_format: String,
|
response_format: String,
|
||||||
@ -101,6 +106,8 @@ pub struct ImageVariationRequest {
|
|||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub n: Option<i32>,
|
pub n: Option<i32>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub model: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub size: Option<String>,
|
pub size: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub response_format: Option<String>,
|
pub response_format: Option<String>,
|
||||||
@ -112,6 +119,7 @@ impl ImageVariationRequest {
|
|||||||
pub fn new(image: String) -> Self {
|
pub fn new(image: String) -> Self {
|
||||||
Self {
|
Self {
|
||||||
image,
|
image,
|
||||||
|
model: None,
|
||||||
n: None,
|
n: None,
|
||||||
size: None,
|
size: None,
|
||||||
response_format: None,
|
response_format: None,
|
||||||
@ -122,6 +130,7 @@ impl ImageVariationRequest {
|
|||||||
|
|
||||||
impl_builder_methods!(
|
impl_builder_methods!(
|
||||||
ImageVariationRequest,
|
ImageVariationRequest,
|
||||||
|
model: String,
|
||||||
n: i32,
|
n: i32,
|
||||||
size: String,
|
size: String,
|
||||||
response_format: String,
|
response_format: String,
|
||||||
|
Reference in New Issue
Block a user