@aws-sdk/client-bedrock-agent-runtime 3.697.0 → 3.699.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist-cjs/index.js +483 -1
- package/dist-es/BedrockAgentRuntime.js +2 -0
- package/dist-es/commands/InvokeInlineAgentCommand.js +27 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +197 -0
- package/dist-es/protocols/Aws_restJson1.js +204 -0
- package/dist-types/BedrockAgentRuntime.d.ts +7 -0
- package/dist-types/BedrockAgentRuntimeClient.d.ts +3 -2
- package/dist-types/commands/InvokeAgentCommand.d.ts +6 -6
- package/dist-types/commands/InvokeInlineAgentCommand.d.ts +755 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1120 -33
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/BedrockAgentRuntime.d.ts +17 -0
- package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +6 -0
- package/dist-types/ts3.4/commands/InvokeInlineAgentCommand.d.ts +51 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +492 -2
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +4 -4
|
@@ -4,6 +4,7 @@ import { DeleteAgentMemoryCommand, } from "./commands/DeleteAgentMemoryCommand";
|
|
|
4
4
|
import { GetAgentMemoryCommand, } from "./commands/GetAgentMemoryCommand";
|
|
5
5
|
import { InvokeAgentCommand } from "./commands/InvokeAgentCommand";
|
|
6
6
|
import { InvokeFlowCommand } from "./commands/InvokeFlowCommand";
|
|
7
|
+
import { InvokeInlineAgentCommand, } from "./commands/InvokeInlineAgentCommand";
|
|
7
8
|
import { OptimizePromptCommand, } from "./commands/OptimizePromptCommand";
|
|
8
9
|
import { RetrieveAndGenerateCommand, } from "./commands/RetrieveAndGenerateCommand";
|
|
9
10
|
import { RetrieveCommand } from "./commands/RetrieveCommand";
|
|
@@ -12,6 +13,7 @@ const commands = {
|
|
|
12
13
|
GetAgentMemoryCommand,
|
|
13
14
|
InvokeAgentCommand,
|
|
14
15
|
InvokeFlowCommand,
|
|
16
|
+
InvokeInlineAgentCommand,
|
|
15
17
|
OptimizePromptCommand,
|
|
16
18
|
RetrieveCommand,
|
|
17
19
|
RetrieveAndGenerateCommand,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { InvokeInlineAgentRequestFilterSensitiveLog, InvokeInlineAgentResponseFilterSensitiveLog, } from "../models/models_0";
|
|
6
|
+
import { de_InvokeInlineAgentCommand, se_InvokeInlineAgentCommand } from "../protocols/Aws_restJson1";
|
|
7
|
+
export { $Command };
|
|
8
|
+
export class InvokeInlineAgentCommand extends $Command
|
|
9
|
+
.classBuilder()
|
|
10
|
+
.ep(commonParams)
|
|
11
|
+
.m(function (Command, cs, config, o) {
|
|
12
|
+
return [
|
|
13
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
14
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
15
|
+
];
|
|
16
|
+
})
|
|
17
|
+
.s("AmazonBedrockAgentRunTimeService", "InvokeInlineAgent", {
|
|
18
|
+
eventStream: {
|
|
19
|
+
output: true,
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
.n("BedrockAgentRuntimeClient", "InvokeInlineAgentCommand")
|
|
23
|
+
.f(InvokeInlineAgentRequestFilterSensitiveLog, InvokeInlineAgentResponseFilterSensitiveLog)
|
|
24
|
+
.ser(se_InvokeInlineAgentCommand)
|
|
25
|
+
.de(de_InvokeInlineAgentCommand)
|
|
26
|
+
.build() {
|
|
27
|
+
}
|
|
@@ -2,6 +2,7 @@ export * from "./DeleteAgentMemoryCommand";
|
|
|
2
2
|
export * from "./GetAgentMemoryCommand";
|
|
3
3
|
export * from "./InvokeAgentCommand";
|
|
4
4
|
export * from "./InvokeFlowCommand";
|
|
5
|
+
export * from "./InvokeInlineAgentCommand";
|
|
5
6
|
export * from "./OptimizePromptCommand";
|
|
6
7
|
export * from "./RetrieveAndGenerateCommand";
|
|
7
8
|
export * from "./RetrieveCommand";
|
|
@@ -12,15 +12,61 @@ export class AccessDeniedException extends __BaseException {
|
|
|
12
12
|
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
export const CustomControlMethod = {
|
|
16
|
+
RETURN_CONTROL: "RETURN_CONTROL",
|
|
17
|
+
};
|
|
18
|
+
export var ActionGroupExecutor;
|
|
19
|
+
(function (ActionGroupExecutor) {
|
|
20
|
+
ActionGroupExecutor.visit = (value, visitor) => {
|
|
21
|
+
if (value.lambda !== undefined)
|
|
22
|
+
return visitor.lambda(value.lambda);
|
|
23
|
+
if (value.customControl !== undefined)
|
|
24
|
+
return visitor.customControl(value.customControl);
|
|
25
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
26
|
+
};
|
|
27
|
+
})(ActionGroupExecutor || (ActionGroupExecutor = {}));
|
|
15
28
|
export const ExecutionType = {
|
|
16
29
|
LAMBDA: "LAMBDA",
|
|
17
30
|
RETURN_CONTROL: "RETURN_CONTROL",
|
|
18
31
|
};
|
|
32
|
+
export const ActionGroupSignature = {
|
|
33
|
+
AMAZON_CODEINTERPRETER: "AMAZON.CodeInterpreter",
|
|
34
|
+
AMAZON_USERINPUT: "AMAZON.UserInput",
|
|
35
|
+
};
|
|
19
36
|
export const ActionInvocationType = {
|
|
20
37
|
RESULT: "RESULT",
|
|
21
38
|
USER_CONFIRMATION: "USER_CONFIRMATION",
|
|
22
39
|
USER_CONFIRMATION_AND_RESULT: "USER_CONFIRMATION_AND_RESULT",
|
|
23
40
|
};
|
|
41
|
+
export var APISchema;
|
|
42
|
+
(function (APISchema) {
|
|
43
|
+
APISchema.visit = (value, visitor) => {
|
|
44
|
+
if (value.s3 !== undefined)
|
|
45
|
+
return visitor.s3(value.s3);
|
|
46
|
+
if (value.payload !== undefined)
|
|
47
|
+
return visitor.payload(value.payload);
|
|
48
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
49
|
+
};
|
|
50
|
+
})(APISchema || (APISchema = {}));
|
|
51
|
+
export const ParameterType = {
|
|
52
|
+
ARRAY: "array",
|
|
53
|
+
BOOLEAN: "boolean",
|
|
54
|
+
INTEGER: "integer",
|
|
55
|
+
NUMBER: "number",
|
|
56
|
+
STRING: "string",
|
|
57
|
+
};
|
|
58
|
+
export const RequireConfirmation = {
|
|
59
|
+
DISABLED: "DISABLED",
|
|
60
|
+
ENABLED: "ENABLED",
|
|
61
|
+
};
|
|
62
|
+
export var FunctionSchema;
|
|
63
|
+
(function (FunctionSchema) {
|
|
64
|
+
FunctionSchema.visit = (value, visitor) => {
|
|
65
|
+
if (value.functions !== undefined)
|
|
66
|
+
return visitor.functions(value.functions);
|
|
67
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
68
|
+
};
|
|
69
|
+
})(FunctionSchema || (FunctionSchema = {}));
|
|
24
70
|
export class BadGatewayException extends __BaseException {
|
|
25
71
|
constructor(opts) {
|
|
26
72
|
super({
|
|
@@ -337,6 +383,7 @@ export const PromptType = {
|
|
|
337
383
|
ORCHESTRATION: "ORCHESTRATION",
|
|
338
384
|
POST_PROCESSING: "POST_PROCESSING",
|
|
339
385
|
PRE_PROCESSING: "PRE_PROCESSING",
|
|
386
|
+
ROUTING_CLASSIFIER: "ROUTING_CLASSIFIER",
|
|
340
387
|
};
|
|
341
388
|
export const Source = {
|
|
342
389
|
ACTION_GROUP: "ACTION_GROUP",
|
|
@@ -434,6 +481,42 @@ export var ResponseStream;
|
|
|
434
481
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
435
482
|
};
|
|
436
483
|
})(ResponseStream || (ResponseStream = {}));
|
|
484
|
+
export const PromptState = {
|
|
485
|
+
DISABLED: "DISABLED",
|
|
486
|
+
ENABLED: "ENABLED",
|
|
487
|
+
};
|
|
488
|
+
export var InlineAgentResponseStream;
|
|
489
|
+
(function (InlineAgentResponseStream) {
|
|
490
|
+
InlineAgentResponseStream.visit = (value, visitor) => {
|
|
491
|
+
if (value.chunk !== undefined)
|
|
492
|
+
return visitor.chunk(value.chunk);
|
|
493
|
+
if (value.trace !== undefined)
|
|
494
|
+
return visitor.trace(value.trace);
|
|
495
|
+
if (value.returnControl !== undefined)
|
|
496
|
+
return visitor.returnControl(value.returnControl);
|
|
497
|
+
if (value.internalServerException !== undefined)
|
|
498
|
+
return visitor.internalServerException(value.internalServerException);
|
|
499
|
+
if (value.validationException !== undefined)
|
|
500
|
+
return visitor.validationException(value.validationException);
|
|
501
|
+
if (value.resourceNotFoundException !== undefined)
|
|
502
|
+
return visitor.resourceNotFoundException(value.resourceNotFoundException);
|
|
503
|
+
if (value.serviceQuotaExceededException !== undefined)
|
|
504
|
+
return visitor.serviceQuotaExceededException(value.serviceQuotaExceededException);
|
|
505
|
+
if (value.throttlingException !== undefined)
|
|
506
|
+
return visitor.throttlingException(value.throttlingException);
|
|
507
|
+
if (value.accessDeniedException !== undefined)
|
|
508
|
+
return visitor.accessDeniedException(value.accessDeniedException);
|
|
509
|
+
if (value.conflictException !== undefined)
|
|
510
|
+
return visitor.conflictException(value.conflictException);
|
|
511
|
+
if (value.dependencyFailedException !== undefined)
|
|
512
|
+
return visitor.dependencyFailedException(value.dependencyFailedException);
|
|
513
|
+
if (value.badGatewayException !== undefined)
|
|
514
|
+
return visitor.badGatewayException(value.badGatewayException);
|
|
515
|
+
if (value.files !== undefined)
|
|
516
|
+
return visitor.files(value.files);
|
|
517
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
518
|
+
};
|
|
519
|
+
})(InlineAgentResponseStream || (InlineAgentResponseStream = {}));
|
|
437
520
|
export const MemoryType = {
|
|
438
521
|
SESSION_SUMMARY: "SESSION_SUMMARY",
|
|
439
522
|
};
|
|
@@ -541,6 +624,32 @@ export const ActionGroupInvocationOutputFilterSensitiveLog = (obj) => ({
|
|
|
541
624
|
...obj,
|
|
542
625
|
...(obj.text && { text: SENSITIVE_STRING }),
|
|
543
626
|
});
|
|
627
|
+
export const APISchemaFilterSensitiveLog = (obj) => {
|
|
628
|
+
if (obj.s3 !== undefined)
|
|
629
|
+
return { s3: obj.s3 };
|
|
630
|
+
if (obj.payload !== undefined)
|
|
631
|
+
return { payload: SENSITIVE_STRING };
|
|
632
|
+
if (obj.$unknown !== undefined)
|
|
633
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
634
|
+
};
|
|
635
|
+
export const FunctionDefinitionFilterSensitiveLog = (obj) => ({
|
|
636
|
+
...obj,
|
|
637
|
+
...(obj.name && { name: SENSITIVE_STRING }),
|
|
638
|
+
});
|
|
639
|
+
export const FunctionSchemaFilterSensitiveLog = (obj) => {
|
|
640
|
+
if (obj.functions !== undefined)
|
|
641
|
+
return { functions: obj.functions.map((item) => FunctionDefinitionFilterSensitiveLog(item)) };
|
|
642
|
+
if (obj.$unknown !== undefined)
|
|
643
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
644
|
+
};
|
|
645
|
+
export const AgentActionGroupFilterSensitiveLog = (obj) => ({
|
|
646
|
+
...obj,
|
|
647
|
+
...(obj.actionGroupName && { actionGroupName: SENSITIVE_STRING }),
|
|
648
|
+
...(obj.description && { description: SENSITIVE_STRING }),
|
|
649
|
+
...(obj.actionGroupExecutor && { actionGroupExecutor: obj.actionGroupExecutor }),
|
|
650
|
+
...(obj.apiSchema && { apiSchema: APISchemaFilterSensitiveLog(obj.apiSchema) }),
|
|
651
|
+
...(obj.functionSchema && { functionSchema: FunctionSchemaFilterSensitiveLog(obj.functionSchema) }),
|
|
652
|
+
});
|
|
544
653
|
export const FlowInputContentFilterSensitiveLog = (obj) => {
|
|
545
654
|
if (obj.document !== undefined)
|
|
546
655
|
return { document: obj.document };
|
|
@@ -940,6 +1049,76 @@ export const InvokeAgentResponseFilterSensitiveLog = (obj) => ({
|
|
|
940
1049
|
...obj,
|
|
941
1050
|
...(obj.completion && { completion: "STREAMING_CONTENT" }),
|
|
942
1051
|
});
|
|
1052
|
+
export const InlineSessionStateFilterSensitiveLog = (obj) => ({
|
|
1053
|
+
...obj,
|
|
1054
|
+
...(obj.returnControlInvocationResults && {
|
|
1055
|
+
returnControlInvocationResults: obj.returnControlInvocationResults.map((item) => InvocationResultMemberFilterSensitiveLog(item)),
|
|
1056
|
+
}),
|
|
1057
|
+
...(obj.files && { files: obj.files.map((item) => InputFileFilterSensitiveLog(item)) }),
|
|
1058
|
+
});
|
|
1059
|
+
export const PromptConfigurationFilterSensitiveLog = (obj) => ({
|
|
1060
|
+
...obj,
|
|
1061
|
+
...(obj.basePromptTemplate && { basePromptTemplate: SENSITIVE_STRING }),
|
|
1062
|
+
});
|
|
1063
|
+
export const PromptOverrideConfigurationFilterSensitiveLog = (obj) => ({
|
|
1064
|
+
...obj,
|
|
1065
|
+
...(obj.promptConfigurations && {
|
|
1066
|
+
promptConfigurations: obj.promptConfigurations.map((item) => PromptConfigurationFilterSensitiveLog(item)),
|
|
1067
|
+
}),
|
|
1068
|
+
});
|
|
1069
|
+
export const InlineAgentPayloadPartFilterSensitiveLog = (obj) => ({
|
|
1070
|
+
...obj,
|
|
1071
|
+
...(obj.bytes && { bytes: SENSITIVE_STRING }),
|
|
1072
|
+
...(obj.attribution && { attribution: AttributionFilterSensitiveLog(obj.attribution) }),
|
|
1073
|
+
});
|
|
1074
|
+
export const InlineAgentFilePartFilterSensitiveLog = (obj) => ({
|
|
1075
|
+
...obj,
|
|
1076
|
+
...(obj.files && { files: SENSITIVE_STRING }),
|
|
1077
|
+
});
|
|
1078
|
+
export const InlineAgentReturnControlPayloadFilterSensitiveLog = (obj) => ({
|
|
1079
|
+
...obj,
|
|
1080
|
+
...(obj.invocationInputs && {
|
|
1081
|
+
invocationInputs: obj.invocationInputs.map((item) => InvocationInputMemberFilterSensitiveLog(item)),
|
|
1082
|
+
}),
|
|
1083
|
+
});
|
|
1084
|
+
export const InlineAgentTracePartFilterSensitiveLog = (obj) => ({
|
|
1085
|
+
...obj,
|
|
1086
|
+
...(obj.trace && { trace: SENSITIVE_STRING }),
|
|
1087
|
+
});
|
|
1088
|
+
export const InlineAgentResponseStreamFilterSensitiveLog = (obj) => {
|
|
1089
|
+
if (obj.chunk !== undefined)
|
|
1090
|
+
return { chunk: SENSITIVE_STRING };
|
|
1091
|
+
if (obj.trace !== undefined)
|
|
1092
|
+
return { trace: SENSITIVE_STRING };
|
|
1093
|
+
if (obj.returnControl !== undefined)
|
|
1094
|
+
return { returnControl: SENSITIVE_STRING };
|
|
1095
|
+
if (obj.internalServerException !== undefined)
|
|
1096
|
+
return { internalServerException: obj.internalServerException };
|
|
1097
|
+
if (obj.validationException !== undefined)
|
|
1098
|
+
return { validationException: obj.validationException };
|
|
1099
|
+
if (obj.resourceNotFoundException !== undefined)
|
|
1100
|
+
return { resourceNotFoundException: obj.resourceNotFoundException };
|
|
1101
|
+
if (obj.serviceQuotaExceededException !== undefined)
|
|
1102
|
+
return { serviceQuotaExceededException: obj.serviceQuotaExceededException };
|
|
1103
|
+
if (obj.throttlingException !== undefined)
|
|
1104
|
+
return { throttlingException: obj.throttlingException };
|
|
1105
|
+
if (obj.accessDeniedException !== undefined)
|
|
1106
|
+
return { accessDeniedException: obj.accessDeniedException };
|
|
1107
|
+
if (obj.conflictException !== undefined)
|
|
1108
|
+
return { conflictException: obj.conflictException };
|
|
1109
|
+
if (obj.dependencyFailedException !== undefined)
|
|
1110
|
+
return { dependencyFailedException: obj.dependencyFailedException };
|
|
1111
|
+
if (obj.badGatewayException !== undefined)
|
|
1112
|
+
return { badGatewayException: obj.badGatewayException };
|
|
1113
|
+
if (obj.files !== undefined)
|
|
1114
|
+
return { files: InlineAgentFilePartFilterSensitiveLog(obj.files) };
|
|
1115
|
+
if (obj.$unknown !== undefined)
|
|
1116
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
1117
|
+
};
|
|
1118
|
+
export const InvokeInlineAgentResponseFilterSensitiveLog = (obj) => ({
|
|
1119
|
+
...obj,
|
|
1120
|
+
...(obj.completion && { completion: "STREAMING_CONTENT" }),
|
|
1121
|
+
});
|
|
943
1122
|
export const TextPromptFilterSensitiveLog = (obj) => ({
|
|
944
1123
|
...obj,
|
|
945
1124
|
});
|
|
@@ -1086,6 +1265,13 @@ export const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog = (obj) => ({
|
|
|
1086
1265
|
vectorSearchConfiguration: KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog(obj.vectorSearchConfiguration),
|
|
1087
1266
|
}),
|
|
1088
1267
|
});
|
|
1268
|
+
export const KnowledgeBaseFilterSensitiveLog = (obj) => ({
|
|
1269
|
+
...obj,
|
|
1270
|
+
...(obj.description && { description: SENSITIVE_STRING }),
|
|
1271
|
+
...(obj.retrievalConfiguration && {
|
|
1272
|
+
retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration),
|
|
1273
|
+
}),
|
|
1274
|
+
});
|
|
1089
1275
|
export const KnowledgeBaseConfigurationFilterSensitiveLog = (obj) => ({
|
|
1090
1276
|
...obj,
|
|
1091
1277
|
...(obj.retrievalConfiguration && {
|
|
@@ -1120,6 +1306,17 @@ export const RetrieveAndGenerateConfigurationFilterSensitiveLog = (obj) => ({
|
|
|
1120
1306
|
externalSourcesConfiguration: ExternalSourcesRetrieveAndGenerateConfigurationFilterSensitiveLog(obj.externalSourcesConfiguration),
|
|
1121
1307
|
}),
|
|
1122
1308
|
});
|
|
1309
|
+
export const InvokeInlineAgentRequestFilterSensitiveLog = (obj) => ({
|
|
1310
|
+
...obj,
|
|
1311
|
+
...(obj.inputText && { inputText: SENSITIVE_STRING }),
|
|
1312
|
+
...(obj.inlineSessionState && { inlineSessionState: InlineSessionStateFilterSensitiveLog(obj.inlineSessionState) }),
|
|
1313
|
+
...(obj.instruction && { instruction: SENSITIVE_STRING }),
|
|
1314
|
+
...(obj.actionGroups && { actionGroups: obj.actionGroups.map((item) => AgentActionGroupFilterSensitiveLog(item)) }),
|
|
1315
|
+
...(obj.knowledgeBases && {
|
|
1316
|
+
knowledgeBases: obj.knowledgeBases.map((item) => KnowledgeBaseFilterSensitiveLog(item)),
|
|
1317
|
+
}),
|
|
1318
|
+
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
|
|
1319
|
+
});
|
|
1123
1320
|
export const RetrieveAndGenerateRequestFilterSensitiveLog = (obj) => ({
|
|
1124
1321
|
...obj,
|
|
1125
1322
|
...(obj.input && { input: SENSITIVE_STRING }),
|
|
@@ -68,6 +68,31 @@ export const se_InvokeFlowCommand = async (input, context) => {
|
|
|
68
68
|
b.m("POST").h(headers).b(body);
|
|
69
69
|
return b.build();
|
|
70
70
|
};
|
|
71
|
+
export const se_InvokeInlineAgentCommand = async (input, context) => {
|
|
72
|
+
const b = rb(input, context);
|
|
73
|
+
const headers = {
|
|
74
|
+
"content-type": "application/json",
|
|
75
|
+
};
|
|
76
|
+
b.bp("/agents/{sessionId}");
|
|
77
|
+
b.p("sessionId", () => input.sessionId, "{sessionId}", false);
|
|
78
|
+
let body;
|
|
79
|
+
body = JSON.stringify(take(input, {
|
|
80
|
+
actionGroups: (_) => _json(_),
|
|
81
|
+
customerEncryptionKeyArn: [],
|
|
82
|
+
enableTrace: [],
|
|
83
|
+
endSession: [],
|
|
84
|
+
foundationModel: [],
|
|
85
|
+
guardrailConfiguration: (_) => _json(_),
|
|
86
|
+
idleSessionTTLInSeconds: [],
|
|
87
|
+
inlineSessionState: (_) => se_InlineSessionState(_, context),
|
|
88
|
+
inputText: [],
|
|
89
|
+
instruction: [],
|
|
90
|
+
knowledgeBases: (_) => se_KnowledgeBases(_, context),
|
|
91
|
+
promptOverrideConfiguration: (_) => se_PromptOverrideConfiguration(_, context),
|
|
92
|
+
}));
|
|
93
|
+
b.m("POST").h(headers).b(body);
|
|
94
|
+
return b.build();
|
|
95
|
+
};
|
|
71
96
|
export const se_OptimizePromptCommand = async (input, context) => {
|
|
72
97
|
const b = rb(input, context);
|
|
73
98
|
const headers = {
|
|
@@ -164,6 +189,19 @@ export const de_InvokeFlowCommand = async (output, context) => {
|
|
|
164
189
|
contents.responseStream = de_FlowResponseStream(data, context);
|
|
165
190
|
return contents;
|
|
166
191
|
};
|
|
192
|
+
export const de_InvokeInlineAgentCommand = async (output, context) => {
|
|
193
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
194
|
+
return de_CommandError(output, context);
|
|
195
|
+
}
|
|
196
|
+
const contents = map({
|
|
197
|
+
$metadata: deserializeMetadata(output),
|
|
198
|
+
[_cT]: [, output.headers[_xabact]],
|
|
199
|
+
[_sI]: [, output.headers[_xabasi]],
|
|
200
|
+
});
|
|
201
|
+
const data = output.body;
|
|
202
|
+
contents.completion = de_InlineAgentResponseStream(data, context);
|
|
203
|
+
return contents;
|
|
204
|
+
};
|
|
167
205
|
export const de_OptimizePromptCommand = async (output, context) => {
|
|
168
206
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
169
207
|
return de_CommandError(output, context);
|
|
@@ -435,6 +473,76 @@ const de_FlowResponseStream = (output, context) => {
|
|
|
435
473
|
return { $unknown: output };
|
|
436
474
|
});
|
|
437
475
|
};
|
|
476
|
+
const de_InlineAgentResponseStream = (output, context) => {
|
|
477
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
478
|
+
if (event["chunk"] != null) {
|
|
479
|
+
return {
|
|
480
|
+
chunk: await de_InlineAgentPayloadPart_event(event["chunk"], context),
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
if (event["trace"] != null) {
|
|
484
|
+
return {
|
|
485
|
+
trace: await de_InlineAgentTracePart_event(event["trace"], context),
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
if (event["returnControl"] != null) {
|
|
489
|
+
return {
|
|
490
|
+
returnControl: await de_InlineAgentReturnControlPayload_event(event["returnControl"], context),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
if (event["internalServerException"] != null) {
|
|
494
|
+
return {
|
|
495
|
+
internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
if (event["validationException"] != null) {
|
|
499
|
+
return {
|
|
500
|
+
validationException: await de_ValidationException_event(event["validationException"], context),
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
if (event["resourceNotFoundException"] != null) {
|
|
504
|
+
return {
|
|
505
|
+
resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
if (event["serviceQuotaExceededException"] != null) {
|
|
509
|
+
return {
|
|
510
|
+
serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
if (event["throttlingException"] != null) {
|
|
514
|
+
return {
|
|
515
|
+
throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
if (event["accessDeniedException"] != null) {
|
|
519
|
+
return {
|
|
520
|
+
accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
if (event["conflictException"] != null) {
|
|
524
|
+
return {
|
|
525
|
+
conflictException: await de_ConflictException_event(event["conflictException"], context),
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
if (event["dependencyFailedException"] != null) {
|
|
529
|
+
return {
|
|
530
|
+
dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
if (event["badGatewayException"] != null) {
|
|
534
|
+
return {
|
|
535
|
+
badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
if (event["files"] != null) {
|
|
539
|
+
return {
|
|
540
|
+
files: await de_InlineAgentFilePart_event(event["files"], context),
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
return { $unknown: output };
|
|
544
|
+
});
|
|
545
|
+
};
|
|
438
546
|
const de_OptimizedPromptStream = (output, context) => {
|
|
439
547
|
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
440
548
|
if (event["optimizedPromptEvent"] != null) {
|
|
@@ -608,6 +716,30 @@ const de_FlowTraceEvent_event = async (output, context) => {
|
|
|
608
716
|
Object.assign(contents, de_FlowTraceEvent(data, context));
|
|
609
717
|
return contents;
|
|
610
718
|
};
|
|
719
|
+
const de_InlineAgentFilePart_event = async (output, context) => {
|
|
720
|
+
const contents = {};
|
|
721
|
+
const data = await parseBody(output.body, context);
|
|
722
|
+
Object.assign(contents, de_InlineAgentFilePart(data, context));
|
|
723
|
+
return contents;
|
|
724
|
+
};
|
|
725
|
+
const de_InlineAgentPayloadPart_event = async (output, context) => {
|
|
726
|
+
const contents = {};
|
|
727
|
+
const data = await parseBody(output.body, context);
|
|
728
|
+
Object.assign(contents, de_InlineAgentPayloadPart(data, context));
|
|
729
|
+
return contents;
|
|
730
|
+
};
|
|
731
|
+
const de_InlineAgentReturnControlPayload_event = async (output, context) => {
|
|
732
|
+
const contents = {};
|
|
733
|
+
const data = await parseBody(output.body, context);
|
|
734
|
+
Object.assign(contents, _json(data));
|
|
735
|
+
return contents;
|
|
736
|
+
};
|
|
737
|
+
const de_InlineAgentTracePart_event = async (output, context) => {
|
|
738
|
+
const contents = {};
|
|
739
|
+
const data = await parseBody(output.body, context);
|
|
740
|
+
Object.assign(contents, de_InlineAgentTracePart(data, context));
|
|
741
|
+
return contents;
|
|
742
|
+
};
|
|
611
743
|
const de_InternalServerException_event = async (output, context) => {
|
|
612
744
|
const parsedOutput = {
|
|
613
745
|
...output,
|
|
@@ -770,6 +902,24 @@ const se_InferenceConfig = (input, context) => {
|
|
|
770
902
|
textInferenceConfig: (_) => se_TextInferenceConfig(_, context),
|
|
771
903
|
});
|
|
772
904
|
};
|
|
905
|
+
const se_InferenceConfiguration = (input, context) => {
|
|
906
|
+
return take(input, {
|
|
907
|
+
maximumLength: [],
|
|
908
|
+
stopSequences: _json,
|
|
909
|
+
temperature: __serializeFloat,
|
|
910
|
+
topK: [],
|
|
911
|
+
topP: __serializeFloat,
|
|
912
|
+
});
|
|
913
|
+
};
|
|
914
|
+
const se_InlineSessionState = (input, context) => {
|
|
915
|
+
return take(input, {
|
|
916
|
+
files: (_) => se_InputFiles(_, context),
|
|
917
|
+
invocationId: [],
|
|
918
|
+
promptSessionAttributes: _json,
|
|
919
|
+
returnControlInvocationResults: _json,
|
|
920
|
+
sessionAttributes: _json,
|
|
921
|
+
});
|
|
922
|
+
};
|
|
773
923
|
const se_InputFile = (input, context) => {
|
|
774
924
|
return take(input, {
|
|
775
925
|
name: [],
|
|
@@ -784,6 +934,13 @@ const se_InputFiles = (input, context) => {
|
|
|
784
934
|
return se_InputFile(entry, context);
|
|
785
935
|
});
|
|
786
936
|
};
|
|
937
|
+
const se_KnowledgeBase = (input, context) => {
|
|
938
|
+
return take(input, {
|
|
939
|
+
description: [],
|
|
940
|
+
knowledgeBaseId: [],
|
|
941
|
+
retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
|
|
942
|
+
});
|
|
943
|
+
};
|
|
787
944
|
const se_KnowledgeBaseConfiguration = (input, context) => {
|
|
788
945
|
return take(input, {
|
|
789
946
|
knowledgeBaseId: [],
|
|
@@ -811,6 +968,13 @@ const se_KnowledgeBaseRetrieveAndGenerateConfiguration = (input, context) => {
|
|
|
811
968
|
retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
|
|
812
969
|
});
|
|
813
970
|
};
|
|
971
|
+
const se_KnowledgeBases = (input, context) => {
|
|
972
|
+
return input
|
|
973
|
+
.filter((e) => e != null)
|
|
974
|
+
.map((entry) => {
|
|
975
|
+
return se_KnowledgeBase(entry, context);
|
|
976
|
+
});
|
|
977
|
+
};
|
|
814
978
|
const se_KnowledgeBaseVectorSearchConfiguration = (input, context) => {
|
|
815
979
|
return take(input, {
|
|
816
980
|
filter: (_) => se_RetrievalFilter(_, context),
|
|
@@ -826,6 +990,29 @@ const se_OrchestrationConfiguration = (input, context) => {
|
|
|
826
990
|
queryTransformationConfiguration: _json,
|
|
827
991
|
});
|
|
828
992
|
};
|
|
993
|
+
const se_PromptConfiguration = (input, context) => {
|
|
994
|
+
return take(input, {
|
|
995
|
+
basePromptTemplate: [],
|
|
996
|
+
inferenceConfiguration: (_) => se_InferenceConfiguration(_, context),
|
|
997
|
+
parserMode: [],
|
|
998
|
+
promptCreationMode: [],
|
|
999
|
+
promptState: [],
|
|
1000
|
+
promptType: [],
|
|
1001
|
+
});
|
|
1002
|
+
};
|
|
1003
|
+
const se_PromptConfigurations = (input, context) => {
|
|
1004
|
+
return input
|
|
1005
|
+
.filter((e) => e != null)
|
|
1006
|
+
.map((entry) => {
|
|
1007
|
+
return se_PromptConfiguration(entry, context);
|
|
1008
|
+
});
|
|
1009
|
+
};
|
|
1010
|
+
const se_PromptOverrideConfiguration = (input, context) => {
|
|
1011
|
+
return take(input, {
|
|
1012
|
+
overrideLambda: [],
|
|
1013
|
+
promptConfigurations: (_) => se_PromptConfigurations(_, context),
|
|
1014
|
+
});
|
|
1015
|
+
};
|
|
829
1016
|
const se_RetrievalFilter = (input, context) => {
|
|
830
1017
|
return RetrievalFilter.visit(input, {
|
|
831
1018
|
andAll: (value) => ({ andAll: se_RetrievalFilterList(value, context) }),
|
|
@@ -1015,6 +1202,23 @@ const de_InferenceConfiguration = (output, context) => {
|
|
|
1015
1202
|
topP: __limitedParseFloat32,
|
|
1016
1203
|
});
|
|
1017
1204
|
};
|
|
1205
|
+
const de_InlineAgentFilePart = (output, context) => {
|
|
1206
|
+
return take(output, {
|
|
1207
|
+
files: (_) => de_OutputFiles(_, context),
|
|
1208
|
+
});
|
|
1209
|
+
};
|
|
1210
|
+
const de_InlineAgentPayloadPart = (output, context) => {
|
|
1211
|
+
return take(output, {
|
|
1212
|
+
attribution: (_) => de_Attribution(_, context),
|
|
1213
|
+
bytes: context.base64Decoder,
|
|
1214
|
+
});
|
|
1215
|
+
};
|
|
1216
|
+
const de_InlineAgentTracePart = (output, context) => {
|
|
1217
|
+
return take(output, {
|
|
1218
|
+
sessionId: __expectString,
|
|
1219
|
+
trace: (_) => de_Trace(__expectUnion(_), context),
|
|
1220
|
+
});
|
|
1221
|
+
};
|
|
1018
1222
|
const de_KnowledgeBaseLookupOutput = (output, context) => {
|
|
1019
1223
|
return take(output, {
|
|
1020
1224
|
retrievedReferences: (_) => de_RetrievedReferences(_, context),
|
|
@@ -4,6 +4,7 @@ import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from ".
|
|
|
4
4
|
import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "./commands/GetAgentMemoryCommand";
|
|
5
5
|
import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand";
|
|
6
6
|
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
|
|
7
|
+
import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "./commands/InvokeInlineAgentCommand";
|
|
7
8
|
import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "./commands/OptimizePromptCommand";
|
|
8
9
|
import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput } from "./commands/RetrieveAndGenerateCommand";
|
|
9
10
|
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
|
|
@@ -32,6 +33,12 @@ export interface BedrockAgentRuntime {
|
|
|
32
33
|
invokeFlow(args: InvokeFlowCommandInput, options?: __HttpHandlerOptions): Promise<InvokeFlowCommandOutput>;
|
|
33
34
|
invokeFlow(args: InvokeFlowCommandInput, cb: (err: any, data?: InvokeFlowCommandOutput) => void): void;
|
|
34
35
|
invokeFlow(args: InvokeFlowCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: InvokeFlowCommandOutput) => void): void;
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link InvokeInlineAgentCommand}
|
|
38
|
+
*/
|
|
39
|
+
invokeInlineAgent(args: InvokeInlineAgentCommandInput, options?: __HttpHandlerOptions): Promise<InvokeInlineAgentCommandOutput>;
|
|
40
|
+
invokeInlineAgent(args: InvokeInlineAgentCommandInput, cb: (err: any, data?: InvokeInlineAgentCommandOutput) => void): void;
|
|
41
|
+
invokeInlineAgent(args: InvokeInlineAgentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: InvokeInlineAgentCommandOutput) => void): void;
|
|
35
42
|
/**
|
|
36
43
|
* @see {@link OptimizePromptCommand}
|
|
37
44
|
*/
|
|
@@ -12,6 +12,7 @@ import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from ".
|
|
|
12
12
|
import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "./commands/GetAgentMemoryCommand";
|
|
13
13
|
import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand";
|
|
14
14
|
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
|
|
15
|
+
import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "./commands/InvokeInlineAgentCommand";
|
|
15
16
|
import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "./commands/OptimizePromptCommand";
|
|
16
17
|
import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput } from "./commands/RetrieveAndGenerateCommand";
|
|
17
18
|
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
|
|
@@ -21,11 +22,11 @@ export { __Client };
|
|
|
21
22
|
/**
|
|
22
23
|
* @public
|
|
23
24
|
*/
|
|
24
|
-
export type ServiceInputTypes = DeleteAgentMemoryCommandInput | GetAgentMemoryCommandInput | InvokeAgentCommandInput | InvokeFlowCommandInput | OptimizePromptCommandInput | RetrieveAndGenerateCommandInput | RetrieveCommandInput;
|
|
25
|
+
export type ServiceInputTypes = DeleteAgentMemoryCommandInput | GetAgentMemoryCommandInput | InvokeAgentCommandInput | InvokeFlowCommandInput | InvokeInlineAgentCommandInput | OptimizePromptCommandInput | RetrieveAndGenerateCommandInput | RetrieveCommandInput;
|
|
25
26
|
/**
|
|
26
27
|
* @public
|
|
27
28
|
*/
|
|
28
|
-
export type ServiceOutputTypes = DeleteAgentMemoryCommandOutput | GetAgentMemoryCommandOutput | InvokeAgentCommandOutput | InvokeFlowCommandOutput | OptimizePromptCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveCommandOutput;
|
|
29
|
+
export type ServiceOutputTypes = DeleteAgentMemoryCommandOutput | GetAgentMemoryCommandOutput | InvokeAgentCommandOutput | InvokeFlowCommandOutput | InvokeInlineAgentCommandOutput | OptimizePromptCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveCommandOutput;
|
|
29
30
|
/**
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
@@ -242,10 +242,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
242
242
|
* // },
|
|
243
243
|
* // },
|
|
244
244
|
* // trace: { // TracePart
|
|
245
|
-
* // agentId: "STRING_VALUE",
|
|
246
|
-
* // agentAliasId: "STRING_VALUE",
|
|
247
245
|
* // sessionId: "STRING_VALUE",
|
|
248
|
-
* // agentVersion: "STRING_VALUE",
|
|
249
246
|
* // trace: { // Trace Union: only one key present
|
|
250
247
|
* // guardrailTrace: { // GuardrailTrace
|
|
251
248
|
* // action: "INTERVENED" || "NONE",
|
|
@@ -363,7 +360,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
363
360
|
* // modelInvocationInput: { // ModelInvocationInput
|
|
364
361
|
* // traceId: "STRING_VALUE",
|
|
365
362
|
* // text: "STRING_VALUE",
|
|
366
|
-
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
|
|
363
|
+
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING" || "ROUTING_CLASSIFIER",
|
|
367
364
|
* // overrideLambda: "STRING_VALUE",
|
|
368
365
|
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
|
|
369
366
|
* // inferenceConfiguration: { // InferenceConfiguration
|
|
@@ -494,7 +491,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
494
491
|
* // modelInvocationInput: {
|
|
495
492
|
* // traceId: "STRING_VALUE",
|
|
496
493
|
* // text: "STRING_VALUE",
|
|
497
|
-
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
|
|
494
|
+
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING" || "ROUTING_CLASSIFIER",
|
|
498
495
|
* // overrideLambda: "STRING_VALUE",
|
|
499
496
|
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
|
|
500
497
|
* // inferenceConfiguration: {
|
|
@@ -525,7 +522,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
525
522
|
* // modelInvocationInput: {
|
|
526
523
|
* // traceId: "STRING_VALUE",
|
|
527
524
|
* // text: "STRING_VALUE",
|
|
528
|
-
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
|
|
525
|
+
* // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING" || "ROUTING_CLASSIFIER",
|
|
529
526
|
* // overrideLambda: "STRING_VALUE",
|
|
530
527
|
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
|
|
531
528
|
* // inferenceConfiguration: {
|
|
@@ -560,6 +557,9 @@ declare const InvokeAgentCommand_base: {
|
|
|
560
557
|
* // failureReason: "STRING_VALUE",
|
|
561
558
|
* // },
|
|
562
559
|
* // },
|
|
560
|
+
* // agentId: "STRING_VALUE",
|
|
561
|
+
* // agentAliasId: "STRING_VALUE",
|
|
562
|
+
* // agentVersion: "STRING_VALUE",
|
|
563
563
|
* // },
|
|
564
564
|
* // returnControl: { // ReturnControlPayload
|
|
565
565
|
* // invocationInputs: [ // InvocationInputs
|