aws_sdk_sagemakerruntime/operation/invoke_endpoint/_invoke_endpoint_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct InvokeEndpointInput {
6 /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
7 pub endpoint_name: ::std::option::Option<::std::string::String>,
8 /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
9 /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
10 pub body: ::std::option::Option<::aws_smithy_types::Blob>,
11 /// <p>The MIME type of the input data in the request body.</p>
12 pub content_type: ::std::option::Option<::std::string::String>,
13 /// <p>The desired MIME type of the inference response from the model container.</p>
14 pub accept: ::std::option::Option<::std::string::String>,
15 /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI 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 <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
16 /// <p>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 <code>Trace ID:</code> in your post-processing function.</p>
17 /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
18 pub custom_attributes: ::std::option::Option<::std::string::String>,
19 /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
20 pub target_model: ::std::option::Option<::std::string::String>,
21 /// <p>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.</p>
22 /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
23 pub target_variant: ::std::option::Option<::std::string::String>,
24 /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
25 pub target_container_hostname: ::std::option::Option<::std::string::String>,
26 /// <p>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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
27 pub inference_id: ::std::option::Option<::std::string::String>,
28 /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
29 pub enable_explanations: ::std::option::Option<::std::string::String>,
30 /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
31 pub inference_component_name: ::std::option::Option<::std::string::String>,
32 /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
33 /// <ul>
34 /// <li>
35 /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
36 /// <li>
37 /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
38 /// </ul>
39 /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
40 pub session_id: ::std::option::Option<::std::string::String>,
41 /// <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The service routes requests with the same prefix and the same identifier to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p>
42 /// <p>Applies only to endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
43 pub prefix_aware_id: ::std::option::Option<::std::string::String>,
44}
45impl InvokeEndpointInput {
46 /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
47 pub fn endpoint_name(&self) -> ::std::option::Option<&str> {
48 self.endpoint_name.as_deref()
49 }
50 /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
51 /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
52 pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
53 self.body.as_ref()
54 }
55 /// <p>The MIME type of the input data in the request body.</p>
56 pub fn content_type(&self) -> ::std::option::Option<&str> {
57 self.content_type.as_deref()
58 }
59 /// <p>The desired MIME type of the inference response from the model container.</p>
60 pub fn accept(&self) -> ::std::option::Option<&str> {
61 self.accept.as_deref()
62 }
63 /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI 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 <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
64 /// <p>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 <code>Trace ID:</code> in your post-processing function.</p>
65 /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
66 pub fn custom_attributes(&self) -> ::std::option::Option<&str> {
67 self.custom_attributes.as_deref()
68 }
69 /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
70 pub fn target_model(&self) -> ::std::option::Option<&str> {
71 self.target_model.as_deref()
72 }
73 /// <p>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.</p>
74 /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
75 pub fn target_variant(&self) -> ::std::option::Option<&str> {
76 self.target_variant.as_deref()
77 }
78 /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
79 pub fn target_container_hostname(&self) -> ::std::option::Option<&str> {
80 self.target_container_hostname.as_deref()
81 }
82 /// <p>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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
83 pub fn inference_id(&self) -> ::std::option::Option<&str> {
84 self.inference_id.as_deref()
85 }
86 /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
87 pub fn enable_explanations(&self) -> ::std::option::Option<&str> {
88 self.enable_explanations.as_deref()
89 }
90 /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
91 pub fn inference_component_name(&self) -> ::std::option::Option<&str> {
92 self.inference_component_name.as_deref()
93 }
94 /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
95 /// <ul>
96 /// <li>
97 /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
98 /// <li>
99 /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
100 /// </ul>
101 /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
102 pub fn session_id(&self) -> ::std::option::Option<&str> {
103 self.session_id.as_deref()
104 }
105 /// <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The service routes requests with the same prefix and the same identifier to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p>
106 /// <p>Applies only to endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
107 pub fn prefix_aware_id(&self) -> ::std::option::Option<&str> {
108 self.prefix_aware_id.as_deref()
109 }
110}
111impl ::std::fmt::Debug for InvokeEndpointInput {
112 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
113 let mut formatter = f.debug_struct("InvokeEndpointInput");
114 formatter.field("endpoint_name", &self.endpoint_name);
115 formatter.field("body", &"*** Sensitive Data Redacted ***");
116 formatter.field("content_type", &self.content_type);
117 formatter.field("accept", &self.accept);
118 formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
119 formatter.field("target_model", &self.target_model);
120 formatter.field("target_variant", &self.target_variant);
121 formatter.field("target_container_hostname", &self.target_container_hostname);
122 formatter.field("inference_id", &self.inference_id);
123 formatter.field("enable_explanations", &self.enable_explanations);
124 formatter.field("inference_component_name", &self.inference_component_name);
125 formatter.field("session_id", &self.session_id);
126 formatter.field("prefix_aware_id", &self.prefix_aware_id);
127 formatter.finish()
128 }
129}
130impl InvokeEndpointInput {
131 /// Creates a new builder-style object to manufacture [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
132 pub fn builder() -> crate::operation::invoke_endpoint::builders::InvokeEndpointInputBuilder {
133 crate::operation::invoke_endpoint::builders::InvokeEndpointInputBuilder::default()
134 }
135}
136
137/// A builder for [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
138#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
139#[non_exhaustive]
140pub struct InvokeEndpointInputBuilder {
141 pub(crate) endpoint_name: ::std::option::Option<::std::string::String>,
142 pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
143 pub(crate) content_type: ::std::option::Option<::std::string::String>,
144 pub(crate) accept: ::std::option::Option<::std::string::String>,
145 pub(crate) custom_attributes: ::std::option::Option<::std::string::String>,
146 pub(crate) target_model: ::std::option::Option<::std::string::String>,
147 pub(crate) target_variant: ::std::option::Option<::std::string::String>,
148 pub(crate) target_container_hostname: ::std::option::Option<::std::string::String>,
149 pub(crate) inference_id: ::std::option::Option<::std::string::String>,
150 pub(crate) enable_explanations: ::std::option::Option<::std::string::String>,
151 pub(crate) inference_component_name: ::std::option::Option<::std::string::String>,
152 pub(crate) session_id: ::std::option::Option<::std::string::String>,
153 pub(crate) prefix_aware_id: ::std::option::Option<::std::string::String>,
154}
155impl InvokeEndpointInputBuilder {
156 /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
157 /// This field is required.
158 pub fn endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.endpoint_name = ::std::option::Option::Some(input.into());
160 self
161 }
162 /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
163 pub fn set_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.endpoint_name = input;
165 self
166 }
167 /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
168 pub fn get_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
169 &self.endpoint_name
170 }
171 /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
172 /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
173 /// This field is required.
174 pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
175 self.body = ::std::option::Option::Some(input);
176 self
177 }
178 /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
179 /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
180 pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
181 self.body = input;
182 self
183 }
184 /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
185 /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
186 pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
187 &self.body
188 }
189 /// <p>The MIME type of the input data in the request body.</p>
190 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.content_type = ::std::option::Option::Some(input.into());
192 self
193 }
194 /// <p>The MIME type of the input data in the request body.</p>
195 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.content_type = input;
197 self
198 }
199 /// <p>The MIME type of the input data in the request body.</p>
200 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
201 &self.content_type
202 }
203 /// <p>The desired MIME type of the inference response from the model container.</p>
204 pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.accept = ::std::option::Option::Some(input.into());
206 self
207 }
208 /// <p>The desired MIME type of the inference response from the model container.</p>
209 pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.accept = input;
211 self
212 }
213 /// <p>The desired MIME type of the inference response from the model container.</p>
214 pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
215 &self.accept
216 }
217 /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI 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 <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
218 /// <p>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 <code>Trace ID:</code> in your post-processing function.</p>
219 /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
220 pub fn custom_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221 self.custom_attributes = ::std::option::Option::Some(input.into());
222 self
223 }
224 /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI 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 <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
225 /// <p>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 <code>Trace ID:</code> in your post-processing function.</p>
226 /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
227 pub fn set_custom_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228 self.custom_attributes = input;
229 self
230 }
231 /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI 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 <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
232 /// <p>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 <code>Trace ID:</code> in your post-processing function.</p>
233 /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
234 pub fn get_custom_attributes(&self) -> &::std::option::Option<::std::string::String> {
235 &self.custom_attributes
236 }
237 /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
238 pub fn target_model(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239 self.target_model = ::std::option::Option::Some(input.into());
240 self
241 }
242 /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
243 pub fn set_target_model(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244 self.target_model = input;
245 self
246 }
247 /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
248 pub fn get_target_model(&self) -> &::std::option::Option<::std::string::String> {
249 &self.target_model
250 }
251 /// <p>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.</p>
252 /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
253 pub fn target_variant(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254 self.target_variant = ::std::option::Option::Some(input.into());
255 self
256 }
257 /// <p>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.</p>
258 /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
259 pub fn set_target_variant(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260 self.target_variant = input;
261 self
262 }
263 /// <p>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.</p>
264 /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
265 pub fn get_target_variant(&self) -> &::std::option::Option<::std::string::String> {
266 &self.target_variant
267 }
268 /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
269 pub fn target_container_hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270 self.target_container_hostname = ::std::option::Option::Some(input.into());
271 self
272 }
273 /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
274 pub fn set_target_container_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275 self.target_container_hostname = input;
276 self
277 }
278 /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
279 pub fn get_target_container_hostname(&self) -> &::std::option::Option<::std::string::String> {
280 &self.target_container_hostname
281 }
282 /// <p>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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
283 pub fn inference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284 self.inference_id = ::std::option::Option::Some(input.into());
285 self
286 }
287 /// <p>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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
288 pub fn set_inference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289 self.inference_id = input;
290 self
291 }
292 /// <p>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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
293 pub fn get_inference_id(&self) -> &::std::option::Option<::std::string::String> {
294 &self.inference_id
295 }
296 /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
297 pub fn enable_explanations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298 self.enable_explanations = ::std::option::Option::Some(input.into());
299 self
300 }
301 /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
302 pub fn set_enable_explanations(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303 self.enable_explanations = input;
304 self
305 }
306 /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
307 pub fn get_enable_explanations(&self) -> &::std::option::Option<::std::string::String> {
308 &self.enable_explanations
309 }
310 /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
311 pub fn inference_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
312 self.inference_component_name = ::std::option::Option::Some(input.into());
313 self
314 }
315 /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
316 pub fn set_inference_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
317 self.inference_component_name = input;
318 self
319 }
320 /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
321 pub fn get_inference_component_name(&self) -> &::std::option::Option<::std::string::String> {
322 &self.inference_component_name
323 }
324 /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
325 /// <ul>
326 /// <li>
327 /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
328 /// <li>
329 /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
330 /// </ul>
331 /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
332 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333 self.session_id = ::std::option::Option::Some(input.into());
334 self
335 }
336 /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
337 /// <ul>
338 /// <li>
339 /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
340 /// <li>
341 /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
342 /// </ul>
343 /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
344 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345 self.session_id = input;
346 self
347 }
348 /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
349 /// <ul>
350 /// <li>
351 /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
352 /// <li>
353 /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
354 /// </ul>
355 /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
356 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
357 &self.session_id
358 }
359 /// <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The service routes requests with the same prefix and the same identifier to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p>
360 /// <p>Applies only to endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
361 pub fn prefix_aware_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
362 self.prefix_aware_id = ::std::option::Option::Some(input.into());
363 self
364 }
365 /// <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The service routes requests with the same prefix and the same identifier to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p>
366 /// <p>Applies only to endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
367 pub fn set_prefix_aware_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
368 self.prefix_aware_id = input;
369 self
370 }
371 /// <p>An optional, stable identifier that serves as a routing hint for prefix-aware routing. The service routes requests with the same prefix and the same identifier to the same instance. If requests from different applications might have the same prompt prefix, set a different identifier for each application to differentiate their routing decisions.</p>
372 /// <p>Applies only to endpoints configured with a <code>RoutingStrategy</code> of <code>PREFIX_AWARE</code>.</p>
373 pub fn get_prefix_aware_id(&self) -> &::std::option::Option<::std::string::String> {
374 &self.prefix_aware_id
375 }
376 /// Consumes the builder and constructs a [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
377 pub fn build(
378 self,
379 ) -> ::std::result::Result<crate::operation::invoke_endpoint::InvokeEndpointInput, ::aws_smithy_types::error::operation::BuildError> {
380 ::std::result::Result::Ok(crate::operation::invoke_endpoint::InvokeEndpointInput {
381 endpoint_name: self.endpoint_name,
382 body: self.body,
383 content_type: self.content_type,
384 accept: self.accept,
385 custom_attributes: self.custom_attributes,
386 target_model: self.target_model,
387 target_variant: self.target_variant,
388 target_container_hostname: self.target_container_hostname,
389 inference_id: self.inference_id,
390 enable_explanations: self.enable_explanations,
391 inference_component_name: self.inference_component_name,
392 session_id: self.session_id,
393 prefix_aware_id: self.prefix_aware_id,
394 })
395 }
396}
397impl ::std::fmt::Debug for InvokeEndpointInputBuilder {
398 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
399 let mut formatter = f.debug_struct("InvokeEndpointInputBuilder");
400 formatter.field("endpoint_name", &self.endpoint_name);
401 formatter.field("body", &"*** Sensitive Data Redacted ***");
402 formatter.field("content_type", &self.content_type);
403 formatter.field("accept", &self.accept);
404 formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
405 formatter.field("target_model", &self.target_model);
406 formatter.field("target_variant", &self.target_variant);
407 formatter.field("target_container_hostname", &self.target_container_hostname);
408 formatter.field("inference_id", &self.inference_id);
409 formatter.field("enable_explanations", &self.enable_explanations);
410 formatter.field("inference_component_name", &self.inference_component_name);
411 formatter.field("session_id", &self.session_id);
412 formatter.field("prefix_aware_id", &self.prefix_aware_id);
413 formatter.finish()
414 }
415}