Skip to content

notify_recommendations_received async

notify_recommendations_received(
    assistant_id: UuidOrArn,
    session_id: UuidOrArn,
    recommendation_ids: RecommendationIdList,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
) -> NotifyRecommendationsReceivedResponse

Removes the specified recommendations from the specified assistant's queue of newly available recommendations. You can use this API in conjunction with GetRecommendations and a waitTimeSeconds input for long-polling behavior and avoiding duplicate recommendations.

Parameters:

  • assistant_id (UuidOrArn) –

    The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • session_id (UuidOrArn) –

    The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • recommendation_ids (RecommendationIdList) –

    The identifiers of the recommendations.

Raises:

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def notify_recommendations_received(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    session_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    recommendation_ids: "capo_qconnect.types.recommendation_id_list.RecommendationIdList",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
) -> "capo_qconnect.types.notify_recommendations_received_response.NotifyRecommendationsReceivedResponse":
    """<p>Removes the specified recommendations from the specified assistant's queue of newly available recommendations. You can use this API in conjunction with <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_GetRecommendations.html">GetRecommendations</a> and a <code>waitTimeSeconds</code> input for long-polling behavior and avoiding duplicate recommendations.</p>

    Args:
        assistant_id: <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        session_id: <p>The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        recommendation_ids: <p>The identifiers of the recommendations.</p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_qconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qconnect.types.notify_recommendations_received_request.NotifyRecommendationsReceivedRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.notify_recommendations_received_response.NotifyRecommendationsReceivedResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.notify_recommendations_received

        (
            output,
            http_response,
        ) = await capo_qconnect._operations.wisdom_service.notify_recommendations_received.async_notify_recommendations_received(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("NotifyRecommendationsReceived")
    )
    input_: capo_qconnect.types.notify_recommendations_received_request.NotifyRecommendationsReceivedRequest = {
        "assistant_id": assistant_id,
        "session_id": session_id,
        "recommendation_ids": recommendation_ids,
    }

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