Skip to content

Commit

Permalink
feat(client-bedrock-agent-runtime): This release adds support to prov…
Browse files Browse the repository at this point in the history
…ide guardrail configuration and modify inference parameters that are then used in RetrieveAndGenerate API in Agents for Amazon Bedrock.
  • Loading branch information
awstools committed May 9, 2024
1 parent 4a7a81d commit 98edd48
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export interface InvokeAgentCommandInput extends InvokeAgentRequest {}
export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __MetadataBearer {}

/**
* <p>Sends a prompt for the agent to process and respond to. Use return control event type for function calling.</p>
* <note>
* <note>
* <p>The CLI doesn't support <code>InvokeAgent</code>.</p>
* </note>
* <p>Sends a prompt for the agent to process and respond to. Note the following fields for the request:</p>
* <ul>
* <li>
* <p>To continue the same conversation with an agent, use the same <code>sessionId</code> value in the request.</p>
Expand All @@ -51,10 +51,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p>
* </li>
* <li>
* <p>In the <code>sessionState</code> object, you can include attributes for the session or prompt or parameters returned from the action group.</p>
* </li>
* <li>
* <p>Use return control event type for function calling.</p>
* <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>
* </li>
* </ul>
* <p>The response is returned in the <code>bytes</code> field of the <code>chunk</code> object.</p>
Expand All @@ -66,6 +63,9 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* <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>
* </li>
* <li>
* <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>
* </li>
* <li>
* <p>Errors are also surfaced in the response.</p>
* </li>
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* promptTemplate: { // PromptTemplate
* textPromptTemplate: "STRING_VALUE",
* },
* guardrailConfiguration: { // GuardrailConfiguration
* guardrailId: "STRING_VALUE", // required
* guardrailVersion: "STRING_VALUE", // required
* },
* inferenceConfig: { // InferenceConfig
* textInferenceConfig: { // TextInferenceConfig
* temperature: Number("float"),
* topP: Number("float"),
* maxTokens: Number("int"),
* stopSequences: [ // RAGStopSequences
* "STRING_VALUE",
* ],
* },
* },
* additionalModelRequestFields: { // AdditionalModelRequestFields
* "<keys>": "DOCUMENT_VALUE",
* },
* },
* },
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
Expand All @@ -132,6 +149,23 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* promptTemplate: {
* textPromptTemplate: "STRING_VALUE",
* },
* guardrailConfiguration: {
* guardrailId: "STRING_VALUE", // required
* guardrailVersion: "STRING_VALUE", // required
* },
* inferenceConfig: {
* textInferenceConfig: {
* temperature: Number("float"),
* topP: Number("float"),
* maxTokens: Number("int"),
* stopSequences: [
* "STRING_VALUE",
* ],
* },
* },
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* },
* },
* },
Expand Down Expand Up @@ -175,6 +209,7 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* // ],
* // },
* // ],
* // guardrailAction: "INTERVENED" || "NONE",
* // };
*
* ```
Expand Down
Loading

0 comments on commit 98edd48

Please sign in to comment.