@@ -122,6 +122,7 @@ def __init__(
122
122
accept_type = None ,
123
123
content_type = None ,
124
124
content_template = None ,
125
+ custom_attributes = None ,
125
126
):
126
127
"""Initializes a configuration of a model and the endpoint to be created for it.
127
128
@@ -141,6 +142,15 @@ def __init__(
141
142
"application/jsonlines". The template should have one and only one placeholder
142
143
$features which will be replaced by a features list for to form the model inference
143
144
input.
145
+ custom_attributes (str): Provides additional information about a request for an
146
+ inference submitted to a model hosted at an Amazon SageMaker endpoint. The
147
+ information is an opaque value that is forwarded verbatim. You could use this
148
+ value, for example, to provide an ID that you can use to track a request or to
149
+ provide other metadata that a service endpoint was programmed to process. The value
150
+ must consist of no more than 1024 visible US-ASCII characters as specified in
151
+ Section 3.3.6. Field Value Components (
152
+ https://tools.ietf.org/html/rfc7230#section-3.2.6) of the Hypertext Transfer
153
+ Protocol (HTTP/1.1).
144
154
"""
145
155
self .predictor_config = {
146
156
"model_name" : model_name ,
@@ -169,6 +179,9 @@ def __init__(
169
179
)
170
180
self .predictor_config ["content_template" ] = content_template
171
181
182
+ if custom_attributes is not None :
183
+ self .predictor_config ["custom_attributes" ] = custom_attributes
184
+
172
185
def get_predictor_config (self ):
173
186
"""Returns part of the predictor dictionary of the analysis config."""
174
187
return copy .deepcopy (self .predictor_config )
0 commit comments