Skip to content

Commit 98edd48

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): This release adds support to provide guardrail configuration and modify inference parameters that are then used in RetrieveAndGenerate API in Agents for Amazon Bedrock.
1 parent 4a7a81d commit 98edd48

File tree

5 files changed

+491
-61
lines changed

5 files changed

+491
-61
lines changed

clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ export interface InvokeAgentCommandInput extends InvokeAgentRequest {}
3636
export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __MetadataBearer {}
3737

3838
/**
39-
* <p>Sends a prompt for the agent to process and respond to. Use return control event type for function calling.</p>
40-
* <note>
39+
* <note>
4140
* <p>The CLI doesn't support <code>InvokeAgent</code>.</p>
4241
* </note>
42+
* <p>Sends a prompt for the agent to process and respond to. Note the following fields for the request:</p>
4343
* <ul>
4444
* <li>
4545
* <p>To continue the same conversation with an agent, use the same <code>sessionId</code> value in the request.</p>
@@ -51,10 +51,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
5151
* <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p>
5252
* </li>
5353
* <li>
54-
* <p>In the <code>sessionState</code> object, you can include attributes for the session or prompt or parameters returned from the action group.</p>
55-
* </li>
56-
* <li>
57-
* <p>Use return control event type for function calling.</p>
54+
* <p>In the <code>sessionState</code> object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.</p>
5855
* </li>
5956
* </ul>
6057
* <p>The response is returned in the <code>bytes</code> field of the <code>chunk</code> object.</p>
@@ -66,6 +63,9 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
6663
* <p>If you set <code>enableTrace</code> to <code>true</code> in the request, you can trace the agent's steps and reasoning process that led it to the response.</p>
6764
* </li>
6865
* <li>
66+
* <p>If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the <code>returnControl</code> field.</p>
67+
* </li>
68+
* <li>
6969
* <p>Errors are also surfaced in the response.</p>
7070
* </li>
7171
* </ul>

clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts

+35
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,23 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
111111
* promptTemplate: { // PromptTemplate
112112
* textPromptTemplate: "STRING_VALUE",
113113
* },
114+
* guardrailConfiguration: { // GuardrailConfiguration
115+
* guardrailId: "STRING_VALUE", // required
116+
* guardrailVersion: "STRING_VALUE", // required
117+
* },
118+
* inferenceConfig: { // InferenceConfig
119+
* textInferenceConfig: { // TextInferenceConfig
120+
* temperature: Number("float"),
121+
* topP: Number("float"),
122+
* maxTokens: Number("int"),
123+
* stopSequences: [ // RAGStopSequences
124+
* "STRING_VALUE",
125+
* ],
126+
* },
127+
* },
128+
* additionalModelRequestFields: { // AdditionalModelRequestFields
129+
* "<keys>": "DOCUMENT_VALUE",
130+
* },
114131
* },
115132
* },
116133
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
@@ -132,6 +149,23 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
132149
* promptTemplate: {
133150
* textPromptTemplate: "STRING_VALUE",
134151
* },
152+
* guardrailConfiguration: {
153+
* guardrailId: "STRING_VALUE", // required
154+
* guardrailVersion: "STRING_VALUE", // required
155+
* },
156+
* inferenceConfig: {
157+
* textInferenceConfig: {
158+
* temperature: Number("float"),
159+
* topP: Number("float"),
160+
* maxTokens: Number("int"),
161+
* stopSequences: [
162+
* "STRING_VALUE",
163+
* ],
164+
* },
165+
* },
166+
* additionalModelRequestFields: {
167+
* "<keys>": "DOCUMENT_VALUE",
168+
* },
135169
* },
136170
* },
137171
* },
@@ -175,6 +209,7 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
175209
* // ],
176210
* // },
177211
* // ],
212+
* // guardrailAction: "INTERVENED" || "NONE",
178213
* // };
179214
*
180215
* ```

0 commit comments

Comments
 (0)