:doc:`AgentsforBedrockRuntime <../../bedrock-agent-runtime>` / Paginator / Rerank

******
Rerank
******



.. py:class:: AgentsforBedrockRuntime.Paginator.Rerank

  ::

    
    paginator = client.get_paginator('rerank')

  
  

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

    Creates an iterator that will paginate through responses from :py:meth:`AgentsforBedrockRuntime.Client.rerank`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Rerank>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          queries=[
              {
                  'textQuery': {
                      'text': 'string'
                  },
                  'type': 'TEXT'
              },
          ],
          rerankingConfiguration={
              'bedrockRerankingConfiguration': {
                  'modelConfiguration': {
                      'additionalModelRequestFields': {
                          'string': {...}|[...]|123|123.4|'string'|True|None
                      },
                      'modelArn': 'string'
                  },
                  'numberOfResults': 123
              },
              'type': 'BEDROCK_RERANKING_MODEL'
          },
          sources=[
              {
                  'inlineDocumentSource': {
                      'jsonDocument': {...}|[...]|123|123.4|'string'|True|None,
                      'textDocument': {
                          'text': 'string'
                      },
                      'type': 'TEXT'|'JSON'
                  },
                  'type': 'INLINE'
              },
          ],
          PaginationConfig={
              'MaxItems': 123,
              'StartingToken': 'string'
          }
      )
      
    :type queries: list
    :param queries: **[REQUIRED]** 

      An array of objects, each of which contains information about a query to submit to the reranker model.

      

    
      - *(dict) --* 

        Contains information about a query to submit to the reranker model.

        

      
        - **textQuery** *(dict) --* **[REQUIRED]** 

          Contains information about a text query.

          

        
          - **text** *(string) --* 

            The text of the document.

            

          
        
        - **type** *(string) --* **[REQUIRED]** 

          The type of the query.

          

        
      
  
    :type rerankingConfiguration: dict
    :param rerankingConfiguration: **[REQUIRED]** 

      Contains configurations for reranking.

      

    
      - **bedrockRerankingConfiguration** *(dict) --* **[REQUIRED]** 

        Contains configurations for an Amazon Bedrock reranker.

        

      
        - **modelConfiguration** *(dict) --* **[REQUIRED]** 

          Contains configurations for a reranker model.

          

        
          - **additionalModelRequestFields** *(dict) --* 

            A JSON object whose keys are request fields for the model and whose values are values for those fields.

            

          
            - *(string) --* 

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

              
        
      
          - **modelArn** *(string) --* **[REQUIRED]** 

            The ARN of the reranker model.

            

          
        
        - **numberOfResults** *(integer) --* 

          The number of results to return after reranking.

          

        
      
      - **type** *(string) --* **[REQUIRED]** 

        The type of reranker that the configurations apply to.

        

      
    
    :type sources: list
    :param sources: **[REQUIRED]** 

      An array of objects, each of which contains information about the sources to rerank.

      

    
      - *(dict) --* 

        Contains information about a source for reranking.

        

      
        - **inlineDocumentSource** *(dict) --* **[REQUIRED]** 

          Contains an inline definition of a source for reranking.

          

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

            Contains a JSON document to rerank.

            

          
          - **textDocument** *(dict) --* 

            Contains information about a text document to rerank.

            

          
            - **text** *(string) --* 

              The text of the document.

              

            
          
          - **type** *(string) --* **[REQUIRED]** 

            The type of document to rerank.

            

          
        
        - **type** *(string) --* **[REQUIRED]** 

          The type of the source.

          

        
      
  
    :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.

        

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

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

        

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

      
      ::

        {
            'results': [
                {
                    'document': {
                        'jsonDocument': {...}|[...]|123|123.4|'string'|True|None,
                        'textDocument': {
                            'text': 'string'
                        },
                        'type': 'TEXT'|'JSON'
                    },
                    'index': 123,
                    'relevanceScore': ...
                },
            ],
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 
        

        - **results** *(list) --* 

          An array of objects, each of which contains information about the results of reranking.

          
          

          - *(dict) --* 

            Contains information about a document that was reranked.

            
            

            - **document** *(dict) --* 

              Contains information about the document.

              
              

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

                Contains a JSON document to rerank.

                
              

              - **textDocument** *(dict) --* 

                Contains information about a text document to rerank.

                
                

                - **text** *(string) --* 

                  The text of the document.

                  
            
              

              - **type** *(string) --* 

                The type of document to rerank.

                
          
            

            - **index** *(integer) --* 

              The original index of the document from the input sources array.

              
            

            - **relevanceScore** *(float) --* 

              The relevance score of the document.

              
        
      
        

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

          A token to resume pagination.

          
    