pub struct ImageGenerateRequestBuilder { /* private fields */ }Expand description
表示图像生成请求构建器。
Implementations§
Source§impl ImageGenerateRequestBuilder
impl ImageGenerateRequestBuilder
pub fn model(self, model: impl Into<String>) -> Self
pub fn prompt(self, prompt: impl Into<String>) -> Self
pub fn n(self, n: u32) -> Self
pub fn size(self, size: impl Into<String>) -> Self
pub fn quality(self, quality: impl Into<String>) -> Self
pub fn response_format(self, response_format: impl Into<String>) -> Self
pub fn background(self, background: impl Into<String>) -> Self
pub fn output_format(self, output_format: impl Into<String>) -> Self
pub fn moderation(self, moderation: impl Into<String>) -> Self
pub fn partial_images(self, partial_images: u32) -> Self
pub fn stream(self, stream: bool) -> Self
pub fn user(self, user: impl Into<String>) -> Self
pub fn metadata(self, metadata: BTreeMap<String, String>) -> Self
pub fn params(self, params: ImageGenerateParams) -> Self
pub fn body_value(self, body: impl Into<JsonPayload>) -> Self
pub fn json_body<U>(self, body: &U) -> Result<Self>where
U: Serialize,
pub fn extra_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn extra_query( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn extra_body( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
pub fn provider_option( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
pub fn cancellation_token(self, token: CancellationToken) -> Self
pub async fn send(self) -> Result<ImageGenerationResponse>
pub async fn send_with_meta( self, ) -> Result<ApiResponse<ImageGenerationResponse>>
pub async fn send_raw(self) -> Result<Response<Bytes>>
pub async fn send_sse(self) -> Result<SseStream<Value>>
pub async fn send_raw_sse(self) -> Result<RawSseStream>
Trait Implementations§
Source§impl Clone for ImageGenerateRequestBuilder
impl Clone for ImageGenerateRequestBuilder
Source§fn clone(&self) -> ImageGenerateRequestBuilder
fn clone(&self) -> ImageGenerateRequestBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ImageGenerateRequestBuilder
impl !RefUnwindSafe for ImageGenerateRequestBuilder
impl Send for ImageGenerateRequestBuilder
impl Sync for ImageGenerateRequestBuilder
impl Unpin for ImageGenerateRequestBuilder
impl UnsafeUnpin for ImageGenerateRequestBuilder
impl !UnwindSafe for ImageGenerateRequestBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more