@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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
|
|
4
|
+
import { RerankRequest, RerankResponse } from "../models/models_0";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link RerankCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface RerankCommandInput extends RerankRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link RerankCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface RerankCommandOutput extends RerankResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const RerankCommand_base: {
|
|
25
|
+
new (input: RerankCommandInput): import("@smithy/smithy-client").CommandImpl<RerankCommandInput, RerankCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: RerankCommandInput): import("@smithy/smithy-client").CommandImpl<RerankCommandInput, RerankCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* <p>Reranks the relevance of sources based on queries. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html">Improve the relevance of query responses with a reranker model</a>.</p>
|
|
31
|
+
* @example
|
|
32
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
33
|
+
* ```javascript
|
|
34
|
+
* import { BedrockAgentRuntimeClient, RerankCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
|
|
35
|
+
* // const { BedrockAgentRuntimeClient, RerankCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
|
|
36
|
+
* const client = new BedrockAgentRuntimeClient(config);
|
|
37
|
+
* const input = { // RerankRequest
|
|
38
|
+
* queries: [ // RerankQueriesList // required
|
|
39
|
+
* { // RerankQuery
|
|
40
|
+
* type: "TEXT", // required
|
|
41
|
+
* textQuery: { // RerankTextDocument
|
|
42
|
+
* text: "STRING_VALUE",
|
|
43
|
+
* },
|
|
44
|
+
* },
|
|
45
|
+
* ],
|
|
46
|
+
* sources: [ // RerankSourcesList // required
|
|
47
|
+
* { // RerankSource
|
|
48
|
+
* type: "INLINE", // required
|
|
49
|
+
* inlineDocumentSource: { // RerankDocument
|
|
50
|
+
* type: "TEXT" || "JSON", // required
|
|
51
|
+
* textDocument: {
|
|
52
|
+
* text: "STRING_VALUE",
|
|
53
|
+
* },
|
|
54
|
+
* jsonDocument: "DOCUMENT_VALUE",
|
|
55
|
+
* },
|
|
56
|
+
* },
|
|
57
|
+
* ],
|
|
58
|
+
* rerankingConfiguration: { // RerankingConfiguration
|
|
59
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
60
|
+
* bedrockRerankingConfiguration: { // BedrockRerankingConfiguration
|
|
61
|
+
* numberOfResults: Number("int"),
|
|
62
|
+
* modelConfiguration: { // BedrockRerankingModelConfiguration
|
|
63
|
+
* modelArn: "STRING_VALUE", // required
|
|
64
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
65
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
66
|
+
* },
|
|
67
|
+
* },
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* nextToken: "STRING_VALUE",
|
|
71
|
+
* };
|
|
72
|
+
* const command = new RerankCommand(input);
|
|
73
|
+
* const response = await client.send(command);
|
|
74
|
+
* // { // RerankResponse
|
|
75
|
+
* // results: [ // RerankResultsList // required
|
|
76
|
+
* // { // RerankResult
|
|
77
|
+
* // index: Number("int"), // required
|
|
78
|
+
* // relevanceScore: Number("float"), // required
|
|
79
|
+
* // document: { // RerankDocument
|
|
80
|
+
* // type: "TEXT" || "JSON", // required
|
|
81
|
+
* // textDocument: { // RerankTextDocument
|
|
82
|
+
* // text: "STRING_VALUE",
|
|
83
|
+
* // },
|
|
84
|
+
* // jsonDocument: "DOCUMENT_VALUE",
|
|
85
|
+
* // },
|
|
86
|
+
* // },
|
|
87
|
+
* // ],
|
|
88
|
+
* // nextToken: "STRING_VALUE",
|
|
89
|
+
* // };
|
|
90
|
+
*
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @param RerankCommandInput - {@link RerankCommandInput}
|
|
94
|
+
* @returns {@link RerankCommandOutput}
|
|
95
|
+
* @see {@link RerankCommandInput} for command's `input` shape.
|
|
96
|
+
* @see {@link RerankCommandOutput} for command's `response` shape.
|
|
97
|
+
* @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link AccessDeniedException} (client fault)
|
|
100
|
+
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
|
|
101
|
+
*
|
|
102
|
+
* @throws {@link BadGatewayException} (server fault)
|
|
103
|
+
* <p>There was an issue with a dependency due to a server issue. Retry your request.</p>
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link ConflictException} (client fault)
|
|
106
|
+
* <p>There was a conflict performing an operation. Resolve the conflict and retry your request.</p>
|
|
107
|
+
*
|
|
108
|
+
* @throws {@link DependencyFailedException} (client fault)
|
|
109
|
+
* <p>There was an issue with a dependency. Check the resource configurations and retry the request.</p>
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link InternalServerException} (server fault)
|
|
112
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
113
|
+
*
|
|
114
|
+
* @throws {@link ResourceNotFoundException} (client fault)
|
|
115
|
+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
|
|
116
|
+
*
|
|
117
|
+
* @throws {@link ServiceQuotaExceededException} (client fault)
|
|
118
|
+
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
119
|
+
*
|
|
120
|
+
* @throws {@link ThrottlingException} (client fault)
|
|
121
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
122
|
+
*
|
|
123
|
+
* @throws {@link ValidationException} (client fault)
|
|
124
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
125
|
+
*
|
|
126
|
+
* @throws {@link BedrockAgentRuntimeServiceException}
|
|
127
|
+
* <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export declare class RerankCommand extends RerankCommand_base {
|
|
132
|
+
/** @internal type navigation helper, not in runtime. */
|
|
133
|
+
protected static __types: {
|
|
134
|
+
api: {
|
|
135
|
+
input: RerankRequest;
|
|
136
|
+
output: RerankResponse;
|
|
137
|
+
};
|
|
138
|
+
sdk: {
|
|
139
|
+
input: RerankCommandInput;
|
|
140
|
+
output: RerankCommandOutput;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
}
|
|
@@ -100,6 +100,43 @@ declare const RetrieveAndGenerateCommand_base: {
|
|
|
100
100
|
* "<RetrievalFilter>",
|
|
101
101
|
* ],
|
|
102
102
|
* },
|
|
103
|
+
* rerankingConfiguration: { // VectorSearchRerankingConfiguration
|
|
104
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
105
|
+
* bedrockRerankingConfiguration: { // VectorSearchBedrockRerankingConfiguration
|
|
106
|
+
* modelConfiguration: { // VectorSearchBedrockRerankingModelConfiguration
|
|
107
|
+
* modelArn: "STRING_VALUE", // required
|
|
108
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
109
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
110
|
+
* },
|
|
111
|
+
* },
|
|
112
|
+
* numberOfRerankedResults: Number("int"),
|
|
113
|
+
* metadataConfiguration: { // MetadataConfigurationForReranking
|
|
114
|
+
* selectionMode: "SELECTIVE" || "ALL", // required
|
|
115
|
+
* selectiveModeConfiguration: { // RerankingMetadataSelectiveModeConfiguration Union: only one key present
|
|
116
|
+
* fieldsToInclude: [ // FieldsForReranking
|
|
117
|
+
* { // FieldForReranking
|
|
118
|
+
* fieldName: "STRING_VALUE", // required
|
|
119
|
+
* },
|
|
120
|
+
* ],
|
|
121
|
+
* fieldsToExclude: [
|
|
122
|
+
* {
|
|
123
|
+
* fieldName: "STRING_VALUE", // required
|
|
124
|
+
* },
|
|
125
|
+
* ],
|
|
126
|
+
* },
|
|
127
|
+
* },
|
|
128
|
+
* },
|
|
129
|
+
* },
|
|
130
|
+
* implicitFilterConfiguration: { // ImplicitFilterConfiguration
|
|
131
|
+
* metadataAttributes: [ // MetadataAttributeSchemaList // required
|
|
132
|
+
* { // MetadataAttributeSchema
|
|
133
|
+
* key: "STRING_VALUE", // required
|
|
134
|
+
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
|
|
135
|
+
* description: "STRING_VALUE", // required
|
|
136
|
+
* },
|
|
137
|
+
* ],
|
|
138
|
+
* modelArn: "STRING_VALUE", // required
|
|
139
|
+
* },
|
|
103
140
|
* },
|
|
104
141
|
* },
|
|
105
142
|
* generationConfiguration: { // GenerationConfiguration
|
|
@@ -120,7 +157,7 @@ declare const RetrieveAndGenerateCommand_base: {
|
|
|
120
157
|
* ],
|
|
121
158
|
* },
|
|
122
159
|
* },
|
|
123
|
-
* additionalModelRequestFields: {
|
|
160
|
+
* additionalModelRequestFields: {
|
|
124
161
|
* "<keys>": "DOCUMENT_VALUE",
|
|
125
162
|
* },
|
|
126
163
|
* },
|
|
@@ -213,7 +250,7 @@ declare const RetrieveAndGenerateCommand_base: {
|
|
|
213
250
|
* // text: "STRING_VALUE", // required
|
|
214
251
|
* // },
|
|
215
252
|
* // location: { // RetrievalResultLocation
|
|
216
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
253
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
217
254
|
* // s3Location: { // RetrievalResultS3Location
|
|
218
255
|
* // uri: "STRING_VALUE",
|
|
219
256
|
* // },
|
|
@@ -229,6 +266,9 @@ declare const RetrieveAndGenerateCommand_base: {
|
|
|
229
266
|
* // sharePointLocation: { // RetrievalResultSharePointLocation
|
|
230
267
|
* // url: "STRING_VALUE",
|
|
231
268
|
* // },
|
|
269
|
+
* // customDocumentLocation: { // RetrievalResultCustomDocumentLocation
|
|
270
|
+
* // id: "STRING_VALUE",
|
|
271
|
+
* // },
|
|
232
272
|
* // },
|
|
233
273
|
* // metadata: { // RetrievalResultMetadata
|
|
234
274
|
* // "<keys>": "DOCUMENT_VALUE",
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
|
|
4
|
+
import { RetrieveAndGenerateStreamRequest, RetrieveAndGenerateStreamResponse } from "../models/models_0";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link RetrieveAndGenerateStreamCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface RetrieveAndGenerateStreamCommandInput extends RetrieveAndGenerateStreamRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link RetrieveAndGenerateStreamCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGenerateStreamResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const RetrieveAndGenerateStreamCommand_base: {
|
|
25
|
+
new (input: RetrieveAndGenerateStreamCommandInput): import("@smithy/smithy-client").CommandImpl<RetrieveAndGenerateStreamCommandInput, RetrieveAndGenerateStreamCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: RetrieveAndGenerateStreamCommandInput): import("@smithy/smithy-client").CommandImpl<RetrieveAndGenerateStreamCommandInput, RetrieveAndGenerateStreamCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* <p>Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.</p>
|
|
31
|
+
* <note>
|
|
32
|
+
* <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p>
|
|
33
|
+
* </note>
|
|
34
|
+
* @example
|
|
35
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
36
|
+
* ```javascript
|
|
37
|
+
* import { BedrockAgentRuntimeClient, RetrieveAndGenerateStreamCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
|
|
38
|
+
* // const { BedrockAgentRuntimeClient, RetrieveAndGenerateStreamCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
|
|
39
|
+
* const client = new BedrockAgentRuntimeClient(config);
|
|
40
|
+
* const input = { // RetrieveAndGenerateStreamRequest
|
|
41
|
+
* sessionId: "STRING_VALUE",
|
|
42
|
+
* input: { // RetrieveAndGenerateInput
|
|
43
|
+
* text: "STRING_VALUE", // required
|
|
44
|
+
* },
|
|
45
|
+
* retrieveAndGenerateConfiguration: { // RetrieveAndGenerateConfiguration
|
|
46
|
+
* type: "KNOWLEDGE_BASE" || "EXTERNAL_SOURCES", // required
|
|
47
|
+
* knowledgeBaseConfiguration: { // KnowledgeBaseRetrieveAndGenerateConfiguration
|
|
48
|
+
* knowledgeBaseId: "STRING_VALUE", // required
|
|
49
|
+
* modelArn: "STRING_VALUE", // required
|
|
50
|
+
* retrievalConfiguration: { // KnowledgeBaseRetrievalConfiguration
|
|
51
|
+
* vectorSearchConfiguration: { // KnowledgeBaseVectorSearchConfiguration
|
|
52
|
+
* numberOfResults: Number("int"),
|
|
53
|
+
* overrideSearchType: "HYBRID" || "SEMANTIC",
|
|
54
|
+
* filter: { // RetrievalFilter Union: only one key present
|
|
55
|
+
* equals: { // FilterAttribute
|
|
56
|
+
* key: "STRING_VALUE", // required
|
|
57
|
+
* value: "DOCUMENT_VALUE", // required
|
|
58
|
+
* },
|
|
59
|
+
* notEquals: {
|
|
60
|
+
* key: "STRING_VALUE", // required
|
|
61
|
+
* value: "DOCUMENT_VALUE", // required
|
|
62
|
+
* },
|
|
63
|
+
* greaterThan: {
|
|
64
|
+
* key: "STRING_VALUE", // required
|
|
65
|
+
* value: "DOCUMENT_VALUE", // required
|
|
66
|
+
* },
|
|
67
|
+
* greaterThanOrEquals: {
|
|
68
|
+
* key: "STRING_VALUE", // required
|
|
69
|
+
* value: "DOCUMENT_VALUE", // required
|
|
70
|
+
* },
|
|
71
|
+
* lessThan: {
|
|
72
|
+
* key: "STRING_VALUE", // required
|
|
73
|
+
* value: "DOCUMENT_VALUE", // required
|
|
74
|
+
* },
|
|
75
|
+
* lessThanOrEquals: "<FilterAttribute>",
|
|
76
|
+
* in: "<FilterAttribute>",
|
|
77
|
+
* notIn: "<FilterAttribute>",
|
|
78
|
+
* startsWith: "<FilterAttribute>",
|
|
79
|
+
* listContains: "<FilterAttribute>",
|
|
80
|
+
* stringContains: "<FilterAttribute>",
|
|
81
|
+
* andAll: [ // RetrievalFilterList
|
|
82
|
+
* {// Union: only one key present
|
|
83
|
+
* equals: "<FilterAttribute>",
|
|
84
|
+
* notEquals: "<FilterAttribute>",
|
|
85
|
+
* greaterThan: "<FilterAttribute>",
|
|
86
|
+
* greaterThanOrEquals: "<FilterAttribute>",
|
|
87
|
+
* lessThan: "<FilterAttribute>",
|
|
88
|
+
* lessThanOrEquals: "<FilterAttribute>",
|
|
89
|
+
* in: "<FilterAttribute>",
|
|
90
|
+
* notIn: "<FilterAttribute>",
|
|
91
|
+
* startsWith: "<FilterAttribute>",
|
|
92
|
+
* listContains: "<FilterAttribute>",
|
|
93
|
+
* stringContains: "<FilterAttribute>",
|
|
94
|
+
* andAll: [
|
|
95
|
+
* "<RetrievalFilter>",
|
|
96
|
+
* ],
|
|
97
|
+
* orAll: [
|
|
98
|
+
* "<RetrievalFilter>",
|
|
99
|
+
* ],
|
|
100
|
+
* },
|
|
101
|
+
* ],
|
|
102
|
+
* orAll: [
|
|
103
|
+
* "<RetrievalFilter>",
|
|
104
|
+
* ],
|
|
105
|
+
* },
|
|
106
|
+
* rerankingConfiguration: { // VectorSearchRerankingConfiguration
|
|
107
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
108
|
+
* bedrockRerankingConfiguration: { // VectorSearchBedrockRerankingConfiguration
|
|
109
|
+
* modelConfiguration: { // VectorSearchBedrockRerankingModelConfiguration
|
|
110
|
+
* modelArn: "STRING_VALUE", // required
|
|
111
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
112
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
113
|
+
* },
|
|
114
|
+
* },
|
|
115
|
+
* numberOfRerankedResults: Number("int"),
|
|
116
|
+
* metadataConfiguration: { // MetadataConfigurationForReranking
|
|
117
|
+
* selectionMode: "SELECTIVE" || "ALL", // required
|
|
118
|
+
* selectiveModeConfiguration: { // RerankingMetadataSelectiveModeConfiguration Union: only one key present
|
|
119
|
+
* fieldsToInclude: [ // FieldsForReranking
|
|
120
|
+
* { // FieldForReranking
|
|
121
|
+
* fieldName: "STRING_VALUE", // required
|
|
122
|
+
* },
|
|
123
|
+
* ],
|
|
124
|
+
* fieldsToExclude: [
|
|
125
|
+
* {
|
|
126
|
+
* fieldName: "STRING_VALUE", // required
|
|
127
|
+
* },
|
|
128
|
+
* ],
|
|
129
|
+
* },
|
|
130
|
+
* },
|
|
131
|
+
* },
|
|
132
|
+
* },
|
|
133
|
+
* implicitFilterConfiguration: { // ImplicitFilterConfiguration
|
|
134
|
+
* metadataAttributes: [ // MetadataAttributeSchemaList // required
|
|
135
|
+
* { // MetadataAttributeSchema
|
|
136
|
+
* key: "STRING_VALUE", // required
|
|
137
|
+
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
|
|
138
|
+
* description: "STRING_VALUE", // required
|
|
139
|
+
* },
|
|
140
|
+
* ],
|
|
141
|
+
* modelArn: "STRING_VALUE", // required
|
|
142
|
+
* },
|
|
143
|
+
* },
|
|
144
|
+
* },
|
|
145
|
+
* generationConfiguration: { // GenerationConfiguration
|
|
146
|
+
* promptTemplate: { // PromptTemplate
|
|
147
|
+
* textPromptTemplate: "STRING_VALUE",
|
|
148
|
+
* },
|
|
149
|
+
* guardrailConfiguration: { // GuardrailConfiguration
|
|
150
|
+
* guardrailId: "STRING_VALUE", // required
|
|
151
|
+
* guardrailVersion: "STRING_VALUE", // required
|
|
152
|
+
* },
|
|
153
|
+
* inferenceConfig: { // InferenceConfig
|
|
154
|
+
* textInferenceConfig: { // TextInferenceConfig
|
|
155
|
+
* temperature: Number("float"),
|
|
156
|
+
* topP: Number("float"),
|
|
157
|
+
* maxTokens: Number("int"),
|
|
158
|
+
* stopSequences: [ // RAGStopSequences
|
|
159
|
+
* "STRING_VALUE",
|
|
160
|
+
* ],
|
|
161
|
+
* },
|
|
162
|
+
* },
|
|
163
|
+
* additionalModelRequestFields: {
|
|
164
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
165
|
+
* },
|
|
166
|
+
* },
|
|
167
|
+
* orchestrationConfiguration: { // OrchestrationConfiguration
|
|
168
|
+
* promptTemplate: {
|
|
169
|
+
* textPromptTemplate: "STRING_VALUE",
|
|
170
|
+
* },
|
|
171
|
+
* inferenceConfig: {
|
|
172
|
+
* textInferenceConfig: {
|
|
173
|
+
* temperature: Number("float"),
|
|
174
|
+
* topP: Number("float"),
|
|
175
|
+
* maxTokens: Number("int"),
|
|
176
|
+
* stopSequences: [
|
|
177
|
+
* "STRING_VALUE",
|
|
178
|
+
* ],
|
|
179
|
+
* },
|
|
180
|
+
* },
|
|
181
|
+
* additionalModelRequestFields: {
|
|
182
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
183
|
+
* },
|
|
184
|
+
* queryTransformationConfiguration: { // QueryTransformationConfiguration
|
|
185
|
+
* type: "QUERY_DECOMPOSITION", // required
|
|
186
|
+
* },
|
|
187
|
+
* },
|
|
188
|
+
* },
|
|
189
|
+
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
|
|
190
|
+
* modelArn: "STRING_VALUE", // required
|
|
191
|
+
* sources: [ // ExternalSources // required
|
|
192
|
+
* { // ExternalSource
|
|
193
|
+
* sourceType: "S3" || "BYTE_CONTENT", // required
|
|
194
|
+
* s3Location: { // S3ObjectDoc
|
|
195
|
+
* uri: "STRING_VALUE", // required
|
|
196
|
+
* },
|
|
197
|
+
* byteContent: { // ByteContentDoc
|
|
198
|
+
* identifier: "STRING_VALUE", // required
|
|
199
|
+
* contentType: "STRING_VALUE", // required
|
|
200
|
+
* data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
|
|
201
|
+
* },
|
|
202
|
+
* },
|
|
203
|
+
* ],
|
|
204
|
+
* generationConfiguration: { // ExternalSourcesGenerationConfiguration
|
|
205
|
+
* promptTemplate: {
|
|
206
|
+
* textPromptTemplate: "STRING_VALUE",
|
|
207
|
+
* },
|
|
208
|
+
* guardrailConfiguration: {
|
|
209
|
+
* guardrailId: "STRING_VALUE", // required
|
|
210
|
+
* guardrailVersion: "STRING_VALUE", // required
|
|
211
|
+
* },
|
|
212
|
+
* inferenceConfig: {
|
|
213
|
+
* textInferenceConfig: {
|
|
214
|
+
* temperature: Number("float"),
|
|
215
|
+
* topP: Number("float"),
|
|
216
|
+
* maxTokens: Number("int"),
|
|
217
|
+
* stopSequences: [
|
|
218
|
+
* "STRING_VALUE",
|
|
219
|
+
* ],
|
|
220
|
+
* },
|
|
221
|
+
* },
|
|
222
|
+
* additionalModelRequestFields: {
|
|
223
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
224
|
+
* },
|
|
225
|
+
* },
|
|
226
|
+
* },
|
|
227
|
+
* },
|
|
228
|
+
* sessionConfiguration: { // RetrieveAndGenerateSessionConfiguration
|
|
229
|
+
* kmsKeyArn: "STRING_VALUE", // required
|
|
230
|
+
* },
|
|
231
|
+
* };
|
|
232
|
+
* const command = new RetrieveAndGenerateStreamCommand(input);
|
|
233
|
+
* const response = await client.send(command);
|
|
234
|
+
* // { // RetrieveAndGenerateStreamResponse
|
|
235
|
+
* // stream: { // RetrieveAndGenerateStreamResponseOutput Union: only one key present
|
|
236
|
+
* // output: { // RetrieveAndGenerateOutputEvent
|
|
237
|
+
* // text: "STRING_VALUE", // required
|
|
238
|
+
* // },
|
|
239
|
+
* // citation: { // CitationEvent
|
|
240
|
+
* // citation: { // Citation
|
|
241
|
+
* // generatedResponsePart: { // GeneratedResponsePart
|
|
242
|
+
* // textResponsePart: { // TextResponsePart
|
|
243
|
+
* // text: "STRING_VALUE",
|
|
244
|
+
* // span: { // Span
|
|
245
|
+
* // start: Number("int"),
|
|
246
|
+
* // end: Number("int"),
|
|
247
|
+
* // },
|
|
248
|
+
* // },
|
|
249
|
+
* // },
|
|
250
|
+
* // retrievedReferences: [ // RetrievedReferences
|
|
251
|
+
* // { // RetrievedReference
|
|
252
|
+
* // content: { // RetrievalResultContent
|
|
253
|
+
* // text: "STRING_VALUE", // required
|
|
254
|
+
* // },
|
|
255
|
+
* // location: { // RetrievalResultLocation
|
|
256
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
257
|
+
* // s3Location: { // RetrievalResultS3Location
|
|
258
|
+
* // uri: "STRING_VALUE",
|
|
259
|
+
* // },
|
|
260
|
+
* // webLocation: { // RetrievalResultWebLocation
|
|
261
|
+
* // url: "STRING_VALUE",
|
|
262
|
+
* // },
|
|
263
|
+
* // confluenceLocation: { // RetrievalResultConfluenceLocation
|
|
264
|
+
* // url: "STRING_VALUE",
|
|
265
|
+
* // },
|
|
266
|
+
* // salesforceLocation: { // RetrievalResultSalesforceLocation
|
|
267
|
+
* // url: "STRING_VALUE",
|
|
268
|
+
* // },
|
|
269
|
+
* // sharePointLocation: { // RetrievalResultSharePointLocation
|
|
270
|
+
* // url: "STRING_VALUE",
|
|
271
|
+
* // },
|
|
272
|
+
* // customDocumentLocation: { // RetrievalResultCustomDocumentLocation
|
|
273
|
+
* // id: "STRING_VALUE",
|
|
274
|
+
* // },
|
|
275
|
+
* // },
|
|
276
|
+
* // metadata: { // RetrievalResultMetadata
|
|
277
|
+
* // "<keys>": "DOCUMENT_VALUE",
|
|
278
|
+
* // },
|
|
279
|
+
* // },
|
|
280
|
+
* // ],
|
|
281
|
+
* // },
|
|
282
|
+
* // },
|
|
283
|
+
* // guardrail: { // GuardrailEvent
|
|
284
|
+
* // action: "INTERVENED" || "NONE",
|
|
285
|
+
* // },
|
|
286
|
+
* // internalServerException: { // InternalServerException
|
|
287
|
+
* // message: "STRING_VALUE",
|
|
288
|
+
* // },
|
|
289
|
+
* // validationException: { // ValidationException
|
|
290
|
+
* // message: "STRING_VALUE",
|
|
291
|
+
* // },
|
|
292
|
+
* // resourceNotFoundException: { // ResourceNotFoundException
|
|
293
|
+
* // message: "STRING_VALUE",
|
|
294
|
+
* // },
|
|
295
|
+
* // serviceQuotaExceededException: { // ServiceQuotaExceededException
|
|
296
|
+
* // message: "STRING_VALUE",
|
|
297
|
+
* // },
|
|
298
|
+
* // throttlingException: { // ThrottlingException
|
|
299
|
+
* // message: "STRING_VALUE",
|
|
300
|
+
* // },
|
|
301
|
+
* // accessDeniedException: { // AccessDeniedException
|
|
302
|
+
* // message: "STRING_VALUE",
|
|
303
|
+
* // },
|
|
304
|
+
* // conflictException: { // ConflictException
|
|
305
|
+
* // message: "STRING_VALUE",
|
|
306
|
+
* // },
|
|
307
|
+
* // dependencyFailedException: { // DependencyFailedException
|
|
308
|
+
* // message: "STRING_VALUE",
|
|
309
|
+
* // resourceName: "STRING_VALUE",
|
|
310
|
+
* // },
|
|
311
|
+
* // badGatewayException: { // BadGatewayException
|
|
312
|
+
* // message: "STRING_VALUE",
|
|
313
|
+
* // resourceName: "STRING_VALUE",
|
|
314
|
+
* // },
|
|
315
|
+
* // },
|
|
316
|
+
* // sessionId: "STRING_VALUE", // required
|
|
317
|
+
* // };
|
|
318
|
+
*
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* @param RetrieveAndGenerateStreamCommandInput - {@link RetrieveAndGenerateStreamCommandInput}
|
|
322
|
+
* @returns {@link RetrieveAndGenerateStreamCommandOutput}
|
|
323
|
+
* @see {@link RetrieveAndGenerateStreamCommandInput} for command's `input` shape.
|
|
324
|
+
* @see {@link RetrieveAndGenerateStreamCommandOutput} for command's `response` shape.
|
|
325
|
+
* @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
|
|
326
|
+
*
|
|
327
|
+
* @throws {@link AccessDeniedException} (client fault)
|
|
328
|
+
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
|
|
329
|
+
*
|
|
330
|
+
* @throws {@link BadGatewayException} (server fault)
|
|
331
|
+
* <p>There was an issue with a dependency due to a server issue. Retry your request.</p>
|
|
332
|
+
*
|
|
333
|
+
* @throws {@link ConflictException} (client fault)
|
|
334
|
+
* <p>There was a conflict performing an operation. Resolve the conflict and retry your request.</p>
|
|
335
|
+
*
|
|
336
|
+
* @throws {@link DependencyFailedException} (client fault)
|
|
337
|
+
* <p>There was an issue with a dependency. Check the resource configurations and retry the request.</p>
|
|
338
|
+
*
|
|
339
|
+
* @throws {@link InternalServerException} (server fault)
|
|
340
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
341
|
+
*
|
|
342
|
+
* @throws {@link ResourceNotFoundException} (client fault)
|
|
343
|
+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
|
|
344
|
+
*
|
|
345
|
+
* @throws {@link ServiceQuotaExceededException} (client fault)
|
|
346
|
+
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
347
|
+
*
|
|
348
|
+
* @throws {@link ThrottlingException} (client fault)
|
|
349
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
350
|
+
*
|
|
351
|
+
* @throws {@link ValidationException} (client fault)
|
|
352
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
353
|
+
*
|
|
354
|
+
* @throws {@link BedrockAgentRuntimeServiceException}
|
|
355
|
+
* <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
|
|
356
|
+
*
|
|
357
|
+
* @public
|
|
358
|
+
*/
|
|
359
|
+
export declare class RetrieveAndGenerateStreamCommand extends RetrieveAndGenerateStreamCommand_base {
|
|
360
|
+
/** @internal type navigation helper, not in runtime. */
|
|
361
|
+
protected static __types: {
|
|
362
|
+
api: {
|
|
363
|
+
input: RetrieveAndGenerateStreamRequest;
|
|
364
|
+
output: RetrieveAndGenerateStreamResponse;
|
|
365
|
+
};
|
|
366
|
+
sdk: {
|
|
367
|
+
input: RetrieveAndGenerateStreamCommandInput;
|
|
368
|
+
output: RetrieveAndGenerateStreamCommandOutput;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
}
|
|
@@ -95,8 +95,49 @@ declare const RetrieveCommand_base: {
|
|
|
95
95
|
* "<RetrievalFilter>",
|
|
96
96
|
* ],
|
|
97
97
|
* },
|
|
98
|
+
* rerankingConfiguration: { // VectorSearchRerankingConfiguration
|
|
99
|
+
* type: "BEDROCK_RERANKING_MODEL", // required
|
|
100
|
+
* bedrockRerankingConfiguration: { // VectorSearchBedrockRerankingConfiguration
|
|
101
|
+
* modelConfiguration: { // VectorSearchBedrockRerankingModelConfiguration
|
|
102
|
+
* modelArn: "STRING_VALUE", // required
|
|
103
|
+
* additionalModelRequestFields: { // AdditionalModelRequestFields
|
|
104
|
+
* "<keys>": "DOCUMENT_VALUE",
|
|
105
|
+
* },
|
|
106
|
+
* },
|
|
107
|
+
* numberOfRerankedResults: Number("int"),
|
|
108
|
+
* metadataConfiguration: { // MetadataConfigurationForReranking
|
|
109
|
+
* selectionMode: "SELECTIVE" || "ALL", // required
|
|
110
|
+
* selectiveModeConfiguration: { // RerankingMetadataSelectiveModeConfiguration Union: only one key present
|
|
111
|
+
* fieldsToInclude: [ // FieldsForReranking
|
|
112
|
+
* { // FieldForReranking
|
|
113
|
+
* fieldName: "STRING_VALUE", // required
|
|
114
|
+
* },
|
|
115
|
+
* ],
|
|
116
|
+
* fieldsToExclude: [
|
|
117
|
+
* {
|
|
118
|
+
* fieldName: "STRING_VALUE", // required
|
|
119
|
+
* },
|
|
120
|
+
* ],
|
|
121
|
+
* },
|
|
122
|
+
* },
|
|
123
|
+
* },
|
|
124
|
+
* },
|
|
125
|
+
* implicitFilterConfiguration: { // ImplicitFilterConfiguration
|
|
126
|
+
* metadataAttributes: [ // MetadataAttributeSchemaList // required
|
|
127
|
+
* { // MetadataAttributeSchema
|
|
128
|
+
* key: "STRING_VALUE", // required
|
|
129
|
+
* type: "STRING" || "NUMBER" || "BOOLEAN" || "STRING_LIST", // required
|
|
130
|
+
* description: "STRING_VALUE", // required
|
|
131
|
+
* },
|
|
132
|
+
* ],
|
|
133
|
+
* modelArn: "STRING_VALUE", // required
|
|
134
|
+
* },
|
|
98
135
|
* },
|
|
99
136
|
* },
|
|
137
|
+
* guardrailConfiguration: { // GuardrailConfiguration
|
|
138
|
+
* guardrailId: "STRING_VALUE", // required
|
|
139
|
+
* guardrailVersion: "STRING_VALUE", // required
|
|
140
|
+
* },
|
|
100
141
|
* nextToken: "STRING_VALUE",
|
|
101
142
|
* };
|
|
102
143
|
* const command = new RetrieveCommand(input);
|
|
@@ -108,7 +149,7 @@ declare const RetrieveCommand_base: {
|
|
|
108
149
|
* // text: "STRING_VALUE", // required
|
|
109
150
|
* // },
|
|
110
151
|
* // location: { // RetrievalResultLocation
|
|
111
|
-
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required
|
|
152
|
+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required
|
|
112
153
|
* // s3Location: { // RetrievalResultS3Location
|
|
113
154
|
* // uri: "STRING_VALUE",
|
|
114
155
|
* // },
|
|
@@ -124,6 +165,9 @@ declare const RetrieveCommand_base: {
|
|
|
124
165
|
* // sharePointLocation: { // RetrievalResultSharePointLocation
|
|
125
166
|
* // url: "STRING_VALUE",
|
|
126
167
|
* // },
|
|
168
|
+
* // customDocumentLocation: { // RetrievalResultCustomDocumentLocation
|
|
169
|
+
* // id: "STRING_VALUE",
|
|
170
|
+
* // },
|
|
127
171
|
* // },
|
|
128
172
|
* // score: Number("double"),
|
|
129
173
|
* // metadata: { // RetrievalResultMetadata
|
|
@@ -131,6 +175,7 @@ declare const RetrieveCommand_base: {
|
|
|
131
175
|
* // },
|
|
132
176
|
* // },
|
|
133
177
|
* // ],
|
|
178
|
+
* // guardrailAction: "INTERVENED" || "NONE",
|
|
134
179
|
* // nextToken: "STRING_VALUE",
|
|
135
180
|
* // };
|
|
136
181
|
*
|
|
@@ -4,5 +4,7 @@ export * from "./InvokeAgentCommand";
|
|
|
4
4
|
export * from "./InvokeFlowCommand";
|
|
5
5
|
export * from "./InvokeInlineAgentCommand";
|
|
6
6
|
export * from "./OptimizePromptCommand";
|
|
7
|
+
export * from "./RerankCommand";
|
|
7
8
|
export * from "./RetrieveAndGenerateCommand";
|
|
9
|
+
export * from "./RetrieveAndGenerateStreamCommand";
|
|
8
10
|
export * from "./RetrieveCommand";
|