pub struct InvokeModelFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to InvokeModel
.
Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.
For more information, see Run inference in the Bedrock User Guide.
For example requests, see Examples (after the Errors section).
Implementations§
source§impl InvokeModelFluentBuilder
impl InvokeModelFluentBuilder
sourcepub fn as_input(&self) -> &InvokeModelInputBuilder
pub fn as_input(&self) -> &InvokeModelInputBuilder
Access the InvokeModel as a reference.
sourcepub async fn send(
self
) -> Result<InvokeModelOutput, SdkError<InvokeModelError, HttpResponse>>
pub async fn send( self ) -> Result<InvokeModelOutput, SdkError<InvokeModelError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<InvokeModelOutput, InvokeModelError, Self>
pub fn customize( self ) -> CustomizableOperation<InvokeModelOutput, InvokeModelError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn body(self, input: Blob) -> Self
pub fn body(self, input: Blob) -> Self
Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to Inference parameters.
sourcepub fn set_body(self, input: Option<Blob>) -> Self
pub fn set_body(self, input: Option<Blob>) -> Self
Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to Inference parameters.
sourcepub fn get_body(&self) -> &Option<Blob>
pub fn get_body(&self) -> &Option<Blob>
Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to Inference parameters.
sourcepub fn content_type(self, input: impl Into<String>) -> Self
pub fn content_type(self, input: impl Into<String>) -> Self
The MIME type of the input data in the request. The default value is application/json
.
sourcepub fn set_content_type(self, input: Option<String>) -> Self
pub fn set_content_type(self, input: Option<String>) -> Self
The MIME type of the input data in the request. The default value is application/json
.
sourcepub fn get_content_type(&self) -> &Option<String>
pub fn get_content_type(&self) -> &Option<String>
The MIME type of the input data in the request. The default value is application/json
.
sourcepub fn accept(self, input: impl Into<String>) -> Self
pub fn accept(self, input: impl Into<String>) -> Self
The desired MIME type of the inference body in the response. The default value is application/json
.
sourcepub fn set_accept(self, input: Option<String>) -> Self
pub fn set_accept(self, input: Option<String>) -> Self
The desired MIME type of the inference body in the response. The default value is application/json
.
sourcepub fn get_accept(&self) -> &Option<String>
pub fn get_accept(&self) -> &Option<String>
The desired MIME type of the inference body in the response. The default value is application/json
.
sourcepub fn set_model_id(self, input: Option<String>) -> Self
pub fn set_model_id(self, input: Option<String>) -> Self
Identifier of the model.
sourcepub fn get_model_id(&self) -> &Option<String>
pub fn get_model_id(&self) -> &Option<String>
Identifier of the model.
Trait Implementations§
source§impl Clone for InvokeModelFluentBuilder
impl Clone for InvokeModelFluentBuilder
source§fn clone(&self) -> InvokeModelFluentBuilder
fn clone(&self) -> InvokeModelFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more