Skip to content

submit_feedback async

submit_feedback(
    index_id: IndexId,
    query_id: QueryId,
    *,
    config_overrides: Optional[AsynckendraClientConfig] = None,
    click_feedback_items: Optional[ClickFeedbackList] = None,
    relevance_feedback_items: Optional[RelevanceFeedbackList] = None,
) -> None

Enables you to provide feedback to Amazon Kendra to improve the performance of your index.

SubmitFeedback is currently not supported in the Amazon Web Services GovCloud (US-West) region.

Parameters:

  • index_id (IndexId) –

    The identifier of the index that was queried.

  • query_id (QueryId) –

    The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the Query API.

  • click_feedback_items (Optional[ClickFeedbackList], default: None ) –

    Tells Amazon Kendra that a particular search result link was chosen by the user.

  • relevance_feedback_items (Optional[RelevanceFeedbackList], default: None ) –

    Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.

  • InternalServerException –

    An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact Support for help.

  • ResourceNotFoundException –

    The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.

  • ResourceUnavailableException –

    The resource you want to use isn't available. Please check you have provided the correct resource and try again.

  • ThrottlingException –

    The request was denied due to request throttling. Please reduce the number of requests and try again.

  • ValidationException –

    The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_kendra/_services/async_kendra.py
async def submit_feedback(
    self,
    index_id: "capo_kendra.types.index_id.IndexId",
    query_id: "capo_kendra.types.query_id.QueryId",
    *,
    config_overrides: Optional[AsynckendraClientConfig] = None,
    click_feedback_items: Optional[
        "capo_kendra.types.click_feedback_list.ClickFeedbackList"
    ] = None,
    relevance_feedback_items: Optional[
        "capo_kendra.types.relevance_feedback_list.RelevanceFeedbackList"
    ] = None,
) -> None:
    """<p>Enables you to provide feedback to Amazon Kendra to improve the performance of your index.</p> <p> <code>SubmitFeedback</code> is currently not supported in the Amazon Web Services GovCloud (US-West) region.</p>

    Args:
        index_id: <p>The identifier of the index that was queried.</p>
        query_id: <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
        click_feedback_items: <p>Tells Amazon Kendra that a particular search result link was chosen by the user. </p>
        relevance_feedback_items: <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>

    Raises:
        capo_kendra.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.</p>
        capo_kendra.errors.internal_server_exception.InternalServerException: <p>An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
        capo_kendra.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.</p>
        capo_kendra.errors.resource_unavailable_exception.ResourceUnavailableException: <p>The resource you want to use isn't available. Please check you have provided the correct resource and try again.</p>
        capo_kendra.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Please reduce the number of requests and try again.</p>
        capo_kendra.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.</p>
        capo_kendra.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kendra.types.submit_feedback_request.SubmitFeedbackRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_kendra._operations.aws_kendra_frontend_service.submit_feedback

        (
            output,
            http_response,
        ) = await capo_kendra._operations.aws_kendra_frontend_service.submit_feedback.async_submit_feedback(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SubmitFeedback")
    )
    input_: capo_kendra.types.submit_feedback_request.SubmitFeedbackRequest = {
        "index_id": index_id,
        "query_id": query_id,
    }
    if click_feedback_items is not None:
        input_["click_feedback_items"] = click_feedback_items
    if relevance_feedback_items is not None:
        input_["relevance_feedback_items"] = relevance_feedback_items

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