class_docstr: Make prediction requests to an Amazon SageMaker endpoint.
class_docstr_tok: ["Make","prediction","requests","to","an","Amazon","SageMaker","endpoint","."]
docstr: Return the inference from the specified endpoint.
  
  Args:
      data (object): Input data for which you want the model to provide
          inference. If a serializer was specified when creating the
          Predictor, the result of the serializer is sent as input
          data. Otherwise the data must be sequence of bytes, and the
          predict method then sends the bytes in the request body as is.
      initial_args (dict[str,str]): Optional. Default arguments for boto3
          ``invoke_endpoint`` call. Default is None (no default
          arguments).
      target_model (str): S3 model artifact path to run an inference request on,
          in case of a multi model endpoint. Does not apply to endpoints hosting
          single model (Default: None)
      target_variant (str): The name of the production variant to run an inference
          request on (Default: None). Note that the ProductionVariant identifies the
          model you want to host and the resources you want to deploy for hosting it.
      inference_id (str): If you provide a value, it is added to the captured data
          when you enable data capture on the endpoint (Default: None).
      custom_attributes (str): 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.
  
          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 (Default: None).
      component_name (str): Optional. Name of the Amazon SageMaker inference component
          corresponding the predictor.
  
  Returns:
      object: Inference for the given input. If a deserializer was specified when creating
          the Predictor, the result of the deserializer is
          returned. Otherwise the response returns the sequence of bytes
          as is.
docstr_tok: ["Return","the","inference","from","the","specified","endpoint",".","Args",":","data","(","object",")",":","Input","data","for","which","you","want","the","model","to","provide","inference",".","If","a","serializer","was","specified","when","creating","the","Predictor",",","the","result","of","the","serializer","is","sent","as","input","data",".","Otherwise","the","data","must","be","sequence","of","bytes",",","and","the","predict","method","then","sends","the","bytes","in","the","request","body","as","is",".","initial_args","(","dict","[","str",",","str","]",")",":","Optional",".","Default","arguments","for","boto3","``","invoke_endpoint","``","call",".","Default","is","None","(","no","default","arguments",")",".","target_model","(","str",")",":","S3","model","artifact","path","to","run","an","inference","request","on",",","in","case","of","a","multi","model","endpoint",".","Does","not","apply","to","endpoints","hosting","single","model","(","Default",":","None",")","target_variant","(","str",")",":","The","name","of","the","production","variant","to","run","an","inference","request","on","(","Default",":","None",")",".","Note","that","the","ProductionVariant","identifies","the","model","you","want","to","host","and","the","resources","you","want","to","deploy","for","hosting","it",".","inference_id","(","str",")",":","If","you","provide","a","value",",","it","is","added","to","the","captured","data","when","you","enable","data","capture","on","the","endpoint","(","Default",":","None",")",".","custom_attributes","(","str",")",":","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",".","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","(","Default",":","None",")",".","component_name","(","str",")",":","Optional",".","Name","of","the","Amazon","SageMaker","inference","component","corresponding","the","predictor",".","Returns",":","object",":","Inference","for","the","given","input",".","If","a","deserializer","was","specified","when","creating","the","Predictor",",","the","result","of","the","deserializer","is","returned",".","Otherwise","the","response","returns","the","sequence","of","bytes","as","is","."]
code: def predict(
      self,
      data,
      initial_args=None,
      target_model=None,
      target_variant=None,
      inference_id=None,
      custom_attributes=None,
      component_name: Optional[str] = None,
  ):
      """Return the inference from the specified endpoint.
  
      Args:
          data (object): Input data for which you want the model to provide
              inference. If a serializer was specified when creating the
              Predictor, the result of the serializer is sent as input
              data. Otherwise the data must be sequence of bytes, and the
              predict method then sends the bytes in the request body as is.
          initial_args (dict[str,str]): Optional. Default arguments for boto3
              ``invoke_endpoint`` call. Default is None (no default
              arguments).
          target_model (str): S3 model artifact path to run an inference request on,
              in case of a multi model endpoint. Does not apply to endpoints hosting
              single model (Default: None)
          target_variant (str): The name of the production variant to run an inference
              request on (Default: None). Note that the ProductionVariant identifies the
              model you want to host and the resources you want to deploy for hosting it.
          inference_id (str): If you provide a value, it is added to the captured data
              when you enable data capture on the endpoint (Default: None).
          custom_attributes (str): 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.
  
              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 (Default: None).
          component_name (str): Optional. Name of the Amazon SageMaker inference component
              corresponding the predictor.
  
      Returns:
          object: Inference for the given input. If a deserializer was specified when creating
              the Predictor, the result of the deserializer is
              returned. Otherwise the response returns the sequence of bytes
              as is.
      """
      # [TODO]: clean up component_name in _create_request_args
      request_args = self._create_request_args(
          data=data,
          initial_args=initial_args,
          target_model=target_model,
          target_variant=target_variant,
          inference_id=inference_id,
          custom_attributes=custom_attributes,
      )
  
      inference_component_name = (
          component_name or self._get_component_name()
      )
      if inference_component_name:
          request_args[
              "InferenceComponentName"
          ] = inference_component_name
  
      response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(
          **request_args
      )
      return self._handle_response(response)
  
imports: from __future__ import print_function, absolute_import
  import abc
  import datetime
  from typing import Any, Dict, Optional, Tuple, Union
  import logging
  from sagemaker.enums import EndpointType
  from sagemaker.deprecations import deprecated_class, deprecated_deserialize, deprecated_serialize, removed_kwargs, renamed_kwargs, renamed_warning
  from sagemaker.deserializers import BytesDeserializer, CSVDeserializer, JSONDeserializer, NumpyDeserializer, StreamDeserializer, StringDeserializer
  from sagemaker.jumpstart.payload_utils import PayloadSerializer
  from sagemaker.jumpstart.types import JumpStartSerializablePayload
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
  from sagemaker.model_monitor import DataCaptureConfig, DefaultModelMonitor, ModelBiasMonitor, ModelExplainabilityMonitor, ModelMonitor, ModelQualityMonitor
  from sagemaker.serializers import CSVSerializer, IdentitySerializer, JSONSerializer, NumpySerializer
  from sagemaker.session import production_variant, Session
  from sagemaker.utils import name_from_base, stringify_object, format_tags
  from sagemaker.model_monitor.model_monitoring import DEFAULT_REPOSITORY_NAME
  from sagemaker.lineage.context import EndpointContext
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 2 for calling the Predictor obj's underlying member method code with example usage: obj.predict(data, initial_args, target_model, target_variant, inference_id, custom_attributes, component_name) and returns: self