Skip to content

Commit

Permalink
feat(client-bedrock-agent-runtime): bedrock agents now supports long …
Browse files Browse the repository at this point in the history
…term memory and performance configs. Invokeflow supports performance configs. RetrieveAndGenerate performance configs
  • Loading branch information
awstools committed Dec 20, 2024
1 parent e4e1078 commit 8cc6104
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface DeleteAgentMemoryCommandOutput extends DeleteAgentMemoryRespons
* agentId: "STRING_VALUE", // required
* agentAliasId: "STRING_VALUE", // required
* memoryId: "STRING_VALUE",
* sessionId: "STRING_VALUE",
* };
* const command = new DeleteAgentMemoryCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* <p>To activate trace enablement, turn <code>enableTrace</code> to <code>true</code>. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
* </li>
* <li>
* <p>To stream agent responses, make sure that only orchestration prompt is enabled. Agent streaming is not supported for the following steps:
* </p>
* <ul>
* <li>
* <p>
* <code>Pre-processing</code>
* </p>
* </li>
* <li>
* <p>
* <code>Post-processing</code>
* </p>
* </li>
* <li>
* <p>Agent with 1 Knowledge base and <code>User Input</code> not enabled</p>
* </li>
* </ul>
* </li>
* <li>
* <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p>
* </li>
* <li>
Expand Down Expand Up @@ -91,13 +110,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* httpMethod: "STRING_VALUE",
* apiPath: "STRING_VALUE",
* confirmationState: "CONFIRM" || "DENY",
* responseState: "FAILURE" || "REPROMPT",
* httpStatusCode: Number("int"),
* responseBody: { // ResponseBody
* "<keys>": { // ContentBody
* body: "STRING_VALUE",
* },
* },
* httpStatusCode: Number("int"),
* responseState: "FAILURE" || "REPROMPT",
* agentId: "STRING_VALUE",
* },
* functionResult: { // FunctionResult
Expand Down Expand Up @@ -251,6 +270,11 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* enableTrace: true || false,
* inputText: "STRING_VALUE",
* memoryId: "STRING_VALUE",
* bedrockModelConfigurations: { // BedrockModelConfigurations
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* streamingConfigurations: { // StreamingConfigurations
* streamFinalResponse: true || false,
* applyGuardrailInterval: Number("int"),
Expand Down Expand Up @@ -535,13 +559,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* // httpMethod: "STRING_VALUE",
* // apiPath: "STRING_VALUE",
* // confirmationState: "CONFIRM" || "DENY",
* // responseState: "FAILURE" || "REPROMPT",
* // httpStatusCode: Number("int"),
* // responseBody: { // ResponseBody
* // "<keys>": { // ContentBody
* // body: "STRING_VALUE",
* // },
* // },
* // httpStatusCode: Number("int"),
* // responseState: "FAILURE" || "REPROMPT",
* // agentId: "STRING_VALUE",
* // },
* // functionResult: { // FunctionResult
Expand Down Expand Up @@ -798,13 +822,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* // httpMethod: "STRING_VALUE",
* // apiPath: "STRING_VALUE",
* // confirmationState: "CONFIRM" || "DENY",
* // responseState: "FAILURE" || "REPROMPT",
* // httpStatusCode: Number("int"),
* // responseBody: {
* // "<keys>": {
* // body: "STRING_VALUE",
* // },
* // },
* // httpStatusCode: Number("int"),
* // responseState: "FAILURE" || "REPROMPT",
* // agentId: "STRING_VALUE",
* // },
* // functionResult: {
Expand Down Expand Up @@ -1074,6 +1098,9 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* // message: "STRING_VALUE",
* // resourceName: "STRING_VALUE",
* // },
* // modelNotReadyException: { // ModelNotReadyException
* // message: "STRING_VALUE",
* // },
* // files: { // FilePart
* // files: [ // OutputFiles
* // { // OutputFile
Expand Down Expand Up @@ -1112,6 +1139,14 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* @throws {@link InternalServerException} (server fault)
* <p>An internal server error occurred. Retry your request.</p>
*
* @throws {@link ModelNotReadyException} (client fault)
* <p>
* The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
* reference guide.
* </p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataB
* },
* ],
* enableTrace: true || false,
* modelPerformanceConfiguration: { // ModelPerformanceConfiguration
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* };
* const command = new InvokeFlowCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* httpMethod: "STRING_VALUE",
* apiPath: "STRING_VALUE",
* confirmationState: "CONFIRM" || "DENY",
* responseState: "FAILURE" || "REPROMPT",
* httpStatusCode: Number("int"),
* responseBody: { // ResponseBody
* "<keys>": { // ContentBody
* body: "STRING_VALUE",
* },
* },
* httpStatusCode: Number("int"),
* responseState: "FAILURE" || "REPROMPT",
* agentId: "STRING_VALUE",
* },
* functionResult: { // FunctionResult
Expand Down Expand Up @@ -293,6 +293,11 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* ],
* overrideLambda: "STRING_VALUE",
* },
* bedrockModelConfigurations: { // InlineBedrockModelConfigurations
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* };
* const command = new InvokeInlineAgentCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -572,13 +577,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* // httpMethod: "STRING_VALUE",
* // apiPath: "STRING_VALUE",
* // confirmationState: "CONFIRM" || "DENY",
* // responseState: "FAILURE" || "REPROMPT",
* // httpStatusCode: Number("int"),
* // responseBody: { // ResponseBody
* // "<keys>": { // ContentBody
* // body: "STRING_VALUE",
* // },
* // },
* // httpStatusCode: Number("int"),
* // responseState: "FAILURE" || "REPROMPT",
* // agentId: "STRING_VALUE",
* // },
* // functionResult: { // FunctionResult
Expand Down Expand Up @@ -835,13 +840,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* // httpMethod: "STRING_VALUE",
* // apiPath: "STRING_VALUE",
* // confirmationState: "CONFIRM" || "DENY",
* // responseState: "FAILURE" || "REPROMPT",
* // httpStatusCode: Number("int"),
* // responseBody: {
* // "<keys>": {
* // body: "STRING_VALUE",
* // },
* // },
* // httpStatusCode: Number("int"),
* // responseState: "FAILURE" || "REPROMPT",
* // agentId: "STRING_VALUE",
* // },
* // functionResult: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* orchestrationConfiguration: { // OrchestrationConfiguration
* promptTemplate: {
Expand All @@ -191,6 +194,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* queryTransformationConfiguration: { // QueryTransformationConfiguration
* type: "QUERY_DECOMPOSITION", // required
* },
* performanceConfig: {
* latency: "standard" || "optimized",
* },
* },
* },
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
Expand Down Expand Up @@ -229,6 +235,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* performanceConfig: {
* latency: "standard" || "optimized",
* },
* },
* },
* },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* orchestrationConfiguration: { // OrchestrationConfiguration
* promptTemplate: {
Expand All @@ -194,6 +197,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
* queryTransformationConfiguration: { // QueryTransformationConfiguration
* type: "QUERY_DECOMPOSITION", // required
* },
* performanceConfig: {
* latency: "standard" || "optimized",
* },
* },
* },
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
Expand Down Expand Up @@ -232,6 +238,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* performanceConfig: {
* latency: "standard" || "optimized",
* },
* },
* },
* },
Expand Down
Loading

0 comments on commit 8cc6104

Please sign in to comment.