- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateAIGuardrailVersionCommand
Creates an Amazon Q in Connect AI Guardrail version.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QConnectClient, CreateAIGuardrailVersionCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, CreateAIGuardrailVersionCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // CreateAIGuardrailVersionRequest
assistantId: "STRING_VALUE", // required
aiGuardrailId: "STRING_VALUE", // required
modifiedTime: new Date("TIMESTAMP"),
clientToken: "STRING_VALUE",
};
const command = new CreateAIGuardrailVersionCommand(input);
const response = await client.send(command);
// { // CreateAIGuardrailVersionResponse
// aiGuardrail: { // AIGuardrailData
// assistantId: "STRING_VALUE", // required
// assistantArn: "STRING_VALUE", // required
// aiGuardrailArn: "STRING_VALUE", // required
// aiGuardrailId: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// visibilityStatus: "STRING_VALUE", // required
// blockedInputMessaging: "STRING_VALUE", // required
// blockedOutputsMessaging: "STRING_VALUE", // required
// description: "STRING_VALUE",
// topicPolicyConfig: { // AIGuardrailTopicPolicyConfig
// topicsConfig: [ // GuardrailTopicsConfig // required
// { // GuardrailTopicConfig
// name: "STRING_VALUE", // required
// definition: "STRING_VALUE", // required
// examples: [ // GuardrailTopicExamples
// "STRING_VALUE",
// ],
// type: "STRING_VALUE", // required
// },
// ],
// },
// contentPolicyConfig: { // AIGuardrailContentPolicyConfig
// filtersConfig: [ // GuardrailContentFiltersConfig // required
// { // GuardrailContentFilterConfig
// type: "STRING_VALUE", // required
// inputStrength: "STRING_VALUE", // required
// outputStrength: "STRING_VALUE", // required
// },
// ],
// },
// wordPolicyConfig: { // AIGuardrailWordPolicyConfig
// wordsConfig: [ // GuardrailWordsConfig
// { // GuardrailWordConfig
// text: "STRING_VALUE", // required
// },
// ],
// managedWordListsConfig: [ // GuardrailManagedWordListsConfig
// { // GuardrailManagedWordsConfig
// type: "STRING_VALUE", // required
// },
// ],
// },
// sensitiveInformationPolicyConfig: { // AIGuardrailSensitiveInformationPolicyConfig
// piiEntitiesConfig: [ // GuardrailPiiEntitiesConfig
// { // GuardrailPiiEntityConfig
// type: "STRING_VALUE", // required
// action: "STRING_VALUE", // required
// },
// ],
// regexesConfig: [ // GuardrailRegexesConfig
// { // GuardrailRegexConfig
// name: "STRING_VALUE", // required
// description: "STRING_VALUE",
// pattern: "STRING_VALUE", // required
// action: "STRING_VALUE", // required
// },
// ],
// },
// contextualGroundingPolicyConfig: { // AIGuardrailContextualGroundingPolicyConfig
// filtersConfig: [ // GuardrailContextualGroundingFiltersConfig // required
// { // GuardrailContextualGroundingFilterConfig
// type: "STRING_VALUE", // required
// threshold: Number("double"), // required
// },
// ],
// },
// tags: { // Tags
// "<keys>": "STRING_VALUE",
// },
// status: "STRING_VALUE",
// modifiedTime: new Date("TIMESTAMP"),
// },
// versionNumber: Number("long"),
// };
CreateAIGuardrailVersionCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
aiGuardrailId Required | string | undefined | The identifier of the Amazon Q in Connect AI Guardrail. |
assistantId Required | string | undefined | The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN. |
clientToken | string | undefined | A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs .. |
modifiedTime | Date | undefined | The time the AI Guardrail was last modified. |
CreateAIGuardrailVersionCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
aiGuardrail | AIGuardrailData | undefined | The data of the AI Guardrail version. |
versionNumber | number | undefined | The version number of the AI Guardrail version. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | The request could not be processed because of conflict in the current state of the resource. For example, if you're using a |
ResourceNotFoundException | client | The specified resource does not exist. |
ServiceQuotaExceededException | client | You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase. |
ThrottlingException | client | The throttling limit has been exceeded. |
ValidationException | client | The input fails to satisfy the constraints specified by a service. |
QConnectServiceException | Base exception class for all service exceptions from QConnect service. |