QuickSight / Client / predict_qa_results

predict_qa_results#

QuickSight.Client.predict_qa_results(**kwargs)#

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

This API uses trusted identity propagation 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 Amazon QuickSight with the scope value set to quicksight:read. Before you use this action, make sure that you have configured the relevant Amazon QuickSight 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.

See also: AWS API Documentation

Request Syntax

response = client.predict_qa_results(
    AwsAccountId='string',
    QueryText='string',
    IncludeQuickSightQIndex='INCLUDE'|'EXCLUDE',
    IncludeGeneratedAnswer='INCLUDE'|'EXCLUDE',
    MaxTopicsToConsider=123
)
Parameters:
  • AwsAccountId (string) –

    [REQUIRED]

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

  • QueryText (string) –

    [REQUIRED]

    The query text to be used to predict QA results.

  • IncludeQuickSightQIndex (string) – Indicates whether Q indicies are included or excluded.

  • IncludeGeneratedAnswer (string) – Indicates whether generated answers are included or excluded.

  • MaxTopicsToConsider (integer) – The number of maximum topics to be considered to predict QA results.

Return type:

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

  • QuickSight.Client.exceptions.AccessDeniedException

  • QuickSight.Client.exceptions.InvalidParameterValueException

  • QuickSight.Client.exceptions.ThrottlingException

  • QuickSight.Client.exceptions.InternalFailureException