@aws-sdk/client-bedrock-agent-runtime 3.699.0 → 3.703.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 +16 -0
- package/dist-cjs/index.js +552 -4
- package/dist-es/BedrockAgentRuntime.js +4 -0
- package/dist-es/commands/RerankCommand.js +23 -0
- package/dist-es/commands/RetrieveAndGenerateStreamCommand.js +27 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +191 -0
- package/dist-es/pagination/RerankPaginator.js +4 -0
- package/dist-es/pagination/index.js +1 -0
- package/dist-es/protocols/Aws_restJson1.js +237 -0
- package/dist-types/BedrockAgentRuntime.d.ts +14 -0
- package/dist-types/BedrockAgentRuntimeClient.d.ts +4 -2
- package/dist-types/commands/InvokeAgentCommand.d.ts +55 -2
- package/dist-types/commands/InvokeInlineAgentCommand.d.ts +51 -2
- package/dist-types/commands/RerankCommand.d.ts +143 -0
- package/dist-types/commands/RetrieveAndGenerateCommand.d.ts +42 -2
- package/dist-types/commands/RetrieveAndGenerateStreamCommand.d.ts +371 -0
- package/dist-types/commands/RetrieveCommand.d.ts +46 -1
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +1093 -125
- package/dist-types/pagination/RerankPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +1 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/dist-types/ts3.4/BedrockAgentRuntime.d.ts +34 -0
- package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +12 -0
- package/dist-types/ts3.4/commands/RerankCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/RetrieveAndGenerateStreamCommand.d.ts +51 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +490 -0
- package/dist-types/ts3.4/pagination/RerankPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ export const se_InvokeAgentCommand = async (input, context) => {
|
|
|
48
48
|
inputText: [],
|
|
49
49
|
memoryId: [],
|
|
50
50
|
sessionState: (_) => se_SessionState(_, context),
|
|
51
|
+
streamingConfigurations: (_) => _json(_),
|
|
51
52
|
}));
|
|
52
53
|
b.m("POST").h(headers).b(body);
|
|
53
54
|
return b.build();
|
|
@@ -107,6 +108,22 @@ export const se_OptimizePromptCommand = async (input, context) => {
|
|
|
107
108
|
b.m("POST").h(headers).b(body);
|
|
108
109
|
return b.build();
|
|
109
110
|
};
|
|
111
|
+
export const se_RerankCommand = async (input, context) => {
|
|
112
|
+
const b = rb(input, context);
|
|
113
|
+
const headers = {
|
|
114
|
+
"content-type": "application/json",
|
|
115
|
+
};
|
|
116
|
+
b.bp("/rerank");
|
|
117
|
+
let body;
|
|
118
|
+
body = JSON.stringify(take(input, {
|
|
119
|
+
nextToken: [],
|
|
120
|
+
queries: (_) => _json(_),
|
|
121
|
+
rerankingConfiguration: (_) => se_RerankingConfiguration(_, context),
|
|
122
|
+
sources: (_) => se_RerankSourcesList(_, context),
|
|
123
|
+
}));
|
|
124
|
+
b.m("POST").h(headers).b(body);
|
|
125
|
+
return b.build();
|
|
126
|
+
};
|
|
110
127
|
export const se_RetrieveCommand = async (input, context) => {
|
|
111
128
|
const b = rb(input, context);
|
|
112
129
|
const headers = {
|
|
@@ -116,6 +133,7 @@ export const se_RetrieveCommand = async (input, context) => {
|
|
|
116
133
|
b.p("knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
117
134
|
let body;
|
|
118
135
|
body = JSON.stringify(take(input, {
|
|
136
|
+
guardrailConfiguration: (_) => _json(_),
|
|
119
137
|
nextToken: [],
|
|
120
138
|
retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
|
|
121
139
|
retrievalQuery: (_) => _json(_),
|
|
@@ -139,6 +157,22 @@ export const se_RetrieveAndGenerateCommand = async (input, context) => {
|
|
|
139
157
|
b.m("POST").h(headers).b(body);
|
|
140
158
|
return b.build();
|
|
141
159
|
};
|
|
160
|
+
export const se_RetrieveAndGenerateStreamCommand = async (input, context) => {
|
|
161
|
+
const b = rb(input, context);
|
|
162
|
+
const headers = {
|
|
163
|
+
"content-type": "application/json",
|
|
164
|
+
};
|
|
165
|
+
b.bp("/retrieveAndGenerateStream");
|
|
166
|
+
let body;
|
|
167
|
+
body = JSON.stringify(take(input, {
|
|
168
|
+
input: (_) => _json(_),
|
|
169
|
+
retrieveAndGenerateConfiguration: (_) => se_RetrieveAndGenerateConfiguration(_, context),
|
|
170
|
+
sessionConfiguration: (_) => _json(_),
|
|
171
|
+
sessionId: [],
|
|
172
|
+
}));
|
|
173
|
+
b.m("POST").h(headers).b(body);
|
|
174
|
+
return b.build();
|
|
175
|
+
};
|
|
142
176
|
export const de_DeleteAgentMemoryCommand = async (output, context) => {
|
|
143
177
|
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
144
178
|
return de_CommandError(output, context);
|
|
@@ -213,6 +247,21 @@ export const de_OptimizePromptCommand = async (output, context) => {
|
|
|
213
247
|
contents.optimizedPrompt = de_OptimizedPromptStream(data, context);
|
|
214
248
|
return contents;
|
|
215
249
|
};
|
|
250
|
+
export const de_RerankCommand = async (output, context) => {
|
|
251
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
252
|
+
return de_CommandError(output, context);
|
|
253
|
+
}
|
|
254
|
+
const contents = map({
|
|
255
|
+
$metadata: deserializeMetadata(output),
|
|
256
|
+
});
|
|
257
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
258
|
+
const doc = take(data, {
|
|
259
|
+
nextToken: __expectString,
|
|
260
|
+
results: (_) => de_RerankResultsList(_, context),
|
|
261
|
+
});
|
|
262
|
+
Object.assign(contents, doc);
|
|
263
|
+
return contents;
|
|
264
|
+
};
|
|
216
265
|
export const de_RetrieveCommand = async (output, context) => {
|
|
217
266
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
218
267
|
return de_CommandError(output, context);
|
|
@@ -222,6 +271,7 @@ export const de_RetrieveCommand = async (output, context) => {
|
|
|
222
271
|
});
|
|
223
272
|
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
224
273
|
const doc = take(data, {
|
|
274
|
+
guardrailAction: __expectString,
|
|
225
275
|
nextToken: __expectString,
|
|
226
276
|
retrievalResults: (_) => de_KnowledgeBaseRetrievalResults(_, context),
|
|
227
277
|
});
|
|
@@ -245,6 +295,18 @@ export const de_RetrieveAndGenerateCommand = async (output, context) => {
|
|
|
245
295
|
Object.assign(contents, doc);
|
|
246
296
|
return contents;
|
|
247
297
|
};
|
|
298
|
+
export const de_RetrieveAndGenerateStreamCommand = async (output, context) => {
|
|
299
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
300
|
+
return de_CommandError(output, context);
|
|
301
|
+
}
|
|
302
|
+
const contents = map({
|
|
303
|
+
$metadata: deserializeMetadata(output),
|
|
304
|
+
[_sI]: [, output.headers[_xabkbsi]],
|
|
305
|
+
});
|
|
306
|
+
const data = output.body;
|
|
307
|
+
contents.stream = de_RetrieveAndGenerateStreamResponseOutput(data, context);
|
|
308
|
+
return contents;
|
|
309
|
+
};
|
|
248
310
|
const de_CommandError = async (output, context) => {
|
|
249
311
|
const parsedOutput = {
|
|
250
312
|
...output,
|
|
@@ -658,6 +720,71 @@ const de_ResponseStream = (output, context) => {
|
|
|
658
720
|
return { $unknown: output };
|
|
659
721
|
});
|
|
660
722
|
};
|
|
723
|
+
const de_RetrieveAndGenerateStreamResponseOutput = (output, context) => {
|
|
724
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
725
|
+
if (event["output"] != null) {
|
|
726
|
+
return {
|
|
727
|
+
output: await de_RetrieveAndGenerateOutputEvent_event(event["output"], context),
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
if (event["citation"] != null) {
|
|
731
|
+
return {
|
|
732
|
+
citation: await de_CitationEvent_event(event["citation"], context),
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
if (event["guardrail"] != null) {
|
|
736
|
+
return {
|
|
737
|
+
guardrail: await de_GuardrailEvent_event(event["guardrail"], context),
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
if (event["internalServerException"] != null) {
|
|
741
|
+
return {
|
|
742
|
+
internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
if (event["validationException"] != null) {
|
|
746
|
+
return {
|
|
747
|
+
validationException: await de_ValidationException_event(event["validationException"], context),
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
if (event["resourceNotFoundException"] != null) {
|
|
751
|
+
return {
|
|
752
|
+
resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
if (event["serviceQuotaExceededException"] != null) {
|
|
756
|
+
return {
|
|
757
|
+
serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
if (event["throttlingException"] != null) {
|
|
761
|
+
return {
|
|
762
|
+
throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
if (event["accessDeniedException"] != null) {
|
|
766
|
+
return {
|
|
767
|
+
accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
if (event["conflictException"] != null) {
|
|
771
|
+
return {
|
|
772
|
+
conflictException: await de_ConflictException_event(event["conflictException"], context),
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
if (event["dependencyFailedException"] != null) {
|
|
776
|
+
return {
|
|
777
|
+
dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
if (event["badGatewayException"] != null) {
|
|
781
|
+
return {
|
|
782
|
+
badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
return { $unknown: output };
|
|
786
|
+
});
|
|
787
|
+
};
|
|
661
788
|
const de_AccessDeniedException_event = async (output, context) => {
|
|
662
789
|
const parsedOutput = {
|
|
663
790
|
...output,
|
|
@@ -678,6 +805,12 @@ const de_BadGatewayException_event = async (output, context) => {
|
|
|
678
805
|
};
|
|
679
806
|
return de_BadGatewayExceptionRes(parsedOutput, context);
|
|
680
807
|
};
|
|
808
|
+
const de_CitationEvent_event = async (output, context) => {
|
|
809
|
+
const contents = {};
|
|
810
|
+
const data = await parseBody(output.body, context);
|
|
811
|
+
Object.assign(contents, de_CitationEvent(data, context));
|
|
812
|
+
return contents;
|
|
813
|
+
};
|
|
681
814
|
const de_ConflictException_event = async (output, context) => {
|
|
682
815
|
const parsedOutput = {
|
|
683
816
|
...output,
|
|
@@ -716,6 +849,12 @@ const de_FlowTraceEvent_event = async (output, context) => {
|
|
|
716
849
|
Object.assign(contents, de_FlowTraceEvent(data, context));
|
|
717
850
|
return contents;
|
|
718
851
|
};
|
|
852
|
+
const de_GuardrailEvent_event = async (output, context) => {
|
|
853
|
+
const contents = {};
|
|
854
|
+
const data = await parseBody(output.body, context);
|
|
855
|
+
Object.assign(contents, _json(data));
|
|
856
|
+
return contents;
|
|
857
|
+
};
|
|
719
858
|
const de_InlineAgentFilePart_event = async (output, context) => {
|
|
720
859
|
const contents = {};
|
|
721
860
|
const data = await parseBody(output.body, context);
|
|
@@ -766,6 +905,12 @@ const de_ResourceNotFoundException_event = async (output, context) => {
|
|
|
766
905
|
};
|
|
767
906
|
return de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
768
907
|
};
|
|
908
|
+
const de_RetrieveAndGenerateOutputEvent_event = async (output, context) => {
|
|
909
|
+
const contents = {};
|
|
910
|
+
const data = await parseBody(output.body, context);
|
|
911
|
+
Object.assign(contents, _json(data));
|
|
912
|
+
return contents;
|
|
913
|
+
};
|
|
769
914
|
const de_ReturnControlPayload_event = async (output, context) => {
|
|
770
915
|
const contents = {};
|
|
771
916
|
const data = await parseBody(output.body, context);
|
|
@@ -811,6 +956,18 @@ const se_AdditionalModelRequestFields = (input, context) => {
|
|
|
811
956
|
const se_AdditionalModelRequestFieldsValue = (input, context) => {
|
|
812
957
|
return input;
|
|
813
958
|
};
|
|
959
|
+
const se_BedrockRerankingConfiguration = (input, context) => {
|
|
960
|
+
return take(input, {
|
|
961
|
+
modelConfiguration: (_) => se_BedrockRerankingModelConfiguration(_, context),
|
|
962
|
+
numberOfResults: [],
|
|
963
|
+
});
|
|
964
|
+
};
|
|
965
|
+
const se_BedrockRerankingModelConfiguration = (input, context) => {
|
|
966
|
+
return take(input, {
|
|
967
|
+
additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
|
|
968
|
+
modelArn: [],
|
|
969
|
+
});
|
|
970
|
+
};
|
|
814
971
|
const se_ByteContentDoc = (input, context) => {
|
|
815
972
|
return take(input, {
|
|
816
973
|
contentType: [],
|
|
@@ -978,8 +1135,10 @@ const se_KnowledgeBases = (input, context) => {
|
|
|
978
1135
|
const se_KnowledgeBaseVectorSearchConfiguration = (input, context) => {
|
|
979
1136
|
return take(input, {
|
|
980
1137
|
filter: (_) => se_RetrievalFilter(_, context),
|
|
1138
|
+
implicitFilterConfiguration: _json,
|
|
981
1139
|
numberOfResults: [],
|
|
982
1140
|
overrideSearchType: [],
|
|
1141
|
+
rerankingConfiguration: (_) => se_VectorSearchRerankingConfiguration(_, context),
|
|
983
1142
|
});
|
|
984
1143
|
};
|
|
985
1144
|
const se_OrchestrationConfiguration = (input, context) => {
|
|
@@ -1013,6 +1172,32 @@ const se_PromptOverrideConfiguration = (input, context) => {
|
|
|
1013
1172
|
promptConfigurations: (_) => se_PromptConfigurations(_, context),
|
|
1014
1173
|
});
|
|
1015
1174
|
};
|
|
1175
|
+
const se_RerankDocument = (input, context) => {
|
|
1176
|
+
return take(input, {
|
|
1177
|
+
jsonDocument: (_) => se_Document(_, context),
|
|
1178
|
+
textDocument: _json,
|
|
1179
|
+
type: [],
|
|
1180
|
+
});
|
|
1181
|
+
};
|
|
1182
|
+
const se_RerankingConfiguration = (input, context) => {
|
|
1183
|
+
return take(input, {
|
|
1184
|
+
bedrockRerankingConfiguration: (_) => se_BedrockRerankingConfiguration(_, context),
|
|
1185
|
+
type: [],
|
|
1186
|
+
});
|
|
1187
|
+
};
|
|
1188
|
+
const se_RerankSource = (input, context) => {
|
|
1189
|
+
return take(input, {
|
|
1190
|
+
inlineDocumentSource: (_) => se_RerankDocument(_, context),
|
|
1191
|
+
type: [],
|
|
1192
|
+
});
|
|
1193
|
+
};
|
|
1194
|
+
const se_RerankSourcesList = (input, context) => {
|
|
1195
|
+
return input
|
|
1196
|
+
.filter((e) => e != null)
|
|
1197
|
+
.map((entry) => {
|
|
1198
|
+
return se_RerankSource(entry, context);
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1016
1201
|
const se_RetrievalFilter = (input, context) => {
|
|
1017
1202
|
return RetrievalFilter.visit(input, {
|
|
1018
1203
|
andAll: (value) => ({ andAll: se_RetrievalFilterList(value, context) }),
|
|
@@ -1063,6 +1248,25 @@ const se_TextInferenceConfig = (input, context) => {
|
|
|
1063
1248
|
topP: __serializeFloat,
|
|
1064
1249
|
});
|
|
1065
1250
|
};
|
|
1251
|
+
const se_VectorSearchBedrockRerankingConfiguration = (input, context) => {
|
|
1252
|
+
return take(input, {
|
|
1253
|
+
metadataConfiguration: _json,
|
|
1254
|
+
modelConfiguration: (_) => se_VectorSearchBedrockRerankingModelConfiguration(_, context),
|
|
1255
|
+
numberOfRerankedResults: [],
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
const se_VectorSearchBedrockRerankingModelConfiguration = (input, context) => {
|
|
1259
|
+
return take(input, {
|
|
1260
|
+
additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
|
|
1261
|
+
modelArn: [],
|
|
1262
|
+
});
|
|
1263
|
+
};
|
|
1264
|
+
const se_VectorSearchRerankingConfiguration = (input, context) => {
|
|
1265
|
+
return take(input, {
|
|
1266
|
+
bedrockRerankingConfiguration: (_) => se_VectorSearchBedrockRerankingConfiguration(_, context),
|
|
1267
|
+
type: [],
|
|
1268
|
+
});
|
|
1269
|
+
};
|
|
1066
1270
|
const se_Document = (input, context) => {
|
|
1067
1271
|
return input;
|
|
1068
1272
|
};
|
|
@@ -1077,6 +1281,11 @@ const de_Citation = (output, context) => {
|
|
|
1077
1281
|
retrievedReferences: (_) => de_RetrievedReferences(_, context),
|
|
1078
1282
|
});
|
|
1079
1283
|
};
|
|
1284
|
+
const de_CitationEvent = (output, context) => {
|
|
1285
|
+
return take(output, {
|
|
1286
|
+
citation: (_) => de_Citation(_, context),
|
|
1287
|
+
});
|
|
1288
|
+
};
|
|
1080
1289
|
const de_Citations = (output, context) => {
|
|
1081
1290
|
const retVal = (output || [])
|
|
1082
1291
|
.filter((e) => e != null)
|
|
@@ -1362,6 +1571,28 @@ const de_PreProcessingTrace = (output, context) => {
|
|
|
1362
1571
|
}
|
|
1363
1572
|
return { $unknown: Object.entries(output)[0] };
|
|
1364
1573
|
};
|
|
1574
|
+
const de_RerankDocument = (output, context) => {
|
|
1575
|
+
return take(output, {
|
|
1576
|
+
jsonDocument: (_) => de_Document(_, context),
|
|
1577
|
+
textDocument: _json,
|
|
1578
|
+
type: __expectString,
|
|
1579
|
+
});
|
|
1580
|
+
};
|
|
1581
|
+
const de_RerankResult = (output, context) => {
|
|
1582
|
+
return take(output, {
|
|
1583
|
+
document: (_) => de_RerankDocument(_, context),
|
|
1584
|
+
index: __expectInt32,
|
|
1585
|
+
relevanceScore: __limitedParseFloat32,
|
|
1586
|
+
});
|
|
1587
|
+
};
|
|
1588
|
+
const de_RerankResultsList = (output, context) => {
|
|
1589
|
+
const retVal = (output || [])
|
|
1590
|
+
.filter((e) => e != null)
|
|
1591
|
+
.map((entry) => {
|
|
1592
|
+
return de_RerankResult(entry, context);
|
|
1593
|
+
});
|
|
1594
|
+
return retVal;
|
|
1595
|
+
};
|
|
1365
1596
|
const de_RetrievalResultMetadata = (output, context) => {
|
|
1366
1597
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1367
1598
|
if (value === null) {
|
|
@@ -1390,6 +1621,11 @@ const de_RetrievedReferences = (output, context) => {
|
|
|
1390
1621
|
return retVal;
|
|
1391
1622
|
};
|
|
1392
1623
|
const de_Trace = (output, context) => {
|
|
1624
|
+
if (output.customOrchestrationTrace != null) {
|
|
1625
|
+
return {
|
|
1626
|
+
customOrchestrationTrace: _json(output.customOrchestrationTrace),
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1393
1629
|
if (output.failureTrace != null) {
|
|
1394
1630
|
return {
|
|
1395
1631
|
failureTrace: _json(output.failureTrace),
|
|
@@ -1445,3 +1681,4 @@ const _sI = "sessionId";
|
|
|
1445
1681
|
const _xabact = "x-amzn-bedrock-agent-content-type";
|
|
1446
1682
|
const _xabami = "x-amz-bedrock-agent-memory-id";
|
|
1447
1683
|
const _xabasi = "x-amz-bedrock-agent-session-id";
|
|
1684
|
+
const _xabkbsi = "x-amzn-bedrock-knowledge-base-session-id";
|
|
@@ -6,7 +6,9 @@ import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/In
|
|
|
6
6
|
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
|
|
7
7
|
import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "./commands/InvokeInlineAgentCommand";
|
|
8
8
|
import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "./commands/OptimizePromptCommand";
|
|
9
|
+
import { RerankCommandInput, RerankCommandOutput } from "./commands/RerankCommand";
|
|
9
10
|
import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput } from "./commands/RetrieveAndGenerateCommand";
|
|
11
|
+
import { RetrieveAndGenerateStreamCommandInput, RetrieveAndGenerateStreamCommandOutput } from "./commands/RetrieveAndGenerateStreamCommand";
|
|
10
12
|
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
|
|
11
13
|
export interface BedrockAgentRuntime {
|
|
12
14
|
/**
|
|
@@ -45,6 +47,12 @@ export interface BedrockAgentRuntime {
|
|
|
45
47
|
optimizePrompt(args: OptimizePromptCommandInput, options?: __HttpHandlerOptions): Promise<OptimizePromptCommandOutput>;
|
|
46
48
|
optimizePrompt(args: OptimizePromptCommandInput, cb: (err: any, data?: OptimizePromptCommandOutput) => void): void;
|
|
47
49
|
optimizePrompt(args: OptimizePromptCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: OptimizePromptCommandOutput) => void): void;
|
|
50
|
+
/**
|
|
51
|
+
* @see {@link RerankCommand}
|
|
52
|
+
*/
|
|
53
|
+
rerank(args: RerankCommandInput, options?: __HttpHandlerOptions): Promise<RerankCommandOutput>;
|
|
54
|
+
rerank(args: RerankCommandInput, cb: (err: any, data?: RerankCommandOutput) => void): void;
|
|
55
|
+
rerank(args: RerankCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RerankCommandOutput) => void): void;
|
|
48
56
|
/**
|
|
49
57
|
* @see {@link RetrieveCommand}
|
|
50
58
|
*/
|
|
@@ -57,6 +65,12 @@ export interface BedrockAgentRuntime {
|
|
|
57
65
|
retrieveAndGenerate(args: RetrieveAndGenerateCommandInput, options?: __HttpHandlerOptions): Promise<RetrieveAndGenerateCommandOutput>;
|
|
58
66
|
retrieveAndGenerate(args: RetrieveAndGenerateCommandInput, cb: (err: any, data?: RetrieveAndGenerateCommandOutput) => void): void;
|
|
59
67
|
retrieveAndGenerate(args: RetrieveAndGenerateCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RetrieveAndGenerateCommandOutput) => void): void;
|
|
68
|
+
/**
|
|
69
|
+
* @see {@link RetrieveAndGenerateStreamCommand}
|
|
70
|
+
*/
|
|
71
|
+
retrieveAndGenerateStream(args: RetrieveAndGenerateStreamCommandInput, options?: __HttpHandlerOptions): Promise<RetrieveAndGenerateStreamCommandOutput>;
|
|
72
|
+
retrieveAndGenerateStream(args: RetrieveAndGenerateStreamCommandInput, cb: (err: any, data?: RetrieveAndGenerateStreamCommandOutput) => void): void;
|
|
73
|
+
retrieveAndGenerateStream(args: RetrieveAndGenerateStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RetrieveAndGenerateStreamCommandOutput) => void): void;
|
|
60
74
|
}
|
|
61
75
|
/**
|
|
62
76
|
* <p>Contains APIs related to model invocation and querying of knowledge bases.</p>
|
|
@@ -14,7 +14,9 @@ import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/In
|
|
|
14
14
|
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
|
|
15
15
|
import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "./commands/InvokeInlineAgentCommand";
|
|
16
16
|
import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "./commands/OptimizePromptCommand";
|
|
17
|
+
import { RerankCommandInput, RerankCommandOutput } from "./commands/RerankCommand";
|
|
17
18
|
import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput } from "./commands/RetrieveAndGenerateCommand";
|
|
19
|
+
import { RetrieveAndGenerateStreamCommandInput, RetrieveAndGenerateStreamCommandOutput } from "./commands/RetrieveAndGenerateStreamCommand";
|
|
18
20
|
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
|
|
19
21
|
import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
|
|
20
22
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
@@ -22,11 +24,11 @@ export { __Client };
|
|
|
22
24
|
/**
|
|
23
25
|
* @public
|
|
24
26
|
*/
|
|
25
|
-
export type ServiceInputTypes = DeleteAgentMemoryCommandInput | GetAgentMemoryCommandInput | InvokeAgentCommandInput | InvokeFlowCommandInput | InvokeInlineAgentCommandInput | OptimizePromptCommandInput | RetrieveAndGenerateCommandInput | RetrieveCommandInput;
|
|
27
|
+
export type ServiceInputTypes = DeleteAgentMemoryCommandInput | GetAgentMemoryCommandInput | InvokeAgentCommandInput | InvokeFlowCommandInput | InvokeInlineAgentCommandInput | OptimizePromptCommandInput | RerankCommandInput | RetrieveAndGenerateCommandInput | RetrieveAndGenerateStreamCommandInput | RetrieveCommandInput;
|
|
26
28
|
/**
|
|
27
29
|
* @public
|
|
28
30
|
*/
|
|
29
|
-
export type ServiceOutputTypes = DeleteAgentMemoryCommandOutput | GetAgentMemoryCommandOutput | InvokeAgentCommandOutput | InvokeFlowCommandOutput | InvokeInlineAgentCommandOutput | OptimizePromptCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveCommandOutput;
|
|
31
|
+
export type ServiceOutputTypes = DeleteAgentMemoryCommandOutput | GetAgentMemoryCommandOutput | InvokeAgentCommandOutput | InvokeFlowCommandOutput | InvokeInlineAgentCommandOutput | OptimizePromptCommandOutput | RerankCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveAndGenerateStreamCommandOutput | RetrieveCommandOutput;
|
|
30
32
|
/**
|
|
31
33
|
* @public
|
|
32
34
|
*/
|
|
@@ -178,6 +178,43 @@ declare const InvokeAgentCommand_base: {
|
|
|
178
178
|
* "<RetrievalFilter>",
|
|
179
179
|
* ],
|
|
180
180
|
* },
|
|
181
|
+
* rerankingConfiguration: { // VectorSearchRerankingConfiguration
|
|
182
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
183
|
+
* bedrockRerankingConfiguration: { // VectorSearchBedrockRerankingConfiguration
|
|
184
|
+
* modelConfiguration: { // VectorSearchBedrockRerankingModelConfiguration
|
|
185
|
+
* modelArn: "STRING_VALUE", // required
|
|
186
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
187
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
188
|
+
* },
|
|
189
|
+
* },
|
|
190
|
+
* numberOfRerankedResults: Number("int"),
|
|
191
|
+
* metadataConfiguration: { // MetadataConfigurationForReranking
|
|
192
|
+
* selectionMode: "SELECTIVE" || "ALL", // required
|
|
193
|
+
* selectiveModeConfiguration: { // RerankingMetadataSelectiveModeConfiguration Union: only one key present
|
|
194
|
+
* fieldsToInclude: [ // FieldsForReranking
|
|
195
|
+
* { // FieldForReranking
|
|
196
|
+
* fieldName: "STRING_VALUE", // required
|
|
197
|
+
* },
|
|
198
|
+
* ],
|
|
199
|
+
* fieldsToExclude: [
|
|
200
|
+
* {
|
|
201
|
+
* fieldName: "STRING_VALUE", // required
|
|
202
|
+
* },
|
|
203
|
+
* ],
|
|
204
|
+
* },
|
|
205
|
+
* },
|
|
206
|
+
* },
|
|
207
|
+
* },
|
|
208
|
+
* implicitFilterConfiguration: { // ImplicitFilterConfiguration
|
|
209
|
+
* metadataAttributes: [ // MetadataAttributeSchemaList // required
|
|
210
|
+
* { // MetadataAttributeSchema
|
|
211
|
+
* key: "STRING_VALUE", // required
|
|
212
|
+
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
|
|
213
|
+
* description: "STRING_VALUE", // required
|
|
214
|
+
* },
|
|
215
|
+
* ],
|
|
216
|
+
* modelArn: "STRING_VALUE", // required
|
|
217
|
+
* },
|
|
181
218
|
* },
|
|
182
219
|
* },
|
|
183
220
|
* },
|
|
@@ -190,6 +227,10 @@ declare const InvokeAgentCommand_base: {
|
|
|
190
227
|
* enableTrace: true || false,
|
|
191
228
|
* inputText: "STRING_VALUE",
|
|
192
229
|
* memoryId: "STRING_VALUE",
|
|
230
|
+
* streamingConfigurations: { // StreamingConfigurations
|
|
231
|
+
* streamFinalResponse: true || false,
|
|
232
|
+
* applyGuardrailInterval: Number("int"),
|
|
233
|
+
* },
|
|
193
234
|
* };
|
|
194
235
|
* const command = new InvokeAgentCommand(input);
|
|
195
236
|
* const response = await client.send(command);
|
|
@@ -215,7 +256,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
215
256
|
* // text: "STRING_VALUE", // required
|
|
216
257
|
* // },
|
|
217
258
|
* // location: { // RetrievalResultLocation
|
|
218
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
259
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
219
260
|
* // s3Location: { // RetrievalResultS3Location
|
|
220
261
|
* // uri: "STRING_VALUE",
|
|
221
262
|
* // },
|
|
@@ -231,6 +272,9 @@ declare const InvokeAgentCommand_base: {
|
|
|
231
272
|
* // sharePointLocation: { // RetrievalResultSharePointLocation
|
|
232
273
|
* // url: "STRING_VALUE",
|
|
233
274
|
* // },
|
|
275
|
+
* // customDocumentLocation: { // RetrievalResultCustomDocumentLocation
|
|
276
|
+
* // id: "STRING_VALUE",
|
|
277
|
+
* // },
|
|
234
278
|
* // },
|
|
235
279
|
* // metadata: { // RetrievalResultMetadata
|
|
236
280
|
* // "<keys>": "DOCUMENT_VALUE",
|
|
@@ -449,7 +493,7 @@ declare const InvokeAgentCommand_base: {
|
|
|
449
493
|
* // text: "STRING_VALUE", // required
|
|
450
494
|
* // },
|
|
451
495
|
* // location: {
|
|
452
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
496
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
453
497
|
* // s3Location: {
|
|
454
498
|
* // uri: "STRING_VALUE",
|
|
455
499
|
* // },
|
|
@@ -465,6 +509,9 @@ declare const InvokeAgentCommand_base: {
|
|
|
465
509
|
* // sharePointLocation: {
|
|
466
510
|
* // url: "STRING_VALUE",
|
|
467
511
|
* // },
|
|
512
|
+
* // customDocumentLocation: {
|
|
513
|
+
* // id: "STRING_VALUE",
|
|
514
|
+
* // },
|
|
468
515
|
* // },
|
|
469
516
|
* // metadata: {
|
|
470
517
|
* // "<keys>": "DOCUMENT_VALUE",
|
|
@@ -556,6 +603,12 @@ declare const InvokeAgentCommand_base: {
|
|
|
556
603
|
* // traceId: "STRING_VALUE",
|
|
557
604
|
* // failureReason: "STRING_VALUE",
|
|
558
605
|
* // },
|
|
606
|
+
* // customOrchestrationTrace: { // CustomOrchestrationTrace
|
|
607
|
+
* // traceId: "STRING_VALUE",
|
|
608
|
+
* // event: { // CustomOrchestrationTraceEvent
|
|
609
|
+
* // text: "STRING_VALUE",
|
|
610
|
+
* // },
|
|
611
|
+
* // },
|
|
559
612
|
* // },
|
|
560
613
|
* // agentId: "STRING_VALUE",
|
|
561
614
|
* // agentAliasId: "STRING_VALUE",
|
|
@@ -215,6 +215,43 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
215
215
|
* "<RetrievalFilter>",
|
|
216
216
|
* ],
|
|
217
217
|
* },
|
|
218
|
+
* rerankingConfiguration: { // VectorSearchRerankingConfiguration
|
|
219
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
220
|
+
* bedrockRerankingConfiguration: { // VectorSearchBedrockRerankingConfiguration
|
|
221
|
+
* modelConfiguration: { // VectorSearchBedrockRerankingModelConfiguration
|
|
222
|
+
* modelArn: "STRING_VALUE", // required
|
|
223
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
224
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
225
|
+
* },
|
|
226
|
+
* },
|
|
227
|
+
* numberOfRerankedResults: Number("int"),
|
|
228
|
+
* metadataConfiguration: { // MetadataConfigurationForReranking
|
|
229
|
+
* selectionMode: "SELECTIVE" || "ALL", // required
|
|
230
|
+
* selectiveModeConfiguration: { // RerankingMetadataSelectiveModeConfiguration Union: only one key present
|
|
231
|
+
* fieldsToInclude: [ // FieldsForReranking
|
|
232
|
+
* { // FieldForReranking
|
|
233
|
+
* fieldName: "STRING_VALUE", // required
|
|
234
|
+
* },
|
|
235
|
+
* ],
|
|
236
|
+
* fieldsToExclude: [
|
|
237
|
+
* {
|
|
238
|
+
* fieldName: "STRING_VALUE", // required
|
|
239
|
+
* },
|
|
240
|
+
* ],
|
|
241
|
+
* },
|
|
242
|
+
* },
|
|
243
|
+
* },
|
|
244
|
+
* },
|
|
245
|
+
* implicitFilterConfiguration: { // ImplicitFilterConfiguration
|
|
246
|
+
* metadataAttributes: [ // MetadataAttributeSchemaList // required
|
|
247
|
+
* { // MetadataAttributeSchema
|
|
248
|
+
* key: "STRING_VALUE", // required
|
|
249
|
+
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
|
|
250
|
+
* description: "STRING_VALUE", // required
|
|
251
|
+
* },
|
|
252
|
+
* ],
|
|
253
|
+
* modelArn: "STRING_VALUE", // required
|
|
254
|
+
* },
|
|
218
255
|
* },
|
|
219
256
|
* },
|
|
220
257
|
* },
|
|
@@ -269,7 +306,7 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
269
306
|
* // text: "STRING_VALUE", // required
|
|
270
307
|
* // },
|
|
271
308
|
* // location: { // RetrievalResultLocation
|
|
272
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
309
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
273
310
|
* // s3Location: { // RetrievalResultS3Location
|
|
274
311
|
* // uri: "STRING_VALUE",
|
|
275
312
|
* // },
|
|
@@ -285,6 +322,9 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
285
322
|
* // sharePointLocation: { // RetrievalResultSharePointLocation
|
|
286
323
|
* // url: "STRING_VALUE",
|
|
287
324
|
* // },
|
|
325
|
+
* // customDocumentLocation: { // RetrievalResultCustomDocumentLocation
|
|
326
|
+
* // id: "STRING_VALUE",
|
|
327
|
+
* // },
|
|
288
328
|
* // },
|
|
289
329
|
* // metadata: { // RetrievalResultMetadata
|
|
290
330
|
* // "<keys>": "DOCUMENT_VALUE",
|
|
@@ -503,7 +543,7 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
503
543
|
* // text: "STRING_VALUE", // required
|
|
504
544
|
* // },
|
|
505
545
|
* // location: {
|
|
506
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
546
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
507
547
|
* // s3Location: {
|
|
508
548
|
* // uri: "STRING_VALUE",
|
|
509
549
|
* // },
|
|
@@ -519,6 +559,9 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
519
559
|
* // sharePointLocation: {
|
|
520
560
|
* // url: "STRING_VALUE",
|
|
521
561
|
* // },
|
|
562
|
+
* // customDocumentLocation: {
|
|
563
|
+
* // id: "STRING_VALUE",
|
|
564
|
+
* // },
|
|
522
565
|
* // },
|
|
523
566
|
* // metadata: {
|
|
524
567
|
* // "<keys>": "DOCUMENT_VALUE",
|
|
@@ -610,6 +653,12 @@ declare const InvokeInlineAgentCommand_base: {
|
|
|
610
653
|
* // traceId: "STRING_VALUE",
|
|
611
654
|
* // failureReason: "STRING_VALUE",
|
|
612
655
|
* // },
|
|
656
|
+
* // customOrchestrationTrace: { // CustomOrchestrationTrace
|
|
657
|
+
* // traceId: "STRING_VALUE",
|
|
658
|
+
* // event: { // CustomOrchestrationTraceEvent
|
|
659
|
+
* // text: "STRING_VALUE",
|
|
660
|
+
* // },
|
|
661
|
+
* // },
|
|
613
662
|
* // },
|
|
614
663
|
* // },
|
|
615
664
|
* // returnControl: { // InlineAgentReturnControlPayload
|