:doc:`QuickSight <../../quicksight>` / Client / predict_qa_results

******************
predict_qa_results
******************



.. py:method:: QuickSight.Client.predict_qa_results(**kwargs)

  

  Predicts existing visuals or generates new visuals to answer a given query.

   

  This API uses `trusted identity propagation <https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation.html>`__ to ensure that an end user is authenticated and receives the embed URL that is specific to that user. The IAM Identity Center application that the user has logged into needs to have `trusted Identity Propagation enabled for Quick Suite <https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-using-customermanagedapps-specify-trusted-apps.html>`__ with the scope value set to ``quicksight:read``. Before you use this action, make sure that you have configured the relevant Quick Suite resource and permissions.

   

  We recommend enabling the ``QSearchStatus`` API to unlock the full potential of ``PredictQnA``. When ``QSearchStatus`` is enabled, it first checks the specified dashboard for any existing visuals that match the question. If no matching visuals are found, ``PredictQnA`` uses generative Q&A to provide an answer. To update the ``QSearchStatus``, see `UpdateQuickSightQSearchConfiguration <https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateQuickSightQSearchConfiguration.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/PredictQAResults>`_  


  **Request Syntax**
  ::

    response = client.predict_qa_results(
        AwsAccountId='string',
        QueryText='string',
        IncludeQuickSightQIndex='INCLUDE'|'EXCLUDE',
        IncludeGeneratedAnswer='INCLUDE'|'EXCLUDE',
        MaxTopicsToConsider=123
    )
    
  :type AwsAccountId: string
  :param AwsAccountId: **[REQUIRED]** 

    The ID of the Amazon Web Services account that the user wants to execute Predict QA results in.

    

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

    The query text to be used to predict QA results.

    

  
  :type IncludeQuickSightQIndex: string
  :param IncludeQuickSightQIndex: 

    Indicates whether Q indicies are included or excluded.

    

  
  :type IncludeGeneratedAnswer: string
  :param IncludeGeneratedAnswer: 

    Indicates whether generated answers are included or excluded.

    

  
  :type MaxTopicsToConsider: integer
  :param MaxTopicsToConsider: 

    The number of maximum topics to be considered to predict QA results.

    

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

    
    ::

      {
          'PrimaryResult': {
              'ResultType': 'DASHBOARD_VISUAL'|'GENERATED_ANSWER'|'NO_ANSWER',
              'DashboardVisual': {
                  'DashboardId': 'string',
                  'DashboardName': 'string',
                  'SheetId': 'string',
                  'SheetName': 'string',
                  'VisualId': 'string',
                  'VisualTitle': 'string',
                  'VisualSubtitle': 'string',
                  'DashboardUrl': 'string'
              },
              'GeneratedAnswer': {
                  'QuestionText': 'string',
                  'AnswerStatus': 'ANSWER_GENERATED'|'ANSWER_RETRIEVED'|'ANSWER_DOWNGRADE',
                  'TopicId': 'string',
                  'TopicName': 'string',
                  'Restatement': 'string',
                  'QuestionId': 'string',
                  'AnswerId': 'string',
                  'QuestionUrl': 'string'
              }
          },
          'AdditionalResults': [
              {
                  'ResultType': 'DASHBOARD_VISUAL'|'GENERATED_ANSWER'|'NO_ANSWER',
                  'DashboardVisual': {
                      'DashboardId': 'string',
                      'DashboardName': 'string',
                      'SheetId': 'string',
                      'SheetName': 'string',
                      'VisualId': 'string',
                      'VisualTitle': 'string',
                      'VisualSubtitle': 'string',
                      'DashboardUrl': 'string'
                  },
                  'GeneratedAnswer': {
                      'QuestionText': 'string',
                      'AnswerStatus': 'ANSWER_GENERATED'|'ANSWER_RETRIEVED'|'ANSWER_DOWNGRADE',
                      'TopicId': 'string',
                      'TopicName': 'string',
                      'Restatement': 'string',
                      'QuestionId': 'string',
                      'AnswerId': 'string',
                      'QuestionUrl': 'string'
                  }
              },
          ],
          'RequestId': 'string',
          'Status': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PrimaryResult** *(dict) --* 

        The primary visual response.

        
        

        - **ResultType** *(string) --* 

          The type of QA result.

          
        

        - **DashboardVisual** *(dict) --* 

          The representation of a dashboard visual result.

          
          

          - **DashboardId** *(string) --* 

            The ID of the dashboard.

            
          

          - **DashboardName** *(string) --* 

            The name of the dashboard.

            
          

          - **SheetId** *(string) --* 

            The ID of the sheet.

            
          

          - **SheetName** *(string) --* 

            The name of the sheet.

            
          

          - **VisualId** *(string) --* 

            The ID of the visual.

            
          

          - **VisualTitle** *(string) --* 

            The title of the visual.

            
          

          - **VisualSubtitle** *(string) --* 

            The subtitle of the visual.

            
          

          - **DashboardUrl** *(string) --* 

            The URL of the dashboard.

            
      
        

        - **GeneratedAnswer** *(dict) --* 

          The representation of a generated answer result.

          
          

          - **QuestionText** *(string) --* 

            The question text.

            
          

          - **AnswerStatus** *(string) --* 

            The answer status of the generated answer.

            
          

          - **TopicId** *(string) --* 

            The ID of the topic.

            
          

          - **TopicName** *(string) --* 

            The name of the topic.

            
          

          - **Restatement** *(string) --* 

            The restatement for the answer.

            
          

          - **QuestionId** *(string) --* 

            The ID of the question.

            
          

          - **AnswerId** *(string) --* 

            The ID of the answer.

            
          

          - **QuestionUrl** *(string) --* 

            The URL of the question.

            
      
    
      

      - **AdditionalResults** *(list) --* 

        Additional visual responses.

        
        

        - *(dict) --* 

          The QA result that is made from the ``DashboardVisual`` or ``GeneratedAnswer``.

          
          

          - **ResultType** *(string) --* 

            The type of QA result.

            
          

          - **DashboardVisual** *(dict) --* 

            The representation of a dashboard visual result.

            
            

            - **DashboardId** *(string) --* 

              The ID of the dashboard.

              
            

            - **DashboardName** *(string) --* 

              The name of the dashboard.

              
            

            - **SheetId** *(string) --* 

              The ID of the sheet.

              
            

            - **SheetName** *(string) --* 

              The name of the sheet.

              
            

            - **VisualId** *(string) --* 

              The ID of the visual.

              
            

            - **VisualTitle** *(string) --* 

              The title of the visual.

              
            

            - **VisualSubtitle** *(string) --* 

              The subtitle of the visual.

              
            

            - **DashboardUrl** *(string) --* 

              The URL of the dashboard.

              
        
          

          - **GeneratedAnswer** *(dict) --* 

            The representation of a generated answer result.

            
            

            - **QuestionText** *(string) --* 

              The question text.

              
            

            - **AnswerStatus** *(string) --* 

              The answer status of the generated answer.

              
            

            - **TopicId** *(string) --* 

              The ID of the topic.

              
            

            - **TopicName** *(string) --* 

              The name of the topic.

              
            

            - **Restatement** *(string) --* 

              The restatement for the answer.

              
            

            - **QuestionId** *(string) --* 

              The ID of the question.

              
            

            - **AnswerId** *(string) --* 

              The ID of the answer.

              
            

            - **QuestionUrl** *(string) --* 

              The URL of the question.

              
        
      
    
      

      - **RequestId** *(string) --* 

        The Amazon Web Services request ID for this operation.

        
      

      - **Status** *(integer) --* 

        The HTTP status of the request.

        
  
  **Exceptions**
  
  *   :py:class:`QuickSight.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`QuickSight.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`QuickSight.Client.exceptions.ThrottlingException`

  
  *   :py:class:`QuickSight.Client.exceptions.InternalFailureException`

  