QConnect / Client / send_message

send_message#

QConnect.Client.send_message(**kwargs)#

Submits a message to the Amazon Q in Connect session.

See also: AWS API Documentation

Request Syntax

response = client.send_message(
    assistantId='string',
    clientToken='string',
    conversationContext={
        'selfServiceConversationHistory': [
            {
                'botResponse': 'string',
                'inputTranscript': 'string',
                'turnNumber': 123
            },
        ]
    },
    message={
        'value': {
            'text': {
                'value': 'string'
            }
        }
    },
    sessionId='string',
    type='TEXT'
)
Parameters:
  • assistantId (string) –

    [REQUIRED]

    The identifier of the Amazon Q in Connect assistant.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.

    This field is autopopulated if not provided.

  • conversationContext (dict) –

    The conversation context before the Amazon Q in Connect session.

    • selfServiceConversationHistory (list) – [REQUIRED]

      The self service conversation history before the Amazon Q in Connect session.

      • (dict) –

        The conversation history data to included in conversation context data before the the Amazon Q in Connect session..

        • botResponse (string) –

          The bot response of the conversation history data.

        • inputTranscript (string) –

          The input transcript of the conversation history data.

        • turnNumber (integer) – [REQUIRED]

          The number of turn of the conversation history data.

  • message (dict) –

    [REQUIRED]

    The message data to submit to the Amazon Q in Connect session.

    • value (dict) – [REQUIRED]

      The message input value.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: text.

      • text (dict) –

        The message data in text type.

        • value (string) –

          The value of the message data in text type.

  • sessionId (string) –

    [REQUIRED]

    The identifier of the Amazon Q in Connect session.

  • type (string) –

    [REQUIRED]

    The message type.

Return type:

dict

Returns:

Response Syntax

{
    'nextMessageToken': 'string',
    'requestMessageId': 'string'
}

Response Structure

  • (dict) –

    • nextMessageToken (string) –

      The token for the next message, used by GetNextMessage.

    • requestMessageId (string) –

      The identifier of the submitted message.

Exceptions