pub struct Builder { /* private fields */ }
Expand description

A builder for InvokeEndpointInput.

Implementations§

The name of the endpoint that you specified when you created the endpoint using the CreateEndpoint API.

Examples found in repository?
src/client.rs (line 211)
210
211
212
213
        pub fn endpoint_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.endpoint_name(input.into());
            self
        }

The name of the endpoint that you specified when you created the endpoint using the CreateEndpoint API.

Examples found in repository?
src/client.rs (line 219)
215
216
217
218
219
220
221
        pub fn set_endpoint_name(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_endpoint_name(input);
            self
        }

Provides input data, in the format specified in the ContentType request header. Amazon SageMaker passes all of the data in the body to the model.

For information about the format of the request body, see Common Data Formats-Inference.

Examples found in repository?
src/client.rs (line 225)
224
225
226
227
        pub fn body(mut self, input: aws_smithy_types::Blob) -> Self {
            self.inner = self.inner.body(input);
            self
        }

Provides input data, in the format specified in the ContentType request header. Amazon SageMaker passes all of the data in the body to the model.

For information about the format of the request body, see Common Data Formats-Inference.

Examples found in repository?
src/client.rs (line 231)
230
231
232
233
        pub fn set_body(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
            self.inner = self.inner.set_body(input);
            self
        }

The MIME type of the input data in the request body.

Examples found in repository?
src/client.rs (line 236)
235
236
237
238
        pub fn content_type(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.content_type(input.into());
            self
        }

The MIME type of the input data in the request body.

Examples found in repository?
src/client.rs (line 241)
240
241
242
243
        pub fn set_content_type(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_content_type(input);
            self
        }

The desired MIME type of the inference in the response.

Examples found in repository?
src/client.rs (line 246)
245
246
247
248
        pub fn accept(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.accept(input.into());
            self
        }

The desired MIME type of the inference in the response.

Examples found in repository?
src/client.rs (line 251)
250
251
252
253
        pub fn set_accept(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_accept(input);
            self
        }

Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1).

The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function.

This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.

Examples found in repository?
src/client.rs (line 258)
257
258
259
260
        pub fn custom_attributes(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.custom_attributes(input.into());
            self
        }

Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1).

The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function.

This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.

Examples found in repository?
src/client.rs (line 268)
264
265
266
267
268
269
270
        pub fn set_custom_attributes(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_custom_attributes(input);
            self
        }

The model to request for inference when invoking a multi-model endpoint.

Examples found in repository?
src/client.rs (line 273)
272
273
274
275
        pub fn target_model(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.target_model(input.into());
            self
        }

The model to request for inference when invoking a multi-model endpoint.

Examples found in repository?
src/client.rs (line 278)
277
278
279
280
        pub fn set_target_model(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_target_model(input);
            self
        }

Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.

For information about how to use variant targeting to perform a/b testing, see Test models in production

Examples found in repository?
src/client.rs (line 284)
283
284
285
286
        pub fn target_variant(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.target_variant(input.into());
            self
        }

Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.

For information about how to use variant targeting to perform a/b testing, see Test models in production

Examples found in repository?
src/client.rs (line 293)
289
290
291
292
293
294
295
        pub fn set_target_variant(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_target_variant(input);
            self
        }

If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.

Examples found in repository?
src/client.rs (line 298)
297
298
299
300
        pub fn target_container_hostname(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.target_container_hostname(input.into());
            self
        }

If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.

Examples found in repository?
src/client.rs (line 306)
302
303
304
305
306
307
308
        pub fn set_target_container_hostname(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_target_container_hostname(input);
            self
        }

If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see Capture Data.

Examples found in repository?
src/client.rs (line 311)
310
311
312
313
        pub fn inference_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.inference_id(input.into());
            self
        }

If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see Capture Data.

Examples found in repository?
src/client.rs (line 316)
315
316
317
318
        pub fn set_inference_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_inference_id(input);
            self
        }

An optional JMESPath expression used to override the EnableExplanations parameter of the ClarifyExplainerConfig API. See the EnableExplanations section in the developer guide for more information.

Examples found in repository?
src/client.rs (line 321)
320
321
322
323
        pub fn enable_explanations(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.enable_explanations(input.into());
            self
        }

An optional JMESPath expression used to override the EnableExplanations parameter of the ClarifyExplainerConfig API. See the EnableExplanations section in the developer guide for more information.

Examples found in repository?
src/client.rs (line 329)
325
326
327
328
329
330
331
        pub fn set_enable_explanations(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_enable_explanations(input);
            self
        }

Consumes the builder and constructs a InvokeEndpointInput.

Examples found in repository?
src/client.rs (line 178)
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::InvokeEndpoint,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::InvokeEndpointError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// 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](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::InvokeEndpointOutput,
            aws_smithy_http::result::SdkError<crate::error::InvokeEndpointError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more