Skip to content

Commit fe7efee

Browse files
Add support for tiers in Content Filters and Denied Topics for Amazon Bedrock Guardrails.
1 parent 248ad6f commit fe7efee

20 files changed

+960
-4
lines changed

generator/ServiceModels/bedrock/bedrock-2023-04-20.api.json

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,17 +2996,41 @@
29962996
"max":6,
29972997
"min":1
29982998
},
2999+
"GuardrailContentFiltersTier":{
3000+
"type":"structure",
3001+
"required":["tierName"],
3002+
"members":{
3003+
"tierName":{"shape":"GuardrailContentFiltersTierName"}
3004+
}
3005+
},
3006+
"GuardrailContentFiltersTierConfig":{
3007+
"type":"structure",
3008+
"required":["tierName"],
3009+
"members":{
3010+
"tierName":{"shape":"GuardrailContentFiltersTierName"}
3011+
}
3012+
},
3013+
"GuardrailContentFiltersTierName":{
3014+
"type":"string",
3015+
"enum":[
3016+
"CLASSIC",
3017+
"STANDARD"
3018+
],
3019+
"sensitive":true
3020+
},
29993021
"GuardrailContentPolicy":{
30003022
"type":"structure",
30013023
"members":{
3002-
"filters":{"shape":"GuardrailContentFilters"}
3024+
"filters":{"shape":"GuardrailContentFilters"},
3025+
"tier":{"shape":"GuardrailContentFiltersTier"}
30033026
}
30043027
},
30053028
"GuardrailContentPolicyConfig":{
30063029
"type":"structure",
30073030
"required":["filtersConfig"],
30083031
"members":{
3009-
"filtersConfig":{"shape":"GuardrailContentFiltersConfig"}
3032+
"filtersConfig":{"shape":"GuardrailContentFiltersConfig"},
3033+
"tierConfig":{"shape":"GuardrailContentFiltersTierConfig"}
30103034
}
30113035
},
30123036
"GuardrailContextualGroundingAction":{
@@ -3518,14 +3542,16 @@
35183542
"type":"structure",
35193543
"required":["topics"],
35203544
"members":{
3521-
"topics":{"shape":"GuardrailTopics"}
3545+
"topics":{"shape":"GuardrailTopics"},
3546+
"tier":{"shape":"GuardrailTopicsTier"}
35223547
}
35233548
},
35243549
"GuardrailTopicPolicyConfig":{
35253550
"type":"structure",
35263551
"required":["topicsConfig"],
35273552
"members":{
3528-
"topicsConfig":{"shape":"GuardrailTopicsConfig"}
3553+
"topicsConfig":{"shape":"GuardrailTopicsConfig"},
3554+
"tierConfig":{"shape":"GuardrailTopicsTierConfig"}
35293555
}
35303556
},
35313557
"GuardrailTopicType":{
@@ -3544,6 +3570,28 @@
35443570
"max":30,
35453571
"min":1
35463572
},
3573+
"GuardrailTopicsTier":{
3574+
"type":"structure",
3575+
"required":["tierName"],
3576+
"members":{
3577+
"tierName":{"shape":"GuardrailTopicsTierName"}
3578+
}
3579+
},
3580+
"GuardrailTopicsTierConfig":{
3581+
"type":"structure",
3582+
"required":["tierName"],
3583+
"members":{
3584+
"tierName":{"shape":"GuardrailTopicsTierName"}
3585+
}
3586+
},
3587+
"GuardrailTopicsTierName":{
3588+
"type":"string",
3589+
"enum":[
3590+
"CLASSIC",
3591+
"STANDARD"
3592+
],
3593+
"sensitive":true
3594+
},
35473595
"GuardrailVersion":{
35483596
"type":"string",
35493597
"pattern":"(([1-9][0-9]{0,7})|(DRAFT))"

generator/ServiceModels/bedrock/bedrock-2023-04-20.docs.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,25 @@
12911291
"GuardrailContentPolicyConfig$filtersConfig": "<p>Contains the type of the content filter and how strongly it should apply to prompts and model responses.</p>"
12921292
}
12931293
},
1294+
"GuardrailContentFiltersTier": {
1295+
"base": "<p>The tier that your guardrail uses for content filters.</p>",
1296+
"refs": {
1297+
"GuardrailContentPolicy$tier": "<p>The tier that your guardrail uses for content filters.</p>"
1298+
}
1299+
},
1300+
"GuardrailContentFiltersTierConfig": {
1301+
"base": "<p>The tier that your guardrail uses for content filters. Consider using a tier that balances performance, accuracy, and compatibility with your existing generative AI workflows.</p>",
1302+
"refs": {
1303+
"GuardrailContentPolicyConfig$tierConfig": "<p>The tier that your guardrail uses for content filters.</p>"
1304+
}
1305+
},
1306+
"GuardrailContentFiltersTierName": {
1307+
"base": null,
1308+
"refs": {
1309+
"GuardrailContentFiltersTier$tierName": "<p>The tier that your guardrail uses for content filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>",
1310+
"GuardrailContentFiltersTierConfig$tierName": "<p>The tier that your guardrail uses for content filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
1311+
}
1312+
},
12941313
"GuardrailContentPolicy": {
12951314
"base": "<p>Contains details about how to handle harmful content.</p> <p>This data type is used in the following API operations:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax\">GetGuardrail response body</a> </p> </li> </ul>",
12961315
"refs": {
@@ -1751,6 +1770,25 @@
17511770
"GuardrailTopicPolicyConfig$topicsConfig": "<p>A list of policies related to topics that the guardrail should deny.</p>"
17521771
}
17531772
},
1773+
"GuardrailTopicsTier": {
1774+
"base": "<p>The tier that your guardrail uses for denied topic filters.</p>",
1775+
"refs": {
1776+
"GuardrailTopicPolicy$tier": "<p>The tier that your guardrail uses for denied topic filters.</p>"
1777+
}
1778+
},
1779+
"GuardrailTopicsTierConfig": {
1780+
"base": "<p>The tier that your guardrail uses for denied topic filters. Consider using a tier that balances performance, accuracy, and compatibility with your existing generative AI workflows.</p>",
1781+
"refs": {
1782+
"GuardrailTopicPolicyConfig$tierConfig": "<p>The tier that your guardrail uses for denied topic filters.</p>"
1783+
}
1784+
},
1785+
"GuardrailTopicsTierName": {
1786+
"base": null,
1787+
"refs": {
1788+
"GuardrailTopicsTier$tierName": "<p>The tier that your guardrail uses for denied topic filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>",
1789+
"GuardrailTopicsTierConfig$tierName": "<p>The tier that your guardrail uses for denied topic filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
1790+
}
1791+
},
17541792
"GuardrailVersion": {
17551793
"base": null,
17561794
"refs": {

generator/ServiceModels/bedrock/bedrock-2023-04-20.normal.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,12 +4319,46 @@
43194319
"max":6,
43204320
"min":1
43214321
},
4322+
"GuardrailContentFiltersTier":{
4323+
"type":"structure",
4324+
"required":["tierName"],
4325+
"members":{
4326+
"tierName":{
4327+
"shape":"GuardrailContentFiltersTierName",
4328+
"documentation":"<p>The tier that your guardrail uses for content filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
4329+
}
4330+
},
4331+
"documentation":"<p>The tier that your guardrail uses for content filters.</p>"
4332+
},
4333+
"GuardrailContentFiltersTierConfig":{
4334+
"type":"structure",
4335+
"required":["tierName"],
4336+
"members":{
4337+
"tierName":{
4338+
"shape":"GuardrailContentFiltersTierName",
4339+
"documentation":"<p>The tier that your guardrail uses for content filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
4340+
}
4341+
},
4342+
"documentation":"<p>The tier that your guardrail uses for content filters. Consider using a tier that balances performance, accuracy, and compatibility with your existing generative AI workflows.</p>"
4343+
},
4344+
"GuardrailContentFiltersTierName":{
4345+
"type":"string",
4346+
"enum":[
4347+
"CLASSIC",
4348+
"STANDARD"
4349+
],
4350+
"sensitive":true
4351+
},
43224352
"GuardrailContentPolicy":{
43234353
"type":"structure",
43244354
"members":{
43254355
"filters":{
43264356
"shape":"GuardrailContentFilters",
43274357
"documentation":"<p>Contains the type of the content filter and how strongly it should apply to prompts and model responses.</p>"
4358+
},
4359+
"tier":{
4360+
"shape":"GuardrailContentFiltersTier",
4361+
"documentation":"<p>The tier that your guardrail uses for content filters.</p>"
43284362
}
43294363
},
43304364
"documentation":"<p>Contains details about how to handle harmful content.</p> <p>This data type is used in the following API operations:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax\">GetGuardrail response body</a> </p> </li> </ul>"
@@ -4336,6 +4370,10 @@
43364370
"filtersConfig":{
43374371
"shape":"GuardrailContentFiltersConfig",
43384372
"documentation":"<p>Contains the type of the content filter and how strongly it should apply to prompts and model responses.</p>"
4373+
},
4374+
"tierConfig":{
4375+
"shape":"GuardrailContentFiltersTierConfig",
4376+
"documentation":"<p>The tier that your guardrail uses for content filters.</p>"
43394377
}
43404378
},
43414379
"documentation":"<p>Contains details about how to handle harmful content.</p>"
@@ -5109,6 +5147,10 @@
51095147
"topics":{
51105148
"shape":"GuardrailTopics",
51115149
"documentation":"<p>A list of policies related to topics that the guardrail should deny.</p>"
5150+
},
5151+
"tier":{
5152+
"shape":"GuardrailTopicsTier",
5153+
"documentation":"<p>The tier that your guardrail uses for denied topic filters.</p>"
51125154
}
51135155
},
51145156
"documentation":"<p>Contains details about topics that the guardrail should identify and deny.</p> <p>This data type is used in the following API operations:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax\">GetGuardrail response body</a> </p> </li> </ul>"
@@ -5120,6 +5162,10 @@
51205162
"topicsConfig":{
51215163
"shape":"GuardrailTopicsConfig",
51225164
"documentation":"<p>A list of policies related to topics that the guardrail should deny.</p>"
5165+
},
5166+
"tierConfig":{
5167+
"shape":"GuardrailTopicsTierConfig",
5168+
"documentation":"<p>The tier that your guardrail uses for denied topic filters.</p>"
51235169
}
51245170
},
51255171
"documentation":"<p>Contains details about topics that the guardrail should identify and deny.</p>"
@@ -5140,6 +5186,36 @@
51405186
"max":30,
51415187
"min":1
51425188
},
5189+
"GuardrailTopicsTier":{
5190+
"type":"structure",
5191+
"required":["tierName"],
5192+
"members":{
5193+
"tierName":{
5194+
"shape":"GuardrailTopicsTierName",
5195+
"documentation":"<p>The tier that your guardrail uses for denied topic filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
5196+
}
5197+
},
5198+
"documentation":"<p>The tier that your guardrail uses for denied topic filters.</p>"
5199+
},
5200+
"GuardrailTopicsTierConfig":{
5201+
"type":"structure",
5202+
"required":["tierName"],
5203+
"members":{
5204+
"tierName":{
5205+
"shape":"GuardrailTopicsTierName",
5206+
"documentation":"<p>The tier that your guardrail uses for denied topic filters. Valid values include:</p> <ul> <li> <p> <code>CLASSIC</code> tier – Provides established guardrails functionality supporting English, French, and Spanish languages.</p> </li> <li> <p> <code>STANDARD</code> tier – Provides a more robust solution than the <code>CLASSIC</code> tier and has more comprehensive language support. This tier requires that your guardrail use <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html\">cross-Region inference</a>.</p> </li> </ul>"
5207+
}
5208+
},
5209+
"documentation":"<p>The tier that your guardrail uses for denied topic filters. Consider using a tier that balances performance, accuracy, and compatibility with your existing generative AI workflows.</p>"
5210+
},
5211+
"GuardrailTopicsTierName":{
5212+
"type":"string",
5213+
"enum":[
5214+
"CLASSIC",
5215+
"STANDARD"
5216+
],
5217+
"sensitive":true
5218+
},
51435219
"GuardrailVersion":{
51445220
"type":"string",
51455221
"pattern":"(([1-9][0-9]{0,7})|(DRAFT))"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-2023-04-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Bedrock.Model
31+
{
32+
/// <summary>
33+
/// The tier that your guardrail uses for content filters.
34+
/// </summary>
35+
public partial class GuardrailContentFiltersTier
36+
{
37+
private GuardrailContentFiltersTierName _tierName;
38+
39+
/// <summary>
40+
/// Gets and sets the property TierName.
41+
/// <para>
42+
/// The tier that your guardrail uses for content filters. Valid values include:
43+
/// </para>
44+
/// <ul> <li>
45+
/// <para>
46+
/// <c>CLASSIC</c> tier – Provides established guardrails functionality supporting English,
47+
/// French, and Spanish languages.
48+
/// </para>
49+
/// </li> <li>
50+
/// <para>
51+
/// <c>STANDARD</c> tier – Provides a more robust solution than the <c>CLASSIC</c> tier
52+
/// and has more comprehensive language support. This tier requires that your guardrail
53+
/// use <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">cross-Region
54+
/// inference</a>.
55+
/// </para>
56+
/// </li> </ul>
57+
/// </summary>
58+
[AWSProperty(Required=true, Sensitive=true)]
59+
public GuardrailContentFiltersTierName TierName
60+
{
61+
get { return this._tierName; }
62+
set { this._tierName = value; }
63+
}
64+
65+
// Check to see if TierName property is set
66+
internal bool IsSetTierName()
67+
{
68+
return this._tierName != null;
69+
}
70+
71+
}
72+
}

0 commit comments

Comments
 (0)