Skip to content

get_next_message

get_next_message(
    assistant_id: UuidOrArn,
    session_id: UuidOrArn,
    next_message_token: NextToken,
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
) -> GetNextMessageResponse

Retrieves next message on an Amazon Q in Connect session.

Parameters:

  • assistant_id (UuidOrArn) –

    The identifier of the Amazon Q in Connect assistant.

  • session_id (UuidOrArn) –

    The identifier of the Amazon Q in Connect session.

  • next_message_token (NextToken) –

    The token for the next message. Use the value returned in the SendMessage or previous response in the next request to retrieve the next message.

Raises:

Source code in docs_src/capo_qconnect/_services/q_connect.py
def get_next_message(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    session_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    next_message_token: "capo_qconnect.types.next_token.NextToken",
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
) -> "capo_qconnect.types.get_next_message_response.GetNextMessageResponse":
    """<p>Retrieves next message on an Amazon Q in Connect session.</p>

    Args:
        assistant_id: <p>The identifier of the Amazon Q in Connect assistant.</p>
        session_id: <p>The identifier of the Amazon Q in Connect session.</p>
        next_message_token: <p>The token for the next message. Use the value returned in the SendMessage or previous response in the next request to retrieve the next message.</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.unprocessable_content_exception.UnprocessableContentException: <p>The server has a failure of processing the message</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.
    """

    def _handler(
        req: "OperationRequest[capo_qconnect.types.get_next_message_request.GetNextMessageRequest]",
    ) -> OperationResponse[
        "capo_qconnect.types.get_next_message_response.GetNextMessageResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.get_next_message

        output, http_response = (
            capo_qconnect._operations.wisdom_service.get_next_message.get_next_message(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_qconnect.types.get_next_message_response.GetNextMessageResponse",
    ) -> dict[str, Any]:
        import capo_qconnect.types.get_next_message_response

        return capo_qconnect.types.get_next_message_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetNextMessage", redact_output=_redact_output),
    )
    input_: capo_qconnect.types.get_next_message_request.GetNextMessageRequest = {
        "assistant_id": assistant_id,
        "session_id": session_id,
        "next_message_token": next_message_token,
    }

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