Skip to content

put_feedback

put_feedback(
    application_id: ApplicationId,
    conversation_id: ConversationId,
    message_id: SystemMessageId,
    *,
    config_overrides: Optional[QBusinessClientConfig] = None,
    user_id: Optional[UserId] = None,
    message_copied_at: Optional[Timestamp] = None,
    message_usefulness: Optional[MessageUsefulnessFeedback] = None,
) -> None

Enables your end user to provide feedback on their Amazon Q Business generated chat responses.

Parameters:

  • application_id (ApplicationId) –

    The identifier of the application associated with the feedback.

  • user_id (Optional[UserId], default: None ) –

    The identifier of the user giving the feedback.

  • conversation_id (ConversationId) –

    The identifier of the conversation the feedback is attached to.

  • message_id (SystemMessageId) –

    The identifier of the chat message that the feedback was given for.

  • message_copied_at (Optional[Timestamp], default: None ) –

    The timestamp for when the feedback was recorded.

  • message_usefulness (Optional[MessageUsefulnessFeedback], default: None ) –

    The feedback usefulness value given by the user to the chat message.

Raises:

  • AccessDeniedException –

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

  • InternalServerException –

    An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.

  • ResourceNotFoundException –

    The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.

  • ThrottlingException –

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

  • ValidationException –

    The input doesn't meet the constraints set by the Amazon Q Business service. 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_qbusiness/_services/q_business.py
def put_feedback(
    self,
    application_id: "capo_qbusiness.types.application_id.ApplicationId",
    conversation_id: "capo_qbusiness.types.conversation_id.ConversationId",
    message_id: "capo_qbusiness.types.system_message_id.SystemMessageId",
    *,
    config_overrides: Optional[QBusinessClientConfig] = None,
    user_id: Optional["capo_qbusiness.types.user_id.UserId"] = None,
    message_copied_at: Optional["capo_qbusiness.types.timestamp.Timestamp"] = None,
    message_usefulness: Optional[
        "capo_qbusiness.types.message_usefulness_feedback.MessageUsefulnessFeedback"
    ] = None,
) -> None:
    """<p>Enables your end user to provide feedback on their Amazon Q Business generated chat responses.</p>

    Args:
        application_id: <p>The identifier of the application associated with the feedback.</p>
        user_id: <p>The identifier of the user giving the feedback.</p>
        conversation_id: <p>The identifier of the conversation the feedback is attached to.</p>
        message_id: <p>The identifier of the chat message that the feedback was given for.</p>
        message_copied_at: <p>The timestamp for when the feedback was recorded.</p>
        message_usefulness: <p>The feedback usefulness value given by the user to the chat message.</p>

    Raises:
        capo_qbusiness.errors.access_denied_exception.AccessDeniedException: <p> You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.</p>
        capo_qbusiness.errors.internal_server_exception.InternalServerException: <p>An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
        capo_qbusiness.errors.resource_not_found_exception.ResourceNotFoundException: <p>The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.</p>
        capo_qbusiness.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling. Reduce the number of requests and try again.</p>
        capo_qbusiness.errors.validation_exception.ValidationException: <p>The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.</p>
        capo_qbusiness.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_qbusiness.types.put_feedback_request.PutFeedbackRequest]",
    ) -> OperationResponse[None]:
        import capo_qbusiness._operations.expert_q.put_feedback

        output, http_response = (
            capo_qbusiness._operations.expert_q.put_feedback.put_feedback(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutFeedback")
    )
    input_: capo_qbusiness.types.put_feedback_request.PutFeedbackRequest = {
        "application_id": application_id,
        "conversation_id": conversation_id,
        "message_id": message_id,
    }
    if user_id is not None:
        input_["user_id"] = user_id
    if message_copied_at is not None:
        input_["message_copied_at"] = message_copied_at
    if message_usefulness is not None:
        input_["message_usefulness"] = message_usefulness

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output