Skip to content

Commit

Permalink
feat(client-bedrock-agent-runtime): Support Multi Agent Collaboration…
Browse files Browse the repository at this point in the history
… within Inline Agents
  • Loading branch information
awstools committed Mar 7, 2025
1 parent 01aec90 commit 28c9d3b
Show file tree
Hide file tree
Showing 8 changed files with 896 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
* // agentAliasArn: "STRING_VALUE",
* // },
* // ],
* // eventTime: new Date("TIMESTAMP"),
* // collaboratorName: "STRING_VALUE",
* // },
* // returnControl: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,66 +65,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* // const { BedrockAgentRuntimeClient, InvokeInlineAgentCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
* const client = new BedrockAgentRuntimeClient(config);
* const input = { // InvokeInlineAgentRequest
* sessionId: "STRING_VALUE", // required
* customerEncryptionKeyArn: "STRING_VALUE",
* endSession: true || false,
* enableTrace: true || false,
* inputText: "STRING_VALUE",
* inlineSessionState: { // InlineSessionState
* sessionAttributes: { // SessionAttributesMap
* "<keys>": "STRING_VALUE",
* },
* promptSessionAttributes: { // PromptSessionAttributesMap
* "<keys>": "STRING_VALUE",
* },
* returnControlInvocationResults: [ // ReturnControlInvocationResults
* { // InvocationResultMember Union: only one key present
* apiResult: { // ApiResult
* actionGroup: "STRING_VALUE", // required
* httpMethod: "STRING_VALUE",
* apiPath: "STRING_VALUE",
* confirmationState: "CONFIRM" || "DENY",
* responseState: "FAILURE" || "REPROMPT",
* httpStatusCode: Number("int"),
* responseBody: { // ResponseBody
* "<keys>": { // ContentBody
* body: "STRING_VALUE",
* },
* },
* agentId: "STRING_VALUE",
* },
* functionResult: { // FunctionResult
* actionGroup: "STRING_VALUE", // required
* confirmationState: "CONFIRM" || "DENY",
* function: "STRING_VALUE",
* responseBody: {
* "<keys>": {
* body: "STRING_VALUE",
* },
* },
* responseState: "FAILURE" || "REPROMPT",
* agentId: "STRING_VALUE",
* },
* },
* ],
* invocationId: "STRING_VALUE",
* files: [ // InputFiles
* { // InputFile
* name: "STRING_VALUE", // required
* source: { // FileSource
* sourceType: "S3" || "BYTE_CONTENT", // required
* s3Location: { // S3ObjectFile
* uri: "STRING_VALUE", // required
* },
* byteContent: { // ByteContentFile
* mediaType: "STRING_VALUE", // required
* data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
* },
* },
* useCase: "CODE_INTERPRETER" || "CHAT", // required
* },
* ],
* },
* foundationModel: "STRING_VALUE", // required
* instruction: "STRING_VALUE", // required
* idleSessionTTLInSeconds: Number("int"),
Expand Down Expand Up @@ -284,20 +225,230 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
* ],
* },
* parserMode: "DEFAULT" || "OVERRIDDEN",
* foundationModel: "STRING_VALUE",
* additionalModelRequestFields: "DOCUMENT_VALUE",
* },
* ],
* overrideLambda: "STRING_VALUE",
* },
* bedrockModelConfigurations: { // InlineBedrockModelConfigurations
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* collaboratorConfigurations: [ // CollaboratorConfigurations
* { // CollaboratorConfiguration
* collaboratorName: "STRING_VALUE", // required
* collaboratorInstruction: "STRING_VALUE", // required
* agentAliasArn: "STRING_VALUE",
* relayConversationHistory: "TO_COLLABORATOR" || "DISABLED",
* },
* },
* ],
* sessionId: "STRING_VALUE", // required
* endSession: true || false,
* enableTrace: true || false,
* inputText: "STRING_VALUE",
* streamingConfigurations: { // StreamingConfigurations
* streamFinalResponse: true || false,
* applyGuardrailInterval: Number("int"),
* },
* inlineSessionState: { // InlineSessionState
* sessionAttributes: { // SessionAttributesMap
* "<keys>": "STRING_VALUE",
* },
* promptSessionAttributes: { // PromptSessionAttributesMap
* "<keys>": "STRING_VALUE",
* },
* returnControlInvocationResults: [ // ReturnControlInvocationResults
* { // InvocationResultMember Union: only one key present
* apiResult: { // ApiResult
* actionGroup: "STRING_VALUE", // required
* httpMethod: "STRING_VALUE",
* apiPath: "STRING_VALUE",
* confirmationState: "CONFIRM" || "DENY",
* responseState: "FAILURE" || "REPROMPT",
* httpStatusCode: Number("int"),
* responseBody: { // ResponseBody
* "<keys>": { // ContentBody
* body: "STRING_VALUE",
* },
* },
* agentId: "STRING_VALUE",
* },
* functionResult: { // FunctionResult
* actionGroup: "STRING_VALUE", // required
* confirmationState: "CONFIRM" || "DENY",
* function: "STRING_VALUE",
* responseBody: {
* "<keys>": {
* body: "STRING_VALUE",
* },
* },
* responseState: "FAILURE" || "REPROMPT",
* agentId: "STRING_VALUE",
* },
* },
* ],
* invocationId: "STRING_VALUE",
* files: [ // InputFiles
* { // InputFile
* name: "STRING_VALUE", // required
* source: { // FileSource
* sourceType: "S3" || "BYTE_CONTENT", // required
* s3Location: { // S3ObjectFile
* uri: "STRING_VALUE", // required
* },
* byteContent: { // ByteContentFile
* mediaType: "STRING_VALUE", // required
* data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
* },
* },
* useCase: "CODE_INTERPRETER" || "CHAT", // required
* },
* ],
* conversationHistory: { // ConversationHistory
* messages: [ // Messages
* { // Message
* role: "user" || "assistant", // required
* content: [ // ContentBlocks // required
* { // ContentBlock Union: only one key present
* text: "STRING_VALUE",
* },
* ],
* },
* ],
* },
* },
* collaborators: [ // Collaborators
* { // Collaborator
* customerEncryptionKeyArn: "STRING_VALUE",
* foundationModel: "STRING_VALUE", // required
* instruction: "STRING_VALUE", // required
* idleSessionTTLInSeconds: Number("int"),
* actionGroups: [
* {
* actionGroupName: "STRING_VALUE", // required
* description: "STRING_VALUE",
* parentActionGroupSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
* actionGroupExecutor: {// Union: only one key present
* lambda: "STRING_VALUE",
* customControl: "RETURN_CONTROL",
* },
* apiSchema: {// Union: only one key present
* s3: {
* s3BucketName: "STRING_VALUE",
* s3ObjectKey: "STRING_VALUE",
* },
* payload: "STRING_VALUE",
* },
* functionSchema: {// Union: only one key present
* functions: [
* {
* name: "STRING_VALUE", // required
* description: "STRING_VALUE",
* parameters: {
* "<keys>": {
* description: "STRING_VALUE",
* type: "string" || "number" || "integer" || "boolean" || "array", // required
* required: true || false,
* },
* },
* requireConfirmation: "ENABLED" || "DISABLED",
* },
* ],
* },
* },
* ],
* knowledgeBases: [
* {
* knowledgeBaseId: "STRING_VALUE", // required
* description: "STRING_VALUE", // required
* retrievalConfiguration: {
* vectorSearchConfiguration: {
* numberOfResults: Number("int"),
* overrideSearchType: "HYBRID" || "SEMANTIC",
* filter: "<RetrievalFilter>",
* rerankingConfiguration: {
* type: "BEDROCK_RERANKING_MODEL", // required
* bedrockRerankingConfiguration: {
* modelConfiguration: {
* modelArn: "STRING_VALUE", // required
* additionalModelRequestFields: {
* "<keys>": "DOCUMENT_VALUE",
* },
* },
* numberOfRerankedResults: Number("int"),
* metadataConfiguration: {
* selectionMode: "SELECTIVE" || "ALL", // required
* selectiveModeConfiguration: {// Union: only one key present
* fieldsToInclude: [
* {
* fieldName: "STRING_VALUE", // required
* },
* ],
* fieldsToExclude: [
* {
* fieldName: "STRING_VALUE", // required
* },
* ],
* },
* },
* },
* },
* implicitFilterConfiguration: {
* metadataAttributes: [ // required
* {
* key: "STRING_VALUE", // required
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
* description: "STRING_VALUE", // required
* },
* ],
* modelArn: "STRING_VALUE", // required
* },
* },
* },
* },
* ],
* guardrailConfiguration: {
* guardrailIdentifier: "STRING_VALUE", // required
* guardrailVersion: "STRING_VALUE", // required
* },
* promptOverrideConfiguration: {
* promptConfigurations: [ // required
* {
* promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING" || "ROUTING_CLASSIFIER",
* promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* promptState: "ENABLED" || "DISABLED",
* basePromptTemplate: "STRING_VALUE",
* inferenceConfiguration: {
* temperature: Number("float"),
* topP: Number("float"),
* topK: Number("int"),
* maximumLength: Number("int"),
* stopSequences: [
* "STRING_VALUE",
* ],
* },
* parserMode: "DEFAULT" || "OVERRIDDEN",
* foundationModel: "STRING_VALUE",
* additionalModelRequestFields: "DOCUMENT_VALUE",
* },
* ],
* overrideLambda: "STRING_VALUE",
* },
* agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* collaboratorConfigurations: [
* {
* collaboratorName: "STRING_VALUE", // required
* collaboratorInstruction: "STRING_VALUE", // required
* agentAliasArn: "STRING_VALUE",
* relayConversationHistory: "TO_COLLABORATOR" || "DISABLED",
* },
* ],
* agentName: "STRING_VALUE",
* },
* ],
* bedrockModelConfigurations: { // InlineBedrockModelConfigurations
* performanceConfig: { // PerformanceConfiguration
* latency: "standard" || "optimized",
* },
* },
* };
* const command = new InvokeInlineAgentCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
ServiceOutputTypes,
} from "../BedrockAgentRuntimeClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { TagResourceRequest, TagResourceResponse } from "../models/models_0";
import { TagResourceRequest } from "../models/models_0";
import { TagResourceResponse } from "../models/models_1";
import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ServiceOutputTypes,
} from "../BedrockAgentRuntimeClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { UntagResourceRequest, UntagResourceResponse } from "../models/models_0";
import { UntagResourceRequest, UntagResourceResponse } from "../models/models_1";
import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
Loading

0 comments on commit 28c9d3b

Please sign in to comment.