Skip to content

Commit a4195f7

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): Support for Custom Orchestration within InlineAgents
1 parent 1325ef0 commit a4195f7

16 files changed

+730
-1496
lines changed

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,7 @@ export interface CreateInvocationCommandInput extends CreateInvocationRequest {}
3232
export interface CreateInvocationCommandOutput extends CreateInvocationResponse, __MetadataBearer {}
3333

3434
/**
35-
* <p>Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from
36-
* a conversation. For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
37-
* <p>Related APIs</p>
38-
* <ul>
39-
* <li>
40-
* <p>
41-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListInvocations.html">ListInvocations</a>
42-
* </p>
43-
* </li>
44-
* <li>
45-
* <p>
46-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListSessions.html">ListSessions</a>
47-
* </p>
48-
* </li>
49-
* <li>
50-
* <p>
51-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html">GetSession</a>
52-
* </p>
53-
* </li>
54-
* </ul>
35+
* <p>Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from a conversation. For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p> <p>Related APIs</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListInvocations.html">ListInvocations</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListSessions.html">ListSessions</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html">GetSession</a> </p> </li> </ul>
5536
* @example
5637
* Use a bare-bones client and the command you need to make an API call.
5738
* ```javascript

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

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,7 @@ export interface CreateSessionCommandInput extends CreateSessionRequest {}
3232
export interface CreateSessionCommandOutput extends CreateSessionResponse, __MetadataBearer {}
3333

3434
/**
35-
* <p>Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source
36-
* frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of
37-
* conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see
38-
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
39-
* <p>By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata,
40-
* or you can use your own KMS key. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html">Amazon Bedrock session encryption</a>.</p>
41-
* <note>
42-
* <p>
43-
* You use a session to store state and conversation history for generative AI applications built with open-source frameworks.
44-
* For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the
45-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> API operation.
46-
* </p>
47-
* </note>
48-
* <p>Related APIs:</p>
49-
* <ul>
50-
* <li>
51-
* <p>
52-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListSessions.html">ListSessions</a>
53-
* </p>
54-
* </li>
55-
* <li>
56-
* <p>
57-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html">GetSession</a>
58-
* </p>
59-
* </li>
60-
* <li>
61-
* <p>
62-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html">EndSession</a>
63-
* </p>
64-
* </li>
65-
* <li>
66-
* <p>
67-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_DeleteSession.html">DeleteSession</a>
68-
* </p>
69-
* </li>
70-
* </ul>
35+
* <p>Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p> <p>By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata, or you can use your own KMS key. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html">Amazon Bedrock session encryption</a>.</p> <note> <p> You use a session to store state and conversation history for generative AI applications built with open-source frameworks. For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> API operation. </p> </note> <p>Related APIs:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListSessions.html">ListSessions</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html">GetSession</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html">EndSession</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_DeleteSession.html">DeleteSession</a> </p> </li> </ul>
7136
* @example
7237
* Use a bare-bones client and the command you need to make an API call.
7338
* ```javascript

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export interface DeleteSessionCommandInput extends DeleteSessionRequest {}
3232
export interface DeleteSessionCommandOutput extends DeleteSessionResponse, __MetadataBearer {}
3333

3434
/**
35-
* <p>Deletes a session that you ended. You can't delete a session with an <code>ACTIVE</code> status. To delete an active session, you must first end it with the
36-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html">EndSession</a> API operation.
37-
* For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
35+
* <p>Deletes a session that you ended. You can't delete a session with an <code>ACTIVE</code> status. To delete an active session, you must first end it with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html">EndSession</a> API operation. For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
3836
* @example
3937
* Use a bare-bones client and the command you need to make an API call.
4038
* ```javascript

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export interface EndSessionCommandInput extends EndSessionRequest {}
3232
export interface EndSessionCommandOutput extends EndSessionResponse, __MetadataBearer {}
3333

3434
/**
35-
* <p>Ends the session.
36-
* After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation.
37-
* For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
35+
* <p>Ends the session. After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation. For more information about sessions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html">Store and retrieve conversation history and context with Amazon Bedrock sessions</a>.</p>
3836
* @example
3937
* Use a bare-bones client and the command you need to make an API call.
4038
* ```javascript

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

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,7 @@ export interface InvokeAgentCommandInput extends InvokeAgentRequest {}
3333
export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __MetadataBearer {}
3434

3535
/**
36-
* <note>
37-
* </note>
38-
* <p>Sends a prompt for the agent to process and respond to. Note the following fields for the request:</p>
39-
* <ul>
40-
* <li>
41-
* <p>To continue the same conversation with an agent, use the same <code>sessionId</code> value in the request.</p>
42-
* </li>
43-
* <li>
44-
* <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>
45-
* </li>
46-
* <li>
47-
* <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p>
48-
* </li>
49-
* <li>
50-
* <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>
51-
* </li>
52-
* </ul>
53-
* <p>The response contains both <b>chunk</b> and <b>trace</b> attributes.</p>
54-
* <p>The final response is returned in the <code>bytes</code> field of the <code>chunk</code> object. The <code>InvokeAgent</code> returns one chunk for the entire interaction.</p>
55-
* <ul>
56-
* <li>
57-
* <p>The <code>attribution</code> object contains citations for parts of the response.</p>
58-
* </li>
59-
* <li>
60-
* <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>
61-
* </li>
62-
* <li>
63-
* <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>
64-
* </li>
65-
* <li>
66-
* <p>Errors are also surfaced in the response.</p>
67-
* </li>
68-
* </ul>
36+
* <note> </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> </li> <li> <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>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, if you configured an action group to return control, results from invocation of the action group.</p> </li> </ul> <p>The response contains both <b>chunk</b> and <b>trace</b> attributes.</p> <p>The final response is returned in the <code>bytes</code> field of the <code>chunk</code> object. The <code>InvokeAgent</code> returns one chunk for the entire interaction.</p> <ul> <li> <p>The <code>attribution</code> object contains citations for parts of the response.</p> </li> <li> <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>
6937
* @example
7038
* Use a bare-bones client and the command you need to make an API call.
7139
* ```javascript
@@ -1060,16 +1028,16 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
10601028
* // },
10611029
* // },
10621030
* // },
1063-
* // agentId: "STRING_VALUE",
1064-
* // agentAliasId: "STRING_VALUE",
1065-
* // agentVersion: "STRING_VALUE",
10661031
* // callerChain: [ // CallerChain
10671032
* // { // Caller Union: only one key present
10681033
* // agentAliasArn: "STRING_VALUE",
10691034
* // },
10701035
* // ],
10711036
* // eventTime: new Date("TIMESTAMP"),
10721037
* // collaboratorName: "STRING_VALUE",
1038+
* // agentId: "STRING_VALUE",
1039+
* // agentAliasId: "STRING_VALUE",
1040+
* // agentVersion: "STRING_VALUE",
10731041
* // },
10741042
* // returnControl: {
10751043
* // invocationInputs: [
@@ -1188,12 +1156,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
11881156
* <p>An internal server error occurred. Retry your request.</p>
11891157
*
11901158
* @throws {@link ModelNotReadyException} (client fault)
1191-
* <p>
1192-
* The model specified in the request is not ready to serve inference requests. The AWS SDK
1193-
* will automatically retry the operation up to 5 times. For information about configuring
1194-
* 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>
1195-
* reference guide.
1196-
* </p>
1159+
* <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>
11971160
*
11981161
* @throws {@link ResourceNotFoundException} (client fault)
11991162
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ export interface InvokeFlowCommandInput extends InvokeFlowRequest {}
3737
export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataBearer {}
3838

3939
/**
40-
* <p>Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html">Test a flow in Amazon Bedrock</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
41-
* <note>
42-
* <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeFlow</code>.</p>
43-
* </note>
40+
* <p>Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html">Test a flow in Amazon Bedrock</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeFlow</code>.</p> </note>
4441
* @example
4542
* Use a bare-bones client and the command you need to make an API call.
4643
* ```javascript

0 commit comments

Comments
 (0)