Skip to main content

CreateImageVariationParametersBuilder

Struct CreateImageVariationParametersBuilder 

Source
pub struct CreateImageVariationParametersBuilder { /* private fields */ }
Expand description

Implementations§

Source§

impl CreateImageVariationParametersBuilder

Source

pub fn image<VALUE: Into<FileUpload>>(&mut self, value: VALUE) -> &mut Self

用作变体基础的图像。必须是有效的PNG文件,小于4MB,且为正方形。

Source

pub fn model<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

用于图像生成的模型。目前仅支持dall-e-2。

Source

pub fn n<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self

要生成的图像数量。必须介于1到10之间。对于dall-e-3,仅支持n=1。

Source

pub fn response_format<VALUE: Into<ResponseFormat>>( &mut self, value: VALUE, ) -> &mut Self

返回生成图像的格式。必须是url或b64_json之一。

Source

pub fn size<VALUE: Into<ImageSize>>(&mut self, value: VALUE) -> &mut Self

生成图像的尺寸。对于gpt-image-1必须是1024x1024、1536x1024(横向)、1024x1536(纵向)或auto(默认值), 对于dall-e-2是256x256、512x512或1024x1024之一,对于dall-e-3是1024x1024、1792x1024或1024x1792之一。

Source

pub fn user<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

表示您的最终用户的唯一标识符,可以帮助OpenAI监控和检测滥用行为。

Source

pub fn build( &self, ) -> Result<CreateImageVariationParameters, CreateImageVariationParametersBuilderError>

Builds a new CreateImageVariationParameters.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for CreateImageVariationParametersBuilder

Source§

fn clone(&self) -> CreateImageVariationParametersBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for CreateImageVariationParametersBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.