:doc:`QConnect <../../qconnect>` / Paginator / ListMessages

************
ListMessages
************



.. py:class:: QConnect.Paginator.ListMessages

  ::

    
    paginator = client.get_paginator('list_messages')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`QConnect.Client.list_messages`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListMessages>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          assistantId='string',
          sessionId='string',
          filter='ALL'|'TEXT_ONLY',
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type assistantId: string
    :param assistantId: **[REQUIRED]** 

      The identifier of the Amazon Q in Connect assistant.

      

    
    :type sessionId: string
    :param sessionId: **[REQUIRED]** 

      The identifier of the Amazon Q in Connect session.

      

    
    :type filter: string
    :param filter: 

      The filter criteria for listing messages.

      

    
    :type PaginationConfig: dict
    :param PaginationConfig: 

      A dictionary that provides parameters to control pagination.

      

    
      - **MaxItems** *(integer) --* 

        The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination.

        

      
      - **PageSize** *(integer) --* 

        The size of each page.

        

      
      - **StartingToken** *(string) --* 

        A token to specify where to start paginating. This is the ``NextToken`` from a previous response.

        

      
    
    
    :rtype: dict
    :returns: 
      
      **Response Syntax**

      
      ::

        {
            'messages': [
                {
                    'value': {
                        'text': {
                            'value': 'string',
                            'citations': [
                                {
                                    'contentId': 'string',
                                    'title': 'string',
                                    'knowledgeBaseId': 'string',
                                    'citationSpan': {
                                        'beginOffsetInclusive': 123,
                                        'endOffsetExclusive': 123
                                    },
                                    'sourceURL': 'string',
                                    'referenceType': 'WEB_CRAWLER'|'KNOWLEDGE_BASE'|'BEDROCK_KB_S3'|'BEDROCK_KB_WEB'|'BEDROCK_KB_CONFLUENCE'|'BEDROCK_KB_SALESFORCE'|'BEDROCK_KB_SHAREPOINT'|'BEDROCK_KB_KENDRA'|'BEDROCK_KB_CUSTOM_DOCUMENT'|'BEDROCK_KB_SQL'
                                },
                            ],
                            'aiGuardrailAssessment': {
                                'blocked': True|False
                            }
                        },
                        'toolUseResult': {
                            'toolUseId': 'string',
                            'toolName': 'string',
                            'toolResult': {...}|[...]|123|123.4|'string'|True|None,
                            'inputSchema': {...}|[...]|123|123.4|'string'|True|None
                        }
                    },
                    'messageId': 'string',
                    'participant': 'CUSTOMER'|'AGENT'|'BOT',
                    'timestamp': datetime(2015, 1, 1)
                },
            ],
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 
        

        - **messages** *(list) --* 

          The message information.

          
          

          - *(dict) --* 

            The message output.

            
            

            - **value** *(dict) --* 

              The value of a message data.

              .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``text``, ``toolUseResult``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


            
              

              - **text** *(dict) --* 

                The message data in text type.

                
                

                - **value** *(string) --* 

                  The value of the message data in text type.

                  
                

                - **citations** *(list) --* 

                  The citations associated with the text message.

                  
                  

                  - *(dict) --* 

                    A citation that references source content.

                    
                    

                    - **contentId** *(string) --* 

                      The identifier of the content being cited.

                      
                    

                    - **title** *(string) --* 

                      The title of the cited content.

                      
                    

                    - **knowledgeBaseId** *(string) --* 

                      The identifier of the knowledge base containing the cited content.

                      
                    

                    - **citationSpan** *(dict) --* 

                      Contains information about where the text with a citation begins and ends in the generated output.

                      
                      

                      - **beginOffsetInclusive** *(integer) --* 

                        Where the text with a citation starts in the generated output.

                        
                      

                      - **endOffsetExclusive** *(integer) --* 

                        Where the text with a citation ends in the generated output.

                        
                  
                    

                    - **sourceURL** *(string) --* 

                      The source URL for the citation.

                      
                    

                    - **referenceType** *(string) --* 

                      A type to define the KB origin of a cited content

                      
                
              
                

                - **aiGuardrailAssessment** *(dict) --* 

                  The AI Guardrail assessment for the text message.

                  
                  

                  - **blocked** *(boolean) --* 

                    Indicates whether the AI Guardrail blocked the content.

                    
              
            
              

              - **toolUseResult** *(dict) --* 

                The result of tool usage in the message.

                
                

                - **toolUseId** *(string) --* 

                  The identifier of the tool use instance.

                  
                

                - **toolName** *(string) --* 

                  The name of the tool that was used.

                  
                

                - **toolResult** (:ref:`document<document>`) -- 

                  The result of the tool usage.

                  
                

                - **inputSchema** (:ref:`document<document>`) -- 

                  The input schema for the tool use result.

                  
            
          
            

            - **messageId** *(string) --* 

              The identifier of a message.

              
            

            - **participant** *(string) --* 

              The participant of a message.

              
            

            - **timestamp** *(datetime) --* 

              The timestamp of a message.

              
        
      
        

        - **NextToken** *(string) --* 

          A token to resume pagination.

          
    