Skip to content

update_inference_experiment async

update_inference_experiment(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    name: Optional[InferenceExperimentName] = None,
    schedule: Optional[InferenceExperimentSchedule] = None,
    description: Optional[InferenceExperimentDescription] = None,
    model_variants: Optional[ModelVariantConfigList] = None,
    data_storage_config: Optional[InferenceExperimentDataStorageConfig] = None,
    shadow_mode_config: Optional[ShadowModeConfig] = None,
) -> UpdateInferenceExperimentResponse

Updates an inference experiment that you created. The status of the inference experiment has to be either Created, Running. For more information on the status of an inference experiment, see DescribeInferenceExperiment.

Parameters:

  • name (Optional[InferenceExperimentName], default: None ) –

    The name of the inference experiment to be updated.

  • schedule (Optional[InferenceExperimentSchedule], default: None ) –

    The duration for which the inference experiment will run. If the status of the inference experiment is Created, then you can update both the start and end dates. If the status of the inference experiment is Running, then you can update only the end date.

  • description (Optional[InferenceExperimentDescription], default: None ) –

    The description of the inference experiment.

  • model_variants (Optional[ModelVariantConfigList], default: None ) –

    An array of ModelVariantConfig objects. There is one for each variant, whose infrastructure configuration you want to update.

  • data_storage_config (Optional[InferenceExperimentDataStorageConfig], default: None ) –

    The Amazon S3 location and configuration for storing inference request and response data.

  • shadow_mode_config (Optional[ShadowModeConfig], default: None ) –

    The configuration of ShadowMode inference experiment type. Use this field to specify a production variant which takes all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant also specify the percentage of requests that Amazon SageMaker replicates.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def update_inference_experiment(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    name: Optional[
        "capo_sagemaker.types.inference_experiment_name.InferenceExperimentName"
    ] = None,
    schedule: Optional[
        "capo_sagemaker.types.inference_experiment_schedule.InferenceExperimentSchedule"
    ] = None,
    description: Optional[
        "capo_sagemaker.types.inference_experiment_description.InferenceExperimentDescription"
    ] = None,
    model_variants: Optional[
        "capo_sagemaker.types.model_variant_config_list.ModelVariantConfigList"
    ] = None,
    data_storage_config: Optional[
        "capo_sagemaker.types.inference_experiment_data_storage_config.InferenceExperimentDataStorageConfig"
    ] = None,
    shadow_mode_config: Optional[
        "capo_sagemaker.types.shadow_mode_config.ShadowModeConfig"
    ] = None,
) -> "capo_sagemaker.types.update_inference_experiment_response.UpdateInferenceExperimentResponse":
    """<p> Updates an inference experiment that you created. The status of the inference experiment has to be either <code>Created</code>, <code>Running</code>. For more information on the status of an inference experiment, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeInferenceExperiment.html">DescribeInferenceExperiment</a>. </p>

    Args:
        name: <p>The name of the inference experiment to be updated.</p>
        schedule: <p> The duration for which the inference experiment will run. If the status of the inference experiment is <code>Created</code>, then you can update both the start and end dates. If the status of the inference experiment is <code>Running</code>, then you can update only the end date. </p>
        description: <p>The description of the inference experiment.</p>
        model_variants: <p> An array of <code>ModelVariantConfig</code> objects. There is one for each variant, whose infrastructure configuration you want to update. </p>
        data_storage_config: <p>The Amazon S3 location and configuration for storing inference request and response data.</p>
        shadow_mode_config: <p> The configuration of <code>ShadowMode</code> inference experiment type. Use this field to specify a production variant which takes all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant also specify the percentage of requests that Amazon SageMaker replicates. </p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_inference_experiment_request.UpdateInferenceExperimentRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_inference_experiment_response.UpdateInferenceExperimentResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_inference_experiment

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_inference_experiment.async_update_inference_experiment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateInferenceExperiment")
    )
    input_: capo_sagemaker.types.update_inference_experiment_request.UpdateInferenceExperimentRequest = {}
    if name is not None:
        input_["name"] = name
    if schedule is not None:
        input_["schedule"] = schedule
    if description is not None:
        input_["description"] = description
    if model_variants is not None:
        input_["model_variants"] = model_variants
    if data_storage_config is not None:
        input_["data_storage_config"] = data_storage_config
    if shadow_mode_config is not None:
        input_["shadow_mode_config"] = shadow_mode_config

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output