@@ -3663,6 +3663,7 @@ def create_endpoint_config(
36633663 volume_size = None ,
36643664 model_data_download_timeout = None ,
36653665 container_startup_health_check_timeout = None ,
3666+ explainer_config_dict = None ,
36663667 ):
36673668 """Create an Amazon SageMaker endpoint configuration.
36683669
@@ -3696,6 +3697,8 @@ def create_endpoint_config(
36963697 inference container to pass health check by SageMaker Hosting. For more information
36973698 about health check see:
36983699 https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests
3700+ explainer_config_dict (dict): Specifies configuration to enable explainers.
3701+ Default: None.
36993702
37003703 Example:
37013704 >>> tags = [{'Key': 'tagname', 'Value': 'tagvalue'}]
@@ -3751,6 +3754,9 @@ def create_endpoint_config(
37513754 )
37523755 request ["DataCaptureConfig" ] = inferred_data_capture_config_dict
37533756
3757+ if explainer_config_dict is not None :
3758+ request ["ExplainerConfig" ] = explainer_config_dict
3759+
37543760 self .sagemaker_client .create_endpoint_config (** request )
37553761 return name
37563762
@@ -3762,6 +3768,7 @@ def create_endpoint_config_from_existing(
37623768 new_kms_key = None ,
37633769 new_data_capture_config_dict = None ,
37643770 new_production_variants = None ,
3771+ new_explainer_config_dict = None ,
37653772 ):
37663773 """Create an Amazon SageMaker endpoint configuration from an existing one.
37673774
@@ -3789,6 +3796,9 @@ def create_endpoint_config_from_existing(
37893796 new_production_variants (list[dict]): The configuration for which model(s) to host and
37903797 the resources to deploy for hosting the model(s). If not specified,
37913798 the ``ProductionVariants`` of the existing endpoint configuration is used.
3799+ new_explainer_config_dict (dict): Specifies configuration to enable explainers.
3800+ (default: None). If not specified, the explainer configuration of the existing
3801+ endpoint configuration is used.
37923802
37933803 Returns:
37943804 str: Name of the endpoint point configuration created.
@@ -3856,6 +3866,13 @@ def create_endpoint_config_from_existing(
38563866 )
38573867 request ["AsyncInferenceConfig" ] = inferred_async_inference_config_dict
38583868
3869+ request_explainer_config_dict = (
3870+ new_explainer_config_dict or existing_endpoint_config_desc .get ("ExplainerConfig" , None )
3871+ )
3872+
3873+ if request_explainer_config_dict is not None :
3874+ request ["ExplainerConfig" ] = request_explainer_config_dict
3875+
38593876 self .sagemaker_client .create_endpoint_config (** request )
38603877
38613878 def create_endpoint (self , endpoint_name , config_name , tags = None , wait = True ):
@@ -4372,6 +4389,7 @@ def endpoint_from_production_variants(
43724389 wait = True ,
43734390 data_capture_config_dict = None ,
43744391 async_inference_config_dict = None ,
4392+ explainer_config_dict = None ,
43754393 ):
43764394 """Create an SageMaker ``Endpoint`` from a list of production variants.
43774395
@@ -4389,6 +4407,9 @@ def endpoint_from_production_variants(
43894407 async_inference_config_dict (dict) : specifies configuration related to async endpoint.
43904408 Use this configuration when trying to create async endpoint and make async inference
43914409 (default: None)
4410+ explainer_config_dict (dict) : Specifies configuration related to explainer.
4411+ Use this configuration when trying to use online explainability.
4412+ (default: None)
43924413 Returns:
43934414 str: The name of the created ``Endpoint``.
43944415 """
@@ -4422,6 +4443,8 @@ def endpoint_from_production_variants(
44224443 sagemaker_session = self ,
44234444 )
44244445 config_options ["AsyncInferenceConfig" ] = inferred_async_inference_config_dict
4446+ if explainer_config_dict is not None :
4447+ config_options ["ExplainerConfig" ] = explainer_config_dict
44254448
44264449 LOGGER .info ("Creating endpoint-config with name %s" , name )
44274450 self .sagemaker_client .create_endpoint_config (** config_options )
0 commit comments