Skip to content

Commit bf60228

Browse files
author
awstools
committed
feat(client-bedrock-agent): Add support for user metadata inside PromptVariant.
1 parent abd27ba commit bf60228

File tree

7 files changed

+86
-2
lines changed

7 files changed

+86
-2
lines changed

clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
5959
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html">Advanced prompts</a>.</p>
6060
* </li>
6161
* <li>
62-
* <p>If you agent fails to be created, the response returns a list of <code>failureReasons</code> alongside a list of <code>recommendedActions</code> for you to troubleshoot.</p>
62+
* <p>If your agent fails to be created, the response returns a list of <code>failureReasons</code> alongside a list of <code>recommendedActions</code> for you to troubleshoot.</p>
63+
* </li>
64+
* <li>
65+
* <p>The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.</p>
6366
* </li>
6467
* </ul>
6568
* @example

clients/client-bedrock-agent/src/commands/CreatePromptCommand.ts

+12
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export interface CreatePromptCommandOutput extends CreatePromptResponse, __Metad
7171
* ],
7272
* },
7373
* },
74+
* metadata: [ // PromptMetadataList
75+
* { // PromptMetadataEntry
76+
* key: "STRING_VALUE", // required
77+
* value: "STRING_VALUE", // required
78+
* },
79+
* ],
7480
* },
7581
* ],
7682
* clientToken: "STRING_VALUE",
@@ -111,6 +117,12 @@ export interface CreatePromptCommandOutput extends CreatePromptResponse, __Metad
111117
* // ],
112118
* // },
113119
* // },
120+
* // metadata: [ // PromptMetadataList
121+
* // { // PromptMetadataEntry
122+
* // key: "STRING_VALUE", // required
123+
* // value: "STRING_VALUE", // required
124+
* // },
125+
* // ],
114126
* // },
115127
* // ],
116128
* // id: "STRING_VALUE", // required

clients/client-bedrock-agent/src/commands/CreatePromptVersionCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ export interface CreatePromptVersionCommandOutput extends CreatePromptVersionRes
8080
* // ],
8181
* // },
8282
* // },
83+
* // metadata: [ // PromptMetadataList
84+
* // { // PromptMetadataEntry
85+
* // key: "STRING_VALUE", // required
86+
* // value: "STRING_VALUE", // required
87+
* // },
88+
* // ],
8389
* // },
8490
* // ],
8591
* // id: "STRING_VALUE", // required

clients/client-bedrock-agent/src/commands/GetPromptCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ export interface GetPromptCommandOutput extends GetPromptResponse, __MetadataBea
7272
* // ],
7373
* // },
7474
* // },
75+
* // metadata: [ // PromptMetadataList
76+
* // { // PromptMetadataEntry
77+
* // key: "STRING_VALUE", // required
78+
* // value: "STRING_VALUE", // required
79+
* // },
80+
* // ],
7581
* // },
7682
* // ],
7783
* // id: "STRING_VALUE", // required

clients/client-bedrock-agent/src/commands/UpdatePromptCommand.ts

+12
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export interface UpdatePromptCommandOutput extends UpdatePromptResponse, __Metad
7171
* ],
7272
* },
7373
* },
74+
* metadata: [ // PromptMetadataList
75+
* { // PromptMetadataEntry
76+
* key: "STRING_VALUE", // required
77+
* value: "STRING_VALUE", // required
78+
* },
79+
* ],
7480
* },
7581
* ],
7682
* promptIdentifier: "STRING_VALUE", // required
@@ -108,6 +114,12 @@ export interface UpdatePromptCommandOutput extends UpdatePromptResponse, __Metad
108114
* // ],
109115
* // },
110116
* // },
117+
* // metadata: [ // PromptMetadataList
118+
* // { // PromptMetadataEntry
119+
* // key: "STRING_VALUE", // required
120+
* // value: "STRING_VALUE", // required
121+
* // },
122+
* // ],
111123
* // },
112124
* // ],
113125
* // id: "STRING_VALUE", // required

clients/client-bedrock-agent/src/models/models_0.ts

+35-1
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ export type ParsingStrategy = (typeof ParsingStrategy)[keyof typeof ParsingStrat
32803280
* </p>
32813281
* </li>
32823282
* </ul>
3283-
* <p>You can get the ARN of a model with the action. Standard model usage
3283+
* <p>You can get the ARN of a model with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html">ListFoundationModels</a> action. Standard model usage
32843284
* charges apply for the foundation model parsing strategy.</p>
32853285
* @public
32863286
*/
@@ -7437,6 +7437,24 @@ export interface UpdateKnowledgeBaseResponse {
74377437
knowledgeBase: KnowledgeBase | undefined;
74387438
}
74397439

7440+
/**
7441+
* <p>Contains a key-value pair that defines a metadata tag and value to attach to a prompt variant. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html">Create a prompt using Prompt management</a>.</p>
7442+
* @public
7443+
*/
7444+
export interface PromptMetadataEntry {
7445+
/**
7446+
* <p>The key of a metadata tag for a prompt variant.</p>
7447+
* @public
7448+
*/
7449+
key: string | undefined;
7450+
7451+
/**
7452+
* <p>The value of a metadata tag for a prompt variant.</p>
7453+
* @public
7454+
*/
7455+
value: string | undefined;
7456+
}
7457+
74407458
/**
74417459
* <p>Contains details about a variant of the prompt.</p>
74427460
* @public
@@ -7471,6 +7489,12 @@ export interface PromptVariant {
74717489
* @public
74727490
*/
74737491
inferenceConfiguration?: PromptInferenceConfiguration;
7492+
7493+
/**
7494+
* <p>An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html">Create a prompt using Prompt management</a>.</p>
7495+
* @public
7496+
*/
7497+
metadata?: PromptMetadataEntry[];
74747498
}
74757499

74767500
/**
@@ -8672,6 +8696,15 @@ export const UpdateFlowResponseFilterSensitiveLog = (obj: UpdateFlowResponse): a
86728696
...(obj.definition && { definition: FlowDefinitionFilterSensitiveLog(obj.definition) }),
86738697
});
86748698

8699+
/**
8700+
* @internal
8701+
*/
8702+
export const PromptMetadataEntryFilterSensitiveLog = (obj: PromptMetadataEntry): any => ({
8703+
...obj,
8704+
...(obj.key && { key: SENSITIVE_STRING }),
8705+
...(obj.value && { value: SENSITIVE_STRING }),
8706+
});
8707+
86758708
/**
86768709
* @internal
86778710
*/
@@ -8681,6 +8714,7 @@ export const PromptVariantFilterSensitiveLog = (obj: PromptVariant): any => ({
86818714
templateConfiguration: PromptTemplateConfigurationFilterSensitiveLog(obj.templateConfiguration),
86828715
}),
86838716
...(obj.inferenceConfiguration && { inferenceConfiguration: obj.inferenceConfiguration }),
8717+
...(obj.metadata && { metadata: SENSITIVE_STRING }),
86848718
});
86858719

86868720
/**

clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts

+11
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ import {
226226
PromptFlowNodeSourceConfiguration,
227227
PromptInferenceConfiguration,
228228
PromptInputVariable,
229+
PromptMetadataEntry,
229230
PromptModelInferenceConfiguration,
230231
PromptOverrideConfiguration,
231232
PromptSummary,
@@ -3480,6 +3481,10 @@ const se_PromptInferenceConfiguration = (input: PromptInferenceConfiguration, co
34803481

34813482
// se_PromptInputVariablesList omitted.
34823483

3484+
// se_PromptMetadataEntry omitted.
3485+
3486+
// se_PromptMetadataList omitted.
3487+
34833488
/**
34843489
* serializeAws_restJson1PromptModelInferenceConfiguration
34853490
*/
@@ -3514,6 +3519,7 @@ const se_PromptOverrideConfiguration = (input: PromptOverrideConfiguration, cont
35143519
const se_PromptVariant = (input: PromptVariant, context: __SerdeContext): any => {
35153520
return take(input, {
35163521
inferenceConfiguration: (_) => se_PromptInferenceConfiguration(_, context),
3522+
metadata: _json,
35173523
modelId: [],
35183524
name: [],
35193525
templateConfiguration: _json,
@@ -4426,6 +4432,10 @@ const de_PromptInferenceConfiguration = (output: any, context: __SerdeContext):
44264432

44274433
// de_PromptInputVariablesList omitted.
44284434

4435+
// de_PromptMetadataEntry omitted.
4436+
4437+
// de_PromptMetadataList omitted.
4438+
44294439
/**
44304440
* deserializeAws_restJson1PromptModelInferenceConfiguration
44314441
*/
@@ -4487,6 +4497,7 @@ const de_PromptSummary = (output: any, context: __SerdeContext): PromptSummary =
44874497
const de_PromptVariant = (output: any, context: __SerdeContext): PromptVariant => {
44884498
return take(output, {
44894499
inferenceConfiguration: (_: any) => de_PromptInferenceConfiguration(__expectUnion(_), context),
4500+
metadata: _json,
44904501
modelId: __expectString,
44914502
name: __expectString,
44924503
templateConfiguration: (_: any) => _json(__expectUnion(_)),

0 commit comments

Comments
 (0)