Skip to content

update_recommender async

update_recommender(
    recommender_arn: Arn,
    recommender_config: RecommenderConfig,
    *,
    config_overrides: Optional[AsyncPersonalizeClientConfig] = None,
) -> UpdateRecommenderResponse

Updates the recommender to modify the recommender configuration. If you update the recommender to modify the columns used in training, Amazon Personalize automatically starts a full retraining of the models backing your recommender. While the update completes, you can still get recommendations from the recommender. The recommender uses the previous configuration until the update completes. To track the status of this update, use the latestRecommenderUpdate returned in the DescribeRecommender operation.

Parameters:

  • recommender_arn (Arn) –

    The Amazon Resource Name (ARN) of the recommender to modify.

  • recommender_config (RecommenderConfig) –

    The configuration details of the recommender.

Raises:

Source code in docs_src/capo_personalize/_services/async_personalize.py
async def update_recommender(
    self,
    recommender_arn: "capo_personalize.types.arn.Arn",
    recommender_config: "capo_personalize.types.recommender_config.RecommenderConfig",
    *,
    config_overrides: Optional[AsyncPersonalizeClientConfig] = None,
) -> "capo_personalize.types.update_recommender_response.UpdateRecommenderResponse":
    """<p>Updates the recommender to modify the recommender configuration. If you update the recommender to modify the columns used in training, Amazon Personalize automatically starts a full retraining of the models backing your recommender. While the update completes, you can still get recommendations from the recommender. The recommender uses the previous configuration until the update completes. To track the status of this update, use the <code>latestRecommenderUpdate</code> returned in the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeRecommender.html">DescribeRecommender</a> operation. </p>

    Args:
        recommender_arn: <p>The Amazon Resource Name (ARN) of the recommender to modify.</p>
        recommender_config: <p>The configuration details of the recommender.</p>

    Raises:
        capo_personalize.errors.invalid_input_exception.InvalidInputException: <p>Provide a valid value for the field or parameter.</p>
        capo_personalize.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_personalize.errors.resource_not_found_exception.ResourceNotFoundException: <p>Could not find the specified resource.</p>
        capo_personalize.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_personalize.types.update_recommender_request.UpdateRecommenderRequest]",
    ) -> AsyncOperationResponse[
        "capo_personalize.types.update_recommender_response.UpdateRecommenderResponse"
    ]:
        import capo_personalize._operations.amazon_personalize.update_recommender

        (
            output,
            http_response,
        ) = await capo_personalize._operations.amazon_personalize.update_recommender.async_update_recommender(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRecommender")
    )
    input_: capo_personalize.types.update_recommender_request.UpdateRecommenderRequest = {
        "recommender_arn": recommender_arn,
        "recommender_config": recommender_config,
    }

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