Skip to content

Commit a2ee7d5

Browse files
author
awstools
committed
feat(client-bedrock): This release introduces Automated Reasoning checks for Amazon Bedrock Guardrails. The feature adds new APIs for policy building, refinement, version management, and testing. Guardrail APIs now support Automated Reasoning policy configuration and validation output.
1 parent 99ee72f commit a2ee7d5

File tree

73 files changed

+27277
-10588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+27277
-10588
lines changed

clients/client-bedrock/README.md

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.

clients/client-bedrock/src/Bedrock.ts

Lines changed: 553 additions & 0 deletions
Large diffs are not rendered by default.

clients/client-bedrock/src/BedrockClient.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ import {
5757
BatchDeleteEvaluationJobCommandInput,
5858
BatchDeleteEvaluationJobCommandOutput,
5959
} from "./commands/BatchDeleteEvaluationJobCommand";
60+
import {
61+
CancelAutomatedReasoningPolicyBuildWorkflowCommandInput,
62+
CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput,
63+
} from "./commands/CancelAutomatedReasoningPolicyBuildWorkflowCommand";
64+
import {
65+
CreateAutomatedReasoningPolicyCommandInput,
66+
CreateAutomatedReasoningPolicyCommandOutput,
67+
} from "./commands/CreateAutomatedReasoningPolicyCommand";
68+
import {
69+
CreateAutomatedReasoningPolicyTestCaseCommandInput,
70+
CreateAutomatedReasoningPolicyTestCaseCommandOutput,
71+
} from "./commands/CreateAutomatedReasoningPolicyTestCaseCommand";
72+
import {
73+
CreateAutomatedReasoningPolicyVersionCommandInput,
74+
CreateAutomatedReasoningPolicyVersionCommandOutput,
75+
} from "./commands/CreateAutomatedReasoningPolicyVersionCommand";
6076
import { CreateCustomModelCommandInput, CreateCustomModelCommandOutput } from "./commands/CreateCustomModelCommand";
6177
import {
6278
CreateCustomModelDeploymentCommandInput,
@@ -101,6 +117,18 @@ import {
101117
CreateProvisionedModelThroughputCommandInput,
102118
CreateProvisionedModelThroughputCommandOutput,
103119
} from "./commands/CreateProvisionedModelThroughputCommand";
120+
import {
121+
DeleteAutomatedReasoningPolicyBuildWorkflowCommandInput,
122+
DeleteAutomatedReasoningPolicyBuildWorkflowCommandOutput,
123+
} from "./commands/DeleteAutomatedReasoningPolicyBuildWorkflowCommand";
124+
import {
125+
DeleteAutomatedReasoningPolicyCommandInput,
126+
DeleteAutomatedReasoningPolicyCommandOutput,
127+
} from "./commands/DeleteAutomatedReasoningPolicyCommand";
128+
import {
129+
DeleteAutomatedReasoningPolicyTestCaseCommandInput,
130+
DeleteAutomatedReasoningPolicyTestCaseCommandOutput,
131+
} from "./commands/DeleteAutomatedReasoningPolicyTestCaseCommand";
104132
import { DeleteCustomModelCommandInput, DeleteCustomModelCommandOutput } from "./commands/DeleteCustomModelCommand";
105133
import {
106134
DeleteCustomModelDeploymentCommandInput,
@@ -136,6 +164,38 @@ import {
136164
DeregisterMarketplaceModelEndpointCommandInput,
137165
DeregisterMarketplaceModelEndpointCommandOutput,
138166
} from "./commands/DeregisterMarketplaceModelEndpointCommand";
167+
import {
168+
ExportAutomatedReasoningPolicyVersionCommandInput,
169+
ExportAutomatedReasoningPolicyVersionCommandOutput,
170+
} from "./commands/ExportAutomatedReasoningPolicyVersionCommand";
171+
import {
172+
GetAutomatedReasoningPolicyAnnotationsCommandInput,
173+
GetAutomatedReasoningPolicyAnnotationsCommandOutput,
174+
} from "./commands/GetAutomatedReasoningPolicyAnnotationsCommand";
175+
import {
176+
GetAutomatedReasoningPolicyBuildWorkflowCommandInput,
177+
GetAutomatedReasoningPolicyBuildWorkflowCommandOutput,
178+
} from "./commands/GetAutomatedReasoningPolicyBuildWorkflowCommand";
179+
import {
180+
GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommandInput,
181+
GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommandOutput,
182+
} from "./commands/GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand";
183+
import {
184+
GetAutomatedReasoningPolicyCommandInput,
185+
GetAutomatedReasoningPolicyCommandOutput,
186+
} from "./commands/GetAutomatedReasoningPolicyCommand";
187+
import {
188+
GetAutomatedReasoningPolicyNextScenarioCommandInput,
189+
GetAutomatedReasoningPolicyNextScenarioCommandOutput,
190+
} from "./commands/GetAutomatedReasoningPolicyNextScenarioCommand";
191+
import {
192+
GetAutomatedReasoningPolicyTestCaseCommandInput,
193+
GetAutomatedReasoningPolicyTestCaseCommandOutput,
194+
} from "./commands/GetAutomatedReasoningPolicyTestCaseCommand";
195+
import {
196+
GetAutomatedReasoningPolicyTestResultCommandInput,
197+
GetAutomatedReasoningPolicyTestResultCommandOutput,
198+
} from "./commands/GetAutomatedReasoningPolicyTestResultCommand";
139199
import { GetCustomModelCommandInput, GetCustomModelCommandOutput } from "./commands/GetCustomModelCommand";
140200
import {
141201
GetCustomModelDeploymentCommandInput,
@@ -180,6 +240,22 @@ import {
180240
GetUseCaseForModelAccessCommandInput,
181241
GetUseCaseForModelAccessCommandOutput,
182242
} from "./commands/GetUseCaseForModelAccessCommand";
243+
import {
244+
ListAutomatedReasoningPoliciesCommandInput,
245+
ListAutomatedReasoningPoliciesCommandOutput,
246+
} from "./commands/ListAutomatedReasoningPoliciesCommand";
247+
import {
248+
ListAutomatedReasoningPolicyBuildWorkflowsCommandInput,
249+
ListAutomatedReasoningPolicyBuildWorkflowsCommandOutput,
250+
} from "./commands/ListAutomatedReasoningPolicyBuildWorkflowsCommand";
251+
import {
252+
ListAutomatedReasoningPolicyTestCasesCommandInput,
253+
ListAutomatedReasoningPolicyTestCasesCommandOutput,
254+
} from "./commands/ListAutomatedReasoningPolicyTestCasesCommand";
255+
import {
256+
ListAutomatedReasoningPolicyTestResultsCommandInput,
257+
ListAutomatedReasoningPolicyTestResultsCommandOutput,
258+
} from "./commands/ListAutomatedReasoningPolicyTestResultsCommand";
183259
import {
184260
ListCustomModelDeploymentsCommandInput,
185261
ListCustomModelDeploymentsCommandOutput,
@@ -238,6 +314,14 @@ import {
238314
RegisterMarketplaceModelEndpointCommandInput,
239315
RegisterMarketplaceModelEndpointCommandOutput,
240316
} from "./commands/RegisterMarketplaceModelEndpointCommand";
317+
import {
318+
StartAutomatedReasoningPolicyBuildWorkflowCommandInput,
319+
StartAutomatedReasoningPolicyBuildWorkflowCommandOutput,
320+
} from "./commands/StartAutomatedReasoningPolicyBuildWorkflowCommand";
321+
import {
322+
StartAutomatedReasoningPolicyTestWorkflowCommandInput,
323+
StartAutomatedReasoningPolicyTestWorkflowCommandOutput,
324+
} from "./commands/StartAutomatedReasoningPolicyTestWorkflowCommand";
241325
import { StopEvaluationJobCommandInput, StopEvaluationJobCommandOutput } from "./commands/StopEvaluationJobCommand";
242326
import {
243327
StopModelCustomizationJobCommandInput,
@@ -249,6 +333,18 @@ import {
249333
} from "./commands/StopModelInvocationJobCommand";
250334
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
251335
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
336+
import {
337+
UpdateAutomatedReasoningPolicyAnnotationsCommandInput,
338+
UpdateAutomatedReasoningPolicyAnnotationsCommandOutput,
339+
} from "./commands/UpdateAutomatedReasoningPolicyAnnotationsCommand";
340+
import {
341+
UpdateAutomatedReasoningPolicyCommandInput,
342+
UpdateAutomatedReasoningPolicyCommandOutput,
343+
} from "./commands/UpdateAutomatedReasoningPolicyCommand";
344+
import {
345+
UpdateAutomatedReasoningPolicyTestCaseCommandInput,
346+
UpdateAutomatedReasoningPolicyTestCaseCommandOutput,
347+
} from "./commands/UpdateAutomatedReasoningPolicyTestCaseCommand";
252348
import { UpdateGuardrailCommandInput, UpdateGuardrailCommandOutput } from "./commands/UpdateGuardrailCommand";
253349
import {
254350
UpdateMarketplaceModelEndpointCommandInput,
@@ -274,6 +370,10 @@ export { __Client };
274370
*/
275371
export type ServiceInputTypes =
276372
| BatchDeleteEvaluationJobCommandInput
373+
| CancelAutomatedReasoningPolicyBuildWorkflowCommandInput
374+
| CreateAutomatedReasoningPolicyCommandInput
375+
| CreateAutomatedReasoningPolicyTestCaseCommandInput
376+
| CreateAutomatedReasoningPolicyVersionCommandInput
277377
| CreateCustomModelCommandInput
278378
| CreateCustomModelDeploymentCommandInput
279379
| CreateEvaluationJobCommandInput
@@ -288,6 +388,9 @@ export type ServiceInputTypes =
288388
| CreateModelInvocationJobCommandInput
289389
| CreatePromptRouterCommandInput
290390
| CreateProvisionedModelThroughputCommandInput
391+
| DeleteAutomatedReasoningPolicyBuildWorkflowCommandInput
392+
| DeleteAutomatedReasoningPolicyCommandInput
393+
| DeleteAutomatedReasoningPolicyTestCaseCommandInput
291394
| DeleteCustomModelCommandInput
292395
| DeleteCustomModelDeploymentCommandInput
293396
| DeleteFoundationModelAgreementCommandInput
@@ -299,6 +402,14 @@ export type ServiceInputTypes =
299402
| DeletePromptRouterCommandInput
300403
| DeleteProvisionedModelThroughputCommandInput
301404
| DeregisterMarketplaceModelEndpointCommandInput
405+
| ExportAutomatedReasoningPolicyVersionCommandInput
406+
| GetAutomatedReasoningPolicyAnnotationsCommandInput
407+
| GetAutomatedReasoningPolicyBuildWorkflowCommandInput
408+
| GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommandInput
409+
| GetAutomatedReasoningPolicyCommandInput
410+
| GetAutomatedReasoningPolicyNextScenarioCommandInput
411+
| GetAutomatedReasoningPolicyTestCaseCommandInput
412+
| GetAutomatedReasoningPolicyTestResultCommandInput
302413
| GetCustomModelCommandInput
303414
| GetCustomModelDeploymentCommandInput
304415
| GetEvaluationJobCommandInput
@@ -316,6 +427,10 @@ export type ServiceInputTypes =
316427
| GetPromptRouterCommandInput
317428
| GetProvisionedModelThroughputCommandInput
318429
| GetUseCaseForModelAccessCommandInput
430+
| ListAutomatedReasoningPoliciesCommandInput
431+
| ListAutomatedReasoningPolicyBuildWorkflowsCommandInput
432+
| ListAutomatedReasoningPolicyTestCasesCommandInput
433+
| ListAutomatedReasoningPolicyTestResultsCommandInput
319434
| ListCustomModelDeploymentsCommandInput
320435
| ListCustomModelsCommandInput
321436
| ListEvaluationJobsCommandInput
@@ -335,11 +450,16 @@ export type ServiceInputTypes =
335450
| PutModelInvocationLoggingConfigurationCommandInput
336451
| PutUseCaseForModelAccessCommandInput
337452
| RegisterMarketplaceModelEndpointCommandInput
453+
| StartAutomatedReasoningPolicyBuildWorkflowCommandInput
454+
| StartAutomatedReasoningPolicyTestWorkflowCommandInput
338455
| StopEvaluationJobCommandInput
339456
| StopModelCustomizationJobCommandInput
340457
| StopModelInvocationJobCommandInput
341458
| TagResourceCommandInput
342459
| UntagResourceCommandInput
460+
| UpdateAutomatedReasoningPolicyAnnotationsCommandInput
461+
| UpdateAutomatedReasoningPolicyCommandInput
462+
| UpdateAutomatedReasoningPolicyTestCaseCommandInput
343463
| UpdateGuardrailCommandInput
344464
| UpdateMarketplaceModelEndpointCommandInput
345465
| UpdateProvisionedModelThroughputCommandInput;
@@ -349,6 +469,10 @@ export type ServiceInputTypes =
349469
*/
350470
export type ServiceOutputTypes =
351471
| BatchDeleteEvaluationJobCommandOutput
472+
| CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput
473+
| CreateAutomatedReasoningPolicyCommandOutput
474+
| CreateAutomatedReasoningPolicyTestCaseCommandOutput
475+
| CreateAutomatedReasoningPolicyVersionCommandOutput
352476
| CreateCustomModelCommandOutput
353477
| CreateCustomModelDeploymentCommandOutput
354478
| CreateEvaluationJobCommandOutput
@@ -363,6 +487,9 @@ export type ServiceOutputTypes =
363487
| CreateModelInvocationJobCommandOutput
364488
| CreatePromptRouterCommandOutput
365489
| CreateProvisionedModelThroughputCommandOutput
490+
| DeleteAutomatedReasoningPolicyBuildWorkflowCommandOutput
491+
| DeleteAutomatedReasoningPolicyCommandOutput
492+
| DeleteAutomatedReasoningPolicyTestCaseCommandOutput
366493
| DeleteCustomModelCommandOutput
367494
| DeleteCustomModelDeploymentCommandOutput
368495
| DeleteFoundationModelAgreementCommandOutput
@@ -374,6 +501,14 @@ export type ServiceOutputTypes =
374501
| DeletePromptRouterCommandOutput
375502
| DeleteProvisionedModelThroughputCommandOutput
376503
| DeregisterMarketplaceModelEndpointCommandOutput
504+
| ExportAutomatedReasoningPolicyVersionCommandOutput
505+
| GetAutomatedReasoningPolicyAnnotationsCommandOutput
506+
| GetAutomatedReasoningPolicyBuildWorkflowCommandOutput
507+
| GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommandOutput
508+
| GetAutomatedReasoningPolicyCommandOutput
509+
| GetAutomatedReasoningPolicyNextScenarioCommandOutput
510+
| GetAutomatedReasoningPolicyTestCaseCommandOutput
511+
| GetAutomatedReasoningPolicyTestResultCommandOutput
377512
| GetCustomModelCommandOutput
378513
| GetCustomModelDeploymentCommandOutput
379514
| GetEvaluationJobCommandOutput
@@ -391,6 +526,10 @@ export type ServiceOutputTypes =
391526
| GetPromptRouterCommandOutput
392527
| GetProvisionedModelThroughputCommandOutput
393528
| GetUseCaseForModelAccessCommandOutput
529+
| ListAutomatedReasoningPoliciesCommandOutput
530+
| ListAutomatedReasoningPolicyBuildWorkflowsCommandOutput
531+
| ListAutomatedReasoningPolicyTestCasesCommandOutput
532+
| ListAutomatedReasoningPolicyTestResultsCommandOutput
394533
| ListCustomModelDeploymentsCommandOutput
395534
| ListCustomModelsCommandOutput
396535
| ListEvaluationJobsCommandOutput
@@ -410,11 +549,16 @@ export type ServiceOutputTypes =
410549
| PutModelInvocationLoggingConfigurationCommandOutput
411550
| PutUseCaseForModelAccessCommandOutput
412551
| RegisterMarketplaceModelEndpointCommandOutput
552+
| StartAutomatedReasoningPolicyBuildWorkflowCommandOutput
553+
| StartAutomatedReasoningPolicyTestWorkflowCommandOutput
413554
| StopEvaluationJobCommandOutput
414555
| StopModelCustomizationJobCommandOutput
415556
| StopModelInvocationJobCommandOutput
416557
| TagResourceCommandOutput
417558
| UntagResourceCommandOutput
559+
| UpdateAutomatedReasoningPolicyAnnotationsCommandOutput
560+
| UpdateAutomatedReasoningPolicyCommandOutput
561+
| UpdateAutomatedReasoningPolicyTestCaseCommandOutput
418562
| UpdateGuardrailCommandOutput
419563
| UpdateMarketplaceModelEndpointCommandOutput
420564
| UpdateProvisionedModelThroughputCommandOutput;
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
CancelAutomatedReasoningPolicyBuildWorkflowRequest,
11+
CancelAutomatedReasoningPolicyBuildWorkflowResponse,
12+
} from "../models/models_0";
13+
import {
14+
de_CancelAutomatedReasoningPolicyBuildWorkflowCommand,
15+
se_CancelAutomatedReasoningPolicyBuildWorkflowCommand,
16+
} from "../protocols/Aws_restJson1";
17+
18+
/**
19+
* @public
20+
*/
21+
export type { __MetadataBearer };
22+
export { $Command };
23+
/**
24+
* @public
25+
*
26+
* The input for {@link CancelAutomatedReasoningPolicyBuildWorkflowCommand}.
27+
*/
28+
export interface CancelAutomatedReasoningPolicyBuildWorkflowCommandInput
29+
extends CancelAutomatedReasoningPolicyBuildWorkflowRequest {}
30+
/**
31+
* @public
32+
*
33+
* The output of {@link CancelAutomatedReasoningPolicyBuildWorkflowCommand}.
34+
*/
35+
export interface CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput
36+
extends CancelAutomatedReasoningPolicyBuildWorkflowResponse,
37+
__MetadataBearer {}
38+
39+
/**
40+
* <p>Cancels a running Automated Reasoning policy build workflow. This stops the policy generation process and prevents further processing of the source documents.</p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { BedrockClient, CancelAutomatedReasoningPolicyBuildWorkflowCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
45+
* // const { BedrockClient, CancelAutomatedReasoningPolicyBuildWorkflowCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
46+
* const client = new BedrockClient(config);
47+
* const input = { // CancelAutomatedReasoningPolicyBuildWorkflowRequest
48+
* policyArn: "STRING_VALUE", // required
49+
* buildWorkflowId: "STRING_VALUE", // required
50+
* };
51+
* const command = new CancelAutomatedReasoningPolicyBuildWorkflowCommand(input);
52+
* const response = await client.send(command);
53+
* // {};
54+
*
55+
* ```
56+
*
57+
* @param CancelAutomatedReasoningPolicyBuildWorkflowCommandInput - {@link CancelAutomatedReasoningPolicyBuildWorkflowCommandInput}
58+
* @returns {@link CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput}
59+
* @see {@link CancelAutomatedReasoningPolicyBuildWorkflowCommandInput} for command's `input` shape.
60+
* @see {@link CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput} for command's `response` shape.
61+
* @see {@link BedrockClientResolvedConfig | config} for BedrockClient's `config` shape.
62+
*
63+
* @throws {@link AccessDeniedException} (client fault)
64+
* <p>The request is denied because of missing access permissions.</p>
65+
*
66+
* @throws {@link InternalServerException} (server fault)
67+
* <p>An internal server error occurred. Retry your request.</p>
68+
*
69+
* @throws {@link ResourceNotFoundException} (client fault)
70+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
71+
*
72+
* @throws {@link ThrottlingException} (client fault)
73+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
74+
*
75+
* @throws {@link ValidationException} (client fault)
76+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
77+
*
78+
* @throws {@link BedrockServiceException}
79+
* <p>Base exception class for all service exceptions from Bedrock service.</p>
80+
*
81+
*
82+
* @public
83+
*/
84+
export class CancelAutomatedReasoningPolicyBuildWorkflowCommand extends $Command
85+
.classBuilder<
86+
CancelAutomatedReasoningPolicyBuildWorkflowCommandInput,
87+
CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput,
88+
BedrockClientResolvedConfig,
89+
ServiceInputTypes,
90+
ServiceOutputTypes
91+
>()
92+
.ep(commonParams)
93+
.m(function (this: any, Command: any, cs: any, config: BedrockClientResolvedConfig, o: any) {
94+
return [
95+
getSerdePlugin(config, this.serialize, this.deserialize),
96+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
97+
];
98+
})
99+
.s("AmazonBedrockControlPlaneService", "CancelAutomatedReasoningPolicyBuildWorkflow", {})
100+
.n("BedrockClient", "CancelAutomatedReasoningPolicyBuildWorkflowCommand")
101+
.f(void 0, void 0)
102+
.ser(se_CancelAutomatedReasoningPolicyBuildWorkflowCommand)
103+
.de(de_CancelAutomatedReasoningPolicyBuildWorkflowCommand)
104+
.build() {
105+
/** @internal type navigation helper, not in runtime. */
106+
protected declare static __types: {
107+
api: {
108+
input: CancelAutomatedReasoningPolicyBuildWorkflowRequest;
109+
output: {};
110+
};
111+
sdk: {
112+
input: CancelAutomatedReasoningPolicyBuildWorkflowCommandInput;
113+
output: CancelAutomatedReasoningPolicyBuildWorkflowCommandOutput;
114+
};
115+
};
116+
}

0 commit comments

Comments
 (0)