Module Values.InvokeEndpointOutputSource

After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint. For an overview of Amazon SageMaker AI, see How It Works. Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax. Calls to InvokeEndpoint are authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference. A customer's model containers must respond to requests within 60 seconds. The model itself can have a maximum processing time of 60 seconds before responding to invocations. If your model is going to take 50-60 seconds of processing time, the SDK socket timeout should be set to be 70 seconds. Endpoints are scoped to an individual account, and are not public. The URL does not contain the account ID, but Amazon SageMaker AI determines the account ID from the authentication token that is supplied by the caller.

Sourcetype nonrec t = {
  1. body : BodyBlob.t option;
    (*

    Includes the inference provided by the model. For information about the format of the response body, see Common Data Formats-Inference. If the explainer is activated, the body includes the explanations provided by the model. For more information, see the Response section under Invoke the Endpoint in the Developer Guide.

    *)
  2. contentType : Header.t option;
    (*

    The MIME type of the inference returned from the model container.

    *)
  3. invokedProductionVariant : Header.t option;
    (*

    Identifies the production variant that was invoked.

    *)
  4. customAttributes : CustomAttributesHeader.t option;
    (*

    Provides additional information in the response about the inference returned by 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 return an ID received in the CustomAttributes header of a request or other metadata that a service endpoint was programmed to produce. 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). If the customer wants the custom attribute returned, the model must set the custom attribute to be included on the way back. 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 AI Python SDK.

    *)
  5. newSessionId : NewSessionResponseHeader.t option;
    (*

    If you created a stateful session with your request, the ID and expiration time that the model assigns to that session.

    *)
  6. closedSessionId : SessionIdHeader.t option;
    (*

    If you closed a stateful session with your request, the ID of that session.

    *)
}
Sourcetype nonrec error = [
  1. | `InternalDependencyException of InternalDependencyException.t
  2. | `InternalFailure of InternalFailure.t
  3. | `ModelError of ModelError.t
  4. | `ModelNotReadyException of ModelNotReadyException.t
  5. | `ServiceUnavailable of ServiceUnavailable.t
  6. | `ValidationError of ValidationError.t
  7. | `Unknown_operation_error of string * string option
]
Sourceval make : ?body:??? -> ?contentType:??? -> ?invokedProductionVariant:??? -> ?customAttributes:??? -> ?newSessionId:??? -> ?closedSessionId:??? -> unit -> t
Sourceval error_of_json : string -> Yojson.Safe.t -> [> `InternalDependencyException of InternalDependencyException.t | `InternalFailure of InternalFailure.t | `ModelError of ModelError.t | `ModelNotReadyException of ModelNotReadyException.t | `ServiceUnavailable of ServiceUnavailable.t | `Unknown_operation_error of string * string option | `ValidationError of ValidationError.t ]
Sourceval error_of_xml : string -> Awso.Xml.t -> [> `InternalDependencyException of InternalDependencyException.t | `InternalFailure of InternalFailure.t | `ModelError of ModelError.t | `ModelNotReadyException of ModelNotReadyException.t | `ServiceUnavailable of ServiceUnavailable.t | `Unknown_operation_error of string * string option | `ValidationError of ValidationError.t ]
Sourceval error_to_json : error -> Yojson.Safe.t
Sourceval of_header_and_body : ((string, Header.t) Awso.Import.List.Assoc.t * BodyBlob.t) -> t
Sourceval to_value : t -> [> `Structure of (string * [> `Blob of BodyBlob.t | `String of Header.t ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t