PredictQAResultsCommand

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QuickSightClient, PredictQAResultsCommand } from "@aws-sdk/client-quicksight"; // ES Modules import
// const { QuickSightClient, PredictQAResultsCommand } = require("@aws-sdk/client-quicksight"); // CommonJS import
const client = new QuickSightClient(config);
const input = { // PredictQAResultsRequest
  AwsAccountId: "STRING_VALUE", // required
  QueryText: "STRING_VALUE", // required
  IncludeQuickSightQIndex: "INCLUDE" || "EXCLUDE",
  IncludeGeneratedAnswer: "INCLUDE" || "EXCLUDE",
  MaxTopicsToConsider: Number("int"),
};
const command = new PredictQAResultsCommand(input);
const response = await client.send(command);
// { // PredictQAResultsResponse
//   PrimaryResult: { // QAResult
//     ResultType: "DASHBOARD_VISUAL" || "GENERATED_ANSWER" || "NO_ANSWER",
//     DashboardVisual: { // DashboardVisualResult
//       DashboardId: "STRING_VALUE",
//       DashboardName: "STRING_VALUE",
//       SheetId: "STRING_VALUE",
//       SheetName: "STRING_VALUE",
//       VisualId: "STRING_VALUE",
//       VisualTitle: "STRING_VALUE",
//       VisualSubtitle: "STRING_VALUE",
//       DashboardUrl: "STRING_VALUE",
//     },
//     GeneratedAnswer: { // GeneratedAnswerResult
//       QuestionText: "STRING_VALUE",
//       AnswerStatus: "ANSWER_GENERATED" || "ANSWER_RETRIEVED" || "ANSWER_DOWNGRADE",
//       TopicId: "STRING_VALUE",
//       TopicName: "STRING_VALUE",
//       Restatement: "STRING_VALUE",
//       QuestionId: "STRING_VALUE",
//       AnswerId: "STRING_VALUE",
//       QuestionUrl: "STRING_VALUE",
//     },
//   },
//   AdditionalResults: [ // QAResults
//     {
//       ResultType: "DASHBOARD_VISUAL" || "GENERATED_ANSWER" || "NO_ANSWER",
//       DashboardVisual: {
//         DashboardId: "STRING_VALUE",
//         DashboardName: "STRING_VALUE",
//         SheetId: "STRING_VALUE",
//         SheetName: "STRING_VALUE",
//         VisualId: "STRING_VALUE",
//         VisualTitle: "STRING_VALUE",
//         VisualSubtitle: "STRING_VALUE",
//         DashboardUrl: "STRING_VALUE",
//       },
//       GeneratedAnswer: {
//         QuestionText: "STRING_VALUE",
//         AnswerStatus: "ANSWER_GENERATED" || "ANSWER_RETRIEVED" || "ANSWER_DOWNGRADE",
//         TopicId: "STRING_VALUE",
//         TopicName: "STRING_VALUE",
//         Restatement: "STRING_VALUE",
//         QuestionId: "STRING_VALUE",
//         AnswerId: "STRING_VALUE",
//         QuestionUrl: "STRING_VALUE",
//       },
//     },
//   ],
//   RequestId: "STRING_VALUE",
//   Status: Number("int"),
// };

PredictQAResultsCommand Input

See PredictQAResultsCommandInput for more details

Parameter
Type
Description
AwsAccountId
Required
string | undefined

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

QueryText
Required
string | undefined

The query text to be used to predict QA results.

IncludeGeneratedAnswer
IncludeGeneratedAnswer | undefined

Indicates whether generated answers are included or excluded.

IncludeQuickSightQIndex
IncludeQuickSightQIndex | undefined

Indicates whether Q indicies are included or excluded.

MaxTopicsToConsider
number | undefined

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

PredictQAResultsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AdditionalResults
QAResult[] | undefined

Additional visual responses.

PrimaryResult
QAResult | undefined

The primary visual response.

RequestId
string | undefined

The Amazon Web Services request ID for this operation.

Status
number | undefined

The HTTP status of the request.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon QuickSight service, that your policies have the correct permissions, and that you are using the correct credentials.

InternalFailureException
server

An internal failure occurred.

InvalidParameterValueException
client

One or more parameters has a value that isn't valid.

ThrottlingException
client

Access is throttled.

QuickSightServiceException
Base exception class for all service exceptions from QuickSight service.