@aws-sdk/client-bedrock-agent-runtime 3.540.0 → 3.543.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/dist-cjs/index.js +246 -17
- package/dist-es/models/models_0.js +101 -6
- package/dist-es/protocols/Aws_restJson1.js +126 -6
- package/dist-types/commands/InvokeAgentCommand.d.ts +6 -0
- package/dist-types/commands/RetrieveAndGenerateCommand.d.ts +57 -4
- package/dist-types/commands/RetrieveCommand.d.ts +51 -0
- package/dist-types/models/models_0.d.ts +634 -101
- package/dist-types/ts3.4/models/models_0.d.ts +267 -33
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
|
|
2
|
+
import { DocumentType as __DocumentType } from "@smithy/types";
|
|
2
3
|
import { BedrockAgentRuntimeServiceException as __BaseException } from "./BedrockAgentRuntimeServiceException";
|
|
3
4
|
/**
|
|
4
5
|
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
|
|
@@ -145,7 +146,7 @@ export declare class InternalServerException extends __BaseException {
|
|
|
145
146
|
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>);
|
|
146
147
|
}
|
|
147
148
|
/**
|
|
148
|
-
* <p>Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html">Lambda function</a> for an action group or pass them when making an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/
|
|
149
|
+
* <p>Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html">Lambda function</a> for an action group or pass them when making an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p>
|
|
149
150
|
* @public
|
|
150
151
|
*/
|
|
151
152
|
export interface SessionState {
|
|
@@ -165,7 +166,7 @@ export interface SessionState {
|
|
|
165
166
|
*/
|
|
166
167
|
export interface InvokeAgentRequest {
|
|
167
168
|
/**
|
|
168
|
-
* <p>Contains parameters that specify various attributes of the session
|
|
169
|
+
* <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p>
|
|
169
170
|
* @public
|
|
170
171
|
*/
|
|
171
172
|
sessionState?: SessionState;
|
|
@@ -202,6 +203,17 @@ export interface InvokeAgentRequest {
|
|
|
202
203
|
}
|
|
203
204
|
/**
|
|
204
205
|
* <p>Contains information about where the text with a citation begins and ends in the generated output.</p>
|
|
206
|
+
* <p>This data type is used in the following API operations:</p>
|
|
207
|
+
* <ul>
|
|
208
|
+
* <li>
|
|
209
|
+
* <p>
|
|
210
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>span</code> field</p>
|
|
211
|
+
* </li>
|
|
212
|
+
* <li>
|
|
213
|
+
* <p>
|
|
214
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>span</code> field</p>
|
|
215
|
+
* </li>
|
|
216
|
+
* </ul>
|
|
205
217
|
* @public
|
|
206
218
|
*/
|
|
207
219
|
export interface Span {
|
|
@@ -218,6 +230,17 @@ export interface Span {
|
|
|
218
230
|
}
|
|
219
231
|
/**
|
|
220
232
|
* <p>Contains the part of the generated text that contains a citation, alongside where it begins and ends.</p>
|
|
233
|
+
* <p>This data type is used in the following API operations:</p>
|
|
234
|
+
* <ul>
|
|
235
|
+
* <li>
|
|
236
|
+
* <p>
|
|
237
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>textResponsePart</code> field</p>
|
|
238
|
+
* </li>
|
|
239
|
+
* <li>
|
|
240
|
+
* <p>
|
|
241
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>textResponsePart</code> field</p>
|
|
242
|
+
* </li>
|
|
243
|
+
* </ul>
|
|
221
244
|
* @public
|
|
222
245
|
*/
|
|
223
246
|
export interface TextResponsePart {
|
|
@@ -234,6 +257,17 @@ export interface TextResponsePart {
|
|
|
234
257
|
}
|
|
235
258
|
/**
|
|
236
259
|
* <p>Contains metadata about a part of the generated response that is accompanied by a citation.</p>
|
|
260
|
+
* <p>This data type is used in the following API operations:</p>
|
|
261
|
+
* <ul>
|
|
262
|
+
* <li>
|
|
263
|
+
* <p>
|
|
264
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>generatedResponsePart</code> field</p>
|
|
265
|
+
* </li>
|
|
266
|
+
* <li>
|
|
267
|
+
* <p>
|
|
268
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>generatedResponsePart</code> field</p>
|
|
269
|
+
* </li>
|
|
270
|
+
* </ul>
|
|
237
271
|
* @public
|
|
238
272
|
*/
|
|
239
273
|
export interface GeneratedResponsePart {
|
|
@@ -245,6 +279,21 @@ export interface GeneratedResponsePart {
|
|
|
245
279
|
}
|
|
246
280
|
/**
|
|
247
281
|
* <p>Contains the cited text from the data source.</p>
|
|
282
|
+
* <p>This data type is used in the following API operations:</p>
|
|
283
|
+
* <ul>
|
|
284
|
+
* <li>
|
|
285
|
+
* <p>
|
|
286
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>content</code> field</p>
|
|
287
|
+
* </li>
|
|
288
|
+
* <li>
|
|
289
|
+
* <p>
|
|
290
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>content</code> field</p>
|
|
291
|
+
* </li>
|
|
292
|
+
* <li>
|
|
293
|
+
* <p>
|
|
294
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>content</code> field</p>
|
|
295
|
+
* </li>
|
|
296
|
+
* </ul>
|
|
248
297
|
* @public
|
|
249
298
|
*/
|
|
250
299
|
export interface RetrievalResultContent {
|
|
@@ -256,6 +305,21 @@ export interface RetrievalResultContent {
|
|
|
256
305
|
}
|
|
257
306
|
/**
|
|
258
307
|
* <p>Contains the S3 location of the data source.</p>
|
|
308
|
+
* <p>This data type is used in the following API operations:</p>
|
|
309
|
+
* <ul>
|
|
310
|
+
* <li>
|
|
311
|
+
* <p>
|
|
312
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>s3Location</code> field</p>
|
|
313
|
+
* </li>
|
|
314
|
+
* <li>
|
|
315
|
+
* <p>
|
|
316
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>s3Location</code> field</p>
|
|
317
|
+
* </li>
|
|
318
|
+
* <li>
|
|
319
|
+
* <p>
|
|
320
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>s3Location</code> field</p>
|
|
321
|
+
* </li>
|
|
322
|
+
* </ul>
|
|
259
323
|
* @public
|
|
260
324
|
*/
|
|
261
325
|
export interface RetrievalResultS3Location {
|
|
@@ -278,6 +342,21 @@ export declare const RetrievalResultLocationType: {
|
|
|
278
342
|
export type RetrievalResultLocationType = (typeof RetrievalResultLocationType)[keyof typeof RetrievalResultLocationType];
|
|
279
343
|
/**
|
|
280
344
|
* <p>Contains information about the location of the data source.</p>
|
|
345
|
+
* <p>This data type is used in the following API operations:</p>
|
|
346
|
+
* <ul>
|
|
347
|
+
* <li>
|
|
348
|
+
* <p>
|
|
349
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>location</code> field</p>
|
|
350
|
+
* </li>
|
|
351
|
+
* <li>
|
|
352
|
+
* <p>
|
|
353
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>location</code> field</p>
|
|
354
|
+
* </li>
|
|
355
|
+
* <li>
|
|
356
|
+
* <p>
|
|
357
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>locatino</code> field</p>
|
|
358
|
+
* </li>
|
|
359
|
+
* </ul>
|
|
281
360
|
* @public
|
|
282
361
|
*/
|
|
283
362
|
export interface RetrievalResultLocation {
|
|
@@ -293,7 +372,18 @@ export interface RetrievalResultLocation {
|
|
|
293
372
|
s3Location?: RetrievalResultS3Location;
|
|
294
373
|
}
|
|
295
374
|
/**
|
|
296
|
-
* <p>Contains metadata about a
|
|
375
|
+
* <p>Contains metadata about a source cited for the generated response.</p>
|
|
376
|
+
* <p>This data type is used in the following API operations:</p>
|
|
377
|
+
* <ul>
|
|
378
|
+
* <li>
|
|
379
|
+
* <p>
|
|
380
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>retrievedReferences</code> field</p>
|
|
381
|
+
* </li>
|
|
382
|
+
* <li>
|
|
383
|
+
* <p>
|
|
384
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>retrievedReferences</code> field</p>
|
|
385
|
+
* </li>
|
|
386
|
+
* </ul>
|
|
297
387
|
* @public
|
|
298
388
|
*/
|
|
299
389
|
export interface RetrievedReference {
|
|
@@ -307,9 +397,25 @@ export interface RetrievedReference {
|
|
|
307
397
|
* @public
|
|
308
398
|
*/
|
|
309
399
|
location?: RetrievalResultLocation;
|
|
400
|
+
/**
|
|
401
|
+
* <p>Contains metadata attributes and their values for the file in the data source. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata">Metadata and filtering</a>.</p>
|
|
402
|
+
* @public
|
|
403
|
+
*/
|
|
404
|
+
metadata?: Record<string, __DocumentType>;
|
|
310
405
|
}
|
|
311
406
|
/**
|
|
312
407
|
* <p>An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source.</p>
|
|
408
|
+
* <p>This data type is used in the following API operations:</p>
|
|
409
|
+
* <ul>
|
|
410
|
+
* <li>
|
|
411
|
+
* <p>
|
|
412
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>citations</code> field</p>
|
|
413
|
+
* </li>
|
|
414
|
+
* <li>
|
|
415
|
+
* <p>
|
|
416
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>citations</code> field</p>
|
|
417
|
+
* </li>
|
|
418
|
+
* </ul>
|
|
313
419
|
* @public
|
|
314
420
|
*/
|
|
315
421
|
export interface Citation {
|
|
@@ -1327,6 +1433,13 @@ export interface InvokeAgentResponse {
|
|
|
1327
1433
|
}
|
|
1328
1434
|
/**
|
|
1329
1435
|
* <p>Contains the query made to the knowledge base.</p>
|
|
1436
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1437
|
+
* <ul>
|
|
1438
|
+
* <li>
|
|
1439
|
+
* <p>
|
|
1440
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>input</code> field</p>
|
|
1441
|
+
* </li>
|
|
1442
|
+
* </ul>
|
|
1330
1443
|
* @public
|
|
1331
1444
|
*/
|
|
1332
1445
|
export interface RetrieveAndGenerateInput {
|
|
@@ -1337,185 +1450,565 @@ export interface RetrieveAndGenerateInput {
|
|
|
1337
1450
|
text: string | undefined;
|
|
1338
1451
|
}
|
|
1339
1452
|
/**
|
|
1453
|
+
* <p>Contains the template for the prompt that's sent to the model for response generation. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt">Knowledge base prompt templates</a>.</p>
|
|
1454
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1455
|
+
* <ul>
|
|
1456
|
+
* <li>
|
|
1457
|
+
* <p>
|
|
1458
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>filter</code> field</p>
|
|
1459
|
+
* </li>
|
|
1460
|
+
* </ul>
|
|
1340
1461
|
* @public
|
|
1341
|
-
* @enum
|
|
1342
1462
|
*/
|
|
1343
|
-
export
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1463
|
+
export interface PromptTemplate {
|
|
1464
|
+
/**
|
|
1465
|
+
* <p>The template for the prompt that's sent to the model for response generation. You can include prompt placeholders, which become replaced before the prompt is sent to the model to provide instructions and context to the model. In addition, you can include XML tags to delineate meaningful sections of the prompt template.</p>
|
|
1466
|
+
* <p>For more information, see the following resources:</p>
|
|
1467
|
+
* <ul>
|
|
1468
|
+
* <li>
|
|
1469
|
+
* <p>
|
|
1470
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt">Knowledge base prompt templates</a>
|
|
1471
|
+
* </p>
|
|
1472
|
+
* </li>
|
|
1473
|
+
* <li>
|
|
1474
|
+
* <p>
|
|
1475
|
+
* <a href="https://docs.anthropic.com/claude/docs/use-xml-tags">Use XML tags with Anthropic Claude models</a>
|
|
1476
|
+
* </p>
|
|
1477
|
+
* </li>
|
|
1478
|
+
* </ul>
|
|
1479
|
+
* @public
|
|
1480
|
+
*/
|
|
1481
|
+
textPromptTemplate?: string;
|
|
1482
|
+
}
|
|
1347
1483
|
/**
|
|
1484
|
+
* <p>Contains configurations for response generation based on the knowledge base query results.</p>
|
|
1485
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1486
|
+
* <ul>
|
|
1487
|
+
* <li>
|
|
1488
|
+
* <p>
|
|
1489
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a>
|
|
1490
|
+
* </p>
|
|
1491
|
+
* </li>
|
|
1492
|
+
* </ul>
|
|
1348
1493
|
* @public
|
|
1349
1494
|
*/
|
|
1350
|
-
export
|
|
1495
|
+
export interface GenerationConfiguration {
|
|
1496
|
+
/**
|
|
1497
|
+
* <p>Contains the template for the prompt that's sent to the model for response generation.</p>
|
|
1498
|
+
* @public
|
|
1499
|
+
*/
|
|
1500
|
+
promptTemplate?: PromptTemplate;
|
|
1501
|
+
}
|
|
1351
1502
|
/**
|
|
1352
|
-
* <p>
|
|
1503
|
+
* <p>Specifies the name that the metadata attribute must match and the value to which to compare the value of the metadata attribute. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1504
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1505
|
+
* <ul>
|
|
1506
|
+
* <li>
|
|
1507
|
+
* <p>
|
|
1508
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a>
|
|
1509
|
+
* </p>
|
|
1510
|
+
* </li>
|
|
1511
|
+
* </ul>
|
|
1353
1512
|
* @public
|
|
1354
1513
|
*/
|
|
1355
|
-
export interface
|
|
1514
|
+
export interface FilterAttribute {
|
|
1356
1515
|
/**
|
|
1357
|
-
* <p>The
|
|
1358
|
-
* <note>
|
|
1359
|
-
* <p>The <code>numberOfResults</code> field is currently unsupported for <code>RetrieveAndGenerate</code>. Don't include it in this field if you are sending a <code>RetrieveAndGenerate</code> request.</p>
|
|
1360
|
-
* </note>
|
|
1516
|
+
* <p>The name that the metadata attribute must match.</p>
|
|
1361
1517
|
* @public
|
|
1362
1518
|
*/
|
|
1363
|
-
|
|
1519
|
+
key: string | undefined;
|
|
1364
1520
|
/**
|
|
1365
|
-
* <p>
|
|
1521
|
+
* <p>The value to whcih to compare the value of the metadata attribute.</p>
|
|
1366
1522
|
* @public
|
|
1367
1523
|
*/
|
|
1368
|
-
|
|
1524
|
+
value: __DocumentType | undefined;
|
|
1369
1525
|
}
|
|
1370
1526
|
/**
|
|
1371
|
-
*
|
|
1527
|
+
* @public
|
|
1528
|
+
* @enum
|
|
1529
|
+
*/
|
|
1530
|
+
export declare const SearchType: {
|
|
1531
|
+
readonly HYBRID: "HYBRID";
|
|
1532
|
+
readonly SEMANTIC: "SEMANTIC";
|
|
1533
|
+
};
|
|
1534
|
+
/**
|
|
1535
|
+
* @public
|
|
1536
|
+
*/
|
|
1537
|
+
export type SearchType = (typeof SearchType)[keyof typeof SearchType];
|
|
1538
|
+
/**
|
|
1539
|
+
* @public
|
|
1540
|
+
* @enum
|
|
1541
|
+
*/
|
|
1542
|
+
export declare const RetrieveAndGenerateType: {
|
|
1543
|
+
readonly KNOWLEDGE_BASE: "KNOWLEDGE_BASE";
|
|
1544
|
+
};
|
|
1545
|
+
/**
|
|
1546
|
+
* @public
|
|
1547
|
+
*/
|
|
1548
|
+
export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typeof RetrieveAndGenerateType];
|
|
1549
|
+
/**
|
|
1550
|
+
* <p>Contains configuration about the session with the knowledge base.</p>
|
|
1372
1551
|
* <p>This data type is used in the following API operations:</p>
|
|
1373
1552
|
* <ul>
|
|
1374
1553
|
* <li>
|
|
1375
1554
|
* <p>
|
|
1376
|
-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-
|
|
1377
|
-
* </p>
|
|
1555
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>sessionConfiguration</code> field</p>
|
|
1378
1556
|
* </li>
|
|
1557
|
+
* </ul>
|
|
1558
|
+
* @public
|
|
1559
|
+
*/
|
|
1560
|
+
export interface RetrieveAndGenerateSessionConfiguration {
|
|
1561
|
+
/**
|
|
1562
|
+
* <p>The ARN of the KMS key encrypting the session.</p>
|
|
1563
|
+
* @public
|
|
1564
|
+
*/
|
|
1565
|
+
kmsKeyArn: string | undefined;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* <p>Contains the response generated from querying the knowledge base.</p>
|
|
1569
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1570
|
+
* <ul>
|
|
1379
1571
|
* <li>
|
|
1380
1572
|
* <p>
|
|
1381
|
-
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-
|
|
1382
|
-
* </p>
|
|
1573
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>output</code> field</p>
|
|
1383
1574
|
* </li>
|
|
1384
1575
|
* </ul>
|
|
1385
1576
|
* @public
|
|
1386
1577
|
*/
|
|
1387
|
-
export interface
|
|
1578
|
+
export interface RetrieveAndGenerateOutput {
|
|
1388
1579
|
/**
|
|
1389
|
-
* <p>
|
|
1580
|
+
* <p>The response generated from querying the knowledge base.</p>
|
|
1390
1581
|
* @public
|
|
1391
1582
|
*/
|
|
1392
|
-
|
|
1583
|
+
text: string | undefined;
|
|
1393
1584
|
}
|
|
1394
1585
|
/**
|
|
1395
|
-
* <p>Contains details about the resource being queried.</p>
|
|
1396
1586
|
* @public
|
|
1397
1587
|
*/
|
|
1398
|
-
export interface
|
|
1588
|
+
export interface RetrieveAndGenerateResponse {
|
|
1399
1589
|
/**
|
|
1400
|
-
* <p>The unique identifier of the
|
|
1590
|
+
* <p>The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.</p>
|
|
1401
1591
|
* @public
|
|
1402
1592
|
*/
|
|
1403
|
-
|
|
1593
|
+
sessionId: string | undefined;
|
|
1404
1594
|
/**
|
|
1405
|
-
* <p>
|
|
1595
|
+
* <p>Contains the response generated from querying the knowledge base.</p>
|
|
1406
1596
|
* @public
|
|
1407
1597
|
*/
|
|
1408
|
-
|
|
1598
|
+
output: RetrieveAndGenerateOutput | undefined;
|
|
1409
1599
|
/**
|
|
1410
|
-
* <p>
|
|
1600
|
+
* <p>A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.</p>
|
|
1411
1601
|
* @public
|
|
1412
1602
|
*/
|
|
1413
|
-
|
|
1603
|
+
citations?: Citation[];
|
|
1414
1604
|
}
|
|
1415
1605
|
/**
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1606
|
+
* <p>Contains the query made to the knowledge base.</p>
|
|
1607
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1608
|
+
* <ul>
|
|
1609
|
+
* <li>
|
|
1610
|
+
* <p>
|
|
1611
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax">Retrieve request</a> – in the <code>retrievalQuery</code> field</p>
|
|
1612
|
+
* </li>
|
|
1613
|
+
* </ul>
|
|
1423
1614
|
* @public
|
|
1424
1615
|
*/
|
|
1425
|
-
export
|
|
1616
|
+
export interface KnowledgeBaseQuery {
|
|
1617
|
+
/**
|
|
1618
|
+
* <p>The text of the query made to the knowledge base.</p>
|
|
1619
|
+
* @public
|
|
1620
|
+
*/
|
|
1621
|
+
text: string | undefined;
|
|
1622
|
+
}
|
|
1426
1623
|
/**
|
|
1427
|
-
* <p>
|
|
1624
|
+
* <p>Details about a result from querying the knowledge base.</p>
|
|
1625
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1626
|
+
* <ul>
|
|
1627
|
+
* <li>
|
|
1628
|
+
* <p>
|
|
1629
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax">Retrieve response</a> – in the <code>retrievalResults</code> field</p>
|
|
1630
|
+
* </li>
|
|
1631
|
+
* </ul>
|
|
1428
1632
|
* @public
|
|
1429
1633
|
*/
|
|
1430
|
-
export interface
|
|
1634
|
+
export interface KnowledgeBaseRetrievalResult {
|
|
1431
1635
|
/**
|
|
1432
|
-
* <p>
|
|
1636
|
+
* <p>Contains a chunk of text from a data source in the knowledge base.</p>
|
|
1433
1637
|
* @public
|
|
1434
1638
|
*/
|
|
1435
|
-
|
|
1639
|
+
content: RetrievalResultContent | undefined;
|
|
1436
1640
|
/**
|
|
1437
|
-
* <p>Contains
|
|
1641
|
+
* <p>Contains information about the location of the data source.</p>
|
|
1438
1642
|
* @public
|
|
1439
1643
|
*/
|
|
1440
|
-
|
|
1644
|
+
location?: RetrievalResultLocation;
|
|
1645
|
+
/**
|
|
1646
|
+
* <p>The level of relevance of the result to the query.</p>
|
|
1647
|
+
* @public
|
|
1648
|
+
*/
|
|
1649
|
+
score?: number;
|
|
1650
|
+
/**
|
|
1651
|
+
* <p>Contains metadata attributes and their values for the file in the data source. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata">Metadata and filtering</a>.</p>
|
|
1652
|
+
* @public
|
|
1653
|
+
*/
|
|
1654
|
+
metadata?: Record<string, __DocumentType>;
|
|
1441
1655
|
}
|
|
1442
1656
|
/**
|
|
1443
|
-
* <p>Contains configuration about the session with the knowledge base.</p>
|
|
1444
1657
|
* @public
|
|
1445
1658
|
*/
|
|
1446
|
-
export interface
|
|
1659
|
+
export interface RetrieveResponse {
|
|
1447
1660
|
/**
|
|
1448
|
-
* <p>
|
|
1661
|
+
* <p>A list of results from querying the knowledge base.</p>
|
|
1449
1662
|
* @public
|
|
1450
1663
|
*/
|
|
1451
|
-
|
|
1664
|
+
retrievalResults: KnowledgeBaseRetrievalResult[] | undefined;
|
|
1665
|
+
/**
|
|
1666
|
+
* <p>If there are more results than can fit in the response, the response returns a <code>nextToken</code>. Use this token in the <code>nextToken</code> field of another request to retrieve the next batch of results.</p>
|
|
1667
|
+
* @public
|
|
1668
|
+
*/
|
|
1669
|
+
nextToken?: string;
|
|
1452
1670
|
}
|
|
1453
1671
|
/**
|
|
1672
|
+
* <p>Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1673
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1674
|
+
* <ul>
|
|
1675
|
+
* <li>
|
|
1676
|
+
* <p>
|
|
1677
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax">Retrieve request</a> – in the <code>filter</code> field</p>
|
|
1678
|
+
* </li>
|
|
1679
|
+
* <li>
|
|
1680
|
+
* <p>
|
|
1681
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>filter</code> field</p>
|
|
1682
|
+
* </li>
|
|
1683
|
+
* </ul>
|
|
1454
1684
|
* @public
|
|
1455
1685
|
*/
|
|
1456
|
-
export
|
|
1686
|
+
export type RetrievalFilter = RetrievalFilter.AndAllMember | RetrievalFilter.EqualsMember | RetrievalFilter.GreaterThanMember | RetrievalFilter.GreaterThanOrEqualsMember | RetrievalFilter.InMember | RetrievalFilter.LessThanMember | RetrievalFilter.LessThanOrEqualsMember | RetrievalFilter.NotEqualsMember | RetrievalFilter.NotInMember | RetrievalFilter.OrAllMember | RetrievalFilter.StartsWithMember | RetrievalFilter.$UnknownMember;
|
|
1687
|
+
/**
|
|
1688
|
+
* @public
|
|
1689
|
+
*/
|
|
1690
|
+
export declare namespace RetrievalFilter {
|
|
1457
1691
|
/**
|
|
1458
|
-
* <p>
|
|
1692
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value matches the <code>value</code> in this object are returned.</p>
|
|
1459
1693
|
* @public
|
|
1460
1694
|
*/
|
|
1461
|
-
|
|
1695
|
+
interface EqualsMember {
|
|
1696
|
+
equals: FilterAttribute;
|
|
1697
|
+
notEquals?: never;
|
|
1698
|
+
greaterThan?: never;
|
|
1699
|
+
greaterThanOrEquals?: never;
|
|
1700
|
+
lessThan?: never;
|
|
1701
|
+
lessThanOrEquals?: never;
|
|
1702
|
+
in?: never;
|
|
1703
|
+
notIn?: never;
|
|
1704
|
+
startsWith?: never;
|
|
1705
|
+
andAll?: never;
|
|
1706
|
+
orAll?: never;
|
|
1707
|
+
$unknown?: never;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value doesn't match the <code>value</code> in this object are returned.</p>
|
|
1711
|
+
* @public
|
|
1712
|
+
*/
|
|
1713
|
+
interface NotEqualsMember {
|
|
1714
|
+
equals?: never;
|
|
1715
|
+
notEquals: FilterAttribute;
|
|
1716
|
+
greaterThan?: never;
|
|
1717
|
+
greaterThanOrEquals?: never;
|
|
1718
|
+
lessThan?: never;
|
|
1719
|
+
lessThanOrEquals?: never;
|
|
1720
|
+
in?: never;
|
|
1721
|
+
notIn?: never;
|
|
1722
|
+
startsWith?: never;
|
|
1723
|
+
andAll?: never;
|
|
1724
|
+
orAll?: never;
|
|
1725
|
+
$unknown?: never;
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value is greater than the <code>value</code> in this object are returned.</p>
|
|
1729
|
+
* @public
|
|
1730
|
+
*/
|
|
1731
|
+
interface GreaterThanMember {
|
|
1732
|
+
equals?: never;
|
|
1733
|
+
notEquals?: never;
|
|
1734
|
+
greaterThan: FilterAttribute;
|
|
1735
|
+
greaterThanOrEquals?: never;
|
|
1736
|
+
lessThan?: never;
|
|
1737
|
+
lessThanOrEquals?: never;
|
|
1738
|
+
in?: never;
|
|
1739
|
+
notIn?: never;
|
|
1740
|
+
startsWith?: never;
|
|
1741
|
+
andAll?: never;
|
|
1742
|
+
orAll?: never;
|
|
1743
|
+
$unknown?: never;
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value is greater than or equal to the <code>value</code> in this object are returned.</p>
|
|
1747
|
+
* @public
|
|
1748
|
+
*/
|
|
1749
|
+
interface GreaterThanOrEqualsMember {
|
|
1750
|
+
equals?: never;
|
|
1751
|
+
notEquals?: never;
|
|
1752
|
+
greaterThan?: never;
|
|
1753
|
+
greaterThanOrEquals: FilterAttribute;
|
|
1754
|
+
lessThan?: never;
|
|
1755
|
+
lessThanOrEquals?: never;
|
|
1756
|
+
in?: never;
|
|
1757
|
+
notIn?: never;
|
|
1758
|
+
startsWith?: never;
|
|
1759
|
+
andAll?: never;
|
|
1760
|
+
orAll?: never;
|
|
1761
|
+
$unknown?: never;
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value is less than the <code>value</code> in this object are returned.</p>
|
|
1765
|
+
* @public
|
|
1766
|
+
*/
|
|
1767
|
+
interface LessThanMember {
|
|
1768
|
+
equals?: never;
|
|
1769
|
+
notEquals?: never;
|
|
1770
|
+
greaterThan?: never;
|
|
1771
|
+
greaterThanOrEquals?: never;
|
|
1772
|
+
lessThan: FilterAttribute;
|
|
1773
|
+
lessThanOrEquals?: never;
|
|
1774
|
+
in?: never;
|
|
1775
|
+
notIn?: never;
|
|
1776
|
+
startsWith?: never;
|
|
1777
|
+
andAll?: never;
|
|
1778
|
+
orAll?: never;
|
|
1779
|
+
$unknown?: never;
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value is less than or equal to the <code>value</code> in this object are returned.</p>
|
|
1783
|
+
* @public
|
|
1784
|
+
*/
|
|
1785
|
+
interface LessThanOrEqualsMember {
|
|
1786
|
+
equals?: never;
|
|
1787
|
+
notEquals?: never;
|
|
1788
|
+
greaterThan?: never;
|
|
1789
|
+
greaterThanOrEquals?: never;
|
|
1790
|
+
lessThan?: never;
|
|
1791
|
+
lessThanOrEquals: FilterAttribute;
|
|
1792
|
+
in?: never;
|
|
1793
|
+
notIn?: never;
|
|
1794
|
+
startsWith?: never;
|
|
1795
|
+
andAll?: never;
|
|
1796
|
+
orAll?: never;
|
|
1797
|
+
$unknown?: never;
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value is in the list specified in the <code>value</code> in this object are returned.</p>
|
|
1801
|
+
* @public
|
|
1802
|
+
*/
|
|
1803
|
+
interface InMember {
|
|
1804
|
+
equals?: never;
|
|
1805
|
+
notEquals?: never;
|
|
1806
|
+
greaterThan?: never;
|
|
1807
|
+
greaterThanOrEquals?: never;
|
|
1808
|
+
lessThan?: never;
|
|
1809
|
+
lessThanOrEquals?: never;
|
|
1810
|
+
in: FilterAttribute;
|
|
1811
|
+
notIn?: never;
|
|
1812
|
+
startsWith?: never;
|
|
1813
|
+
andAll?: never;
|
|
1814
|
+
orAll?: never;
|
|
1815
|
+
$unknown?: never;
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value isn't in the list specified in the <code>value</code> in this object are returned.</p>
|
|
1819
|
+
* @public
|
|
1820
|
+
*/
|
|
1821
|
+
interface NotInMember {
|
|
1822
|
+
equals?: never;
|
|
1823
|
+
notEquals?: never;
|
|
1824
|
+
greaterThan?: never;
|
|
1825
|
+
greaterThanOrEquals?: never;
|
|
1826
|
+
lessThan?: never;
|
|
1827
|
+
lessThanOrEquals?: never;
|
|
1828
|
+
in?: never;
|
|
1829
|
+
notIn: FilterAttribute;
|
|
1830
|
+
startsWith?: never;
|
|
1831
|
+
andAll?: never;
|
|
1832
|
+
orAll?: never;
|
|
1833
|
+
$unknown?: never;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the <code>key</code> and whose value starts with the <code>value</code> in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.</p>
|
|
1837
|
+
* @public
|
|
1838
|
+
*/
|
|
1839
|
+
interface StartsWithMember {
|
|
1840
|
+
equals?: never;
|
|
1841
|
+
notEquals?: never;
|
|
1842
|
+
greaterThan?: never;
|
|
1843
|
+
greaterThanOrEquals?: never;
|
|
1844
|
+
lessThan?: never;
|
|
1845
|
+
lessThanOrEquals?: never;
|
|
1846
|
+
in?: never;
|
|
1847
|
+
notIn?: never;
|
|
1848
|
+
startsWith: FilterAttribute;
|
|
1849
|
+
andAll?: never;
|
|
1850
|
+
orAll?: never;
|
|
1851
|
+
$unknown?: never;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* <p>Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.</p>
|
|
1855
|
+
* @public
|
|
1856
|
+
*/
|
|
1857
|
+
interface AndAllMember {
|
|
1858
|
+
equals?: never;
|
|
1859
|
+
notEquals?: never;
|
|
1860
|
+
greaterThan?: never;
|
|
1861
|
+
greaterThanOrEquals?: never;
|
|
1862
|
+
lessThan?: never;
|
|
1863
|
+
lessThanOrEquals?: never;
|
|
1864
|
+
in?: never;
|
|
1865
|
+
notIn?: never;
|
|
1866
|
+
startsWith?: never;
|
|
1867
|
+
andAll: RetrievalFilter[];
|
|
1868
|
+
orAll?: never;
|
|
1869
|
+
$unknown?: never;
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* <p>Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.</p>
|
|
1873
|
+
* @public
|
|
1874
|
+
*/
|
|
1875
|
+
interface OrAllMember {
|
|
1876
|
+
equals?: never;
|
|
1877
|
+
notEquals?: never;
|
|
1878
|
+
greaterThan?: never;
|
|
1879
|
+
greaterThanOrEquals?: never;
|
|
1880
|
+
lessThan?: never;
|
|
1881
|
+
lessThanOrEquals?: never;
|
|
1882
|
+
in?: never;
|
|
1883
|
+
notIn?: never;
|
|
1884
|
+
startsWith?: never;
|
|
1885
|
+
andAll?: never;
|
|
1886
|
+
orAll: RetrievalFilter[];
|
|
1887
|
+
$unknown?: never;
|
|
1888
|
+
}
|
|
1462
1889
|
/**
|
|
1463
|
-
* <p>Contains the query made to the knowledge base.</p>
|
|
1464
1890
|
* @public
|
|
1465
1891
|
*/
|
|
1466
|
-
|
|
1892
|
+
interface $UnknownMember {
|
|
1893
|
+
equals?: never;
|
|
1894
|
+
notEquals?: never;
|
|
1895
|
+
greaterThan?: never;
|
|
1896
|
+
greaterThanOrEquals?: never;
|
|
1897
|
+
lessThan?: never;
|
|
1898
|
+
lessThanOrEquals?: never;
|
|
1899
|
+
in?: never;
|
|
1900
|
+
notIn?: never;
|
|
1901
|
+
startsWith?: never;
|
|
1902
|
+
andAll?: never;
|
|
1903
|
+
orAll?: never;
|
|
1904
|
+
$unknown: [string, any];
|
|
1905
|
+
}
|
|
1906
|
+
interface Visitor<T> {
|
|
1907
|
+
equals: (value: FilterAttribute) => T;
|
|
1908
|
+
notEquals: (value: FilterAttribute) => T;
|
|
1909
|
+
greaterThan: (value: FilterAttribute) => T;
|
|
1910
|
+
greaterThanOrEquals: (value: FilterAttribute) => T;
|
|
1911
|
+
lessThan: (value: FilterAttribute) => T;
|
|
1912
|
+
lessThanOrEquals: (value: FilterAttribute) => T;
|
|
1913
|
+
in: (value: FilterAttribute) => T;
|
|
1914
|
+
notIn: (value: FilterAttribute) => T;
|
|
1915
|
+
startsWith: (value: FilterAttribute) => T;
|
|
1916
|
+
andAll: (value: RetrievalFilter[]) => T;
|
|
1917
|
+
orAll: (value: RetrievalFilter[]) => T;
|
|
1918
|
+
_: (name: string, value: any) => T;
|
|
1919
|
+
}
|
|
1920
|
+
const visit: <T>(value: RetrievalFilter, visitor: Visitor<T>) => T;
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* <p>Configurations for how to perform the search query and return results. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1924
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1925
|
+
* <ul>
|
|
1926
|
+
* <li>
|
|
1927
|
+
* <p>
|
|
1928
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax">Retrieve request</a> – in the <code>vectorSearchConfiguration</code> field</p>
|
|
1929
|
+
* </li>
|
|
1930
|
+
* <li>
|
|
1931
|
+
* <p>
|
|
1932
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>vectorSearchConfiguration</code> field</p>
|
|
1933
|
+
* </li>
|
|
1934
|
+
* </ul>
|
|
1935
|
+
* @public
|
|
1936
|
+
*/
|
|
1937
|
+
export interface KnowledgeBaseVectorSearchConfiguration {
|
|
1467
1938
|
/**
|
|
1468
|
-
* <p>
|
|
1939
|
+
* <p>The number of source chunks to retrieve.</p>
|
|
1469
1940
|
* @public
|
|
1470
1941
|
*/
|
|
1471
|
-
|
|
1942
|
+
numberOfResults?: number;
|
|
1472
1943
|
/**
|
|
1473
|
-
* <p>
|
|
1944
|
+
* <p>By default, Amazon Bedrock decides a search strategy for you. If you're using an Amazon OpenSearch Serverless vector store that contains a filterable text field, you can specify whether to query the knowledge base with a <code>HYBRID</code> search using both vector embeddings and raw text, or <code>SEMANTIC</code> search using only vector embeddings. For other vector store configurations, only <code>SEMANTIC</code> search is available. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-test.html">Test a knowledge base</a>.</p>
|
|
1474
1945
|
* @public
|
|
1475
1946
|
*/
|
|
1476
|
-
|
|
1947
|
+
overrideSearchType?: SearchType;
|
|
1948
|
+
/**
|
|
1949
|
+
* <p>Specifies the filters to use on the metadata in the knowledge base data sources before returning results. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1950
|
+
* @public
|
|
1951
|
+
*/
|
|
1952
|
+
filter?: RetrievalFilter;
|
|
1477
1953
|
}
|
|
1478
1954
|
/**
|
|
1479
|
-
* <p>Contains the
|
|
1955
|
+
* <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1956
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1957
|
+
* <ul>
|
|
1958
|
+
* <li>
|
|
1959
|
+
* <p>
|
|
1960
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax">Retrieve request</a> – in the <code>retrievalConfiguration</code> field</p>
|
|
1961
|
+
* </li>
|
|
1962
|
+
* <li>
|
|
1963
|
+
* <p>
|
|
1964
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>retrievalConfiguration</code> field</p>
|
|
1965
|
+
* </li>
|
|
1966
|
+
* </ul>
|
|
1480
1967
|
* @public
|
|
1481
1968
|
*/
|
|
1482
|
-
export interface
|
|
1969
|
+
export interface KnowledgeBaseRetrievalConfiguration {
|
|
1483
1970
|
/**
|
|
1484
|
-
* <p>
|
|
1971
|
+
* <p>Contains details about how the results from the vector search should be returned. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1485
1972
|
* @public
|
|
1486
1973
|
*/
|
|
1487
|
-
|
|
1974
|
+
vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined;
|
|
1488
1975
|
}
|
|
1489
1976
|
/**
|
|
1977
|
+
* <p>Contains details about the resource being queried.</p>
|
|
1978
|
+
* <p>This data type is used in the following API operations:</p>
|
|
1979
|
+
* <ul>
|
|
1980
|
+
* <li>
|
|
1981
|
+
* <p>
|
|
1982
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax">Retrieve request</a> – in the <code>knowledgeBaseConfiguration</code> field</p>
|
|
1983
|
+
* </li>
|
|
1984
|
+
* <li>
|
|
1985
|
+
* <p>
|
|
1986
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>knowledgeBaseConfiguration</code> field</p>
|
|
1987
|
+
* </li>
|
|
1988
|
+
* </ul>
|
|
1490
1989
|
* @public
|
|
1491
1990
|
*/
|
|
1492
|
-
export interface
|
|
1991
|
+
export interface KnowledgeBaseRetrieveAndGenerateConfiguration {
|
|
1493
1992
|
/**
|
|
1494
|
-
* <p>The unique identifier of the
|
|
1993
|
+
* <p>The unique identifier of the knowledge base that is queried and the foundation model used for generation.</p>
|
|
1495
1994
|
* @public
|
|
1496
1995
|
*/
|
|
1497
|
-
|
|
1996
|
+
knowledgeBaseId: string | undefined;
|
|
1498
1997
|
/**
|
|
1499
|
-
* <p>
|
|
1998
|
+
* <p>The ARN of the foundation model used to generate a response.</p>
|
|
1500
1999
|
* @public
|
|
1501
2000
|
*/
|
|
1502
|
-
|
|
2001
|
+
modelArn: string | undefined;
|
|
1503
2002
|
/**
|
|
1504
|
-
* <p>
|
|
2003
|
+
* <p>Contains configurations for how to retrieve and return the knowledge base query.</p>
|
|
1505
2004
|
* @public
|
|
1506
2005
|
*/
|
|
1507
|
-
|
|
1508
|
-
}
|
|
1509
|
-
/**
|
|
1510
|
-
* <p>Contains the query made to the knowledge base.</p>
|
|
1511
|
-
* @public
|
|
1512
|
-
*/
|
|
1513
|
-
export interface KnowledgeBaseQuery {
|
|
2006
|
+
retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration;
|
|
1514
2007
|
/**
|
|
1515
|
-
* <p>
|
|
2008
|
+
* <p>Contains configurations for response generation based on the knowwledge base query results.</p>
|
|
1516
2009
|
* @public
|
|
1517
2010
|
*/
|
|
1518
|
-
|
|
2011
|
+
generationConfiguration?: GenerationConfiguration;
|
|
1519
2012
|
}
|
|
1520
2013
|
/**
|
|
1521
2014
|
* @public
|
|
@@ -1527,12 +2020,12 @@ export interface RetrieveRequest {
|
|
|
1527
2020
|
*/
|
|
1528
2021
|
knowledgeBaseId: string | undefined;
|
|
1529
2022
|
/**
|
|
1530
|
-
* <p>
|
|
2023
|
+
* <p>Contains the query to send the knowledge base.</p>
|
|
1531
2024
|
* @public
|
|
1532
2025
|
*/
|
|
1533
2026
|
retrievalQuery: KnowledgeBaseQuery | undefined;
|
|
1534
2027
|
/**
|
|
1535
|
-
* <p>Contains
|
|
2028
|
+
* <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
1536
2029
|
* @public
|
|
1537
2030
|
*/
|
|
1538
2031
|
retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration;
|
|
@@ -1543,40 +2036,52 @@ export interface RetrieveRequest {
|
|
|
1543
2036
|
nextToken?: string;
|
|
1544
2037
|
}
|
|
1545
2038
|
/**
|
|
1546
|
-
* <p>
|
|
2039
|
+
* <p>Contains details about the resource being queried.</p>
|
|
2040
|
+
* <p>This data type is used in the following API operations:</p>
|
|
2041
|
+
* <ul>
|
|
2042
|
+
* <li>
|
|
2043
|
+
* <p>
|
|
2044
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax">RetrieveAndGenerate request</a> – in the <code>retrieveAndGenerateConfiguration</code> field</p>
|
|
2045
|
+
* </li>
|
|
2046
|
+
* </ul>
|
|
1547
2047
|
* @public
|
|
1548
2048
|
*/
|
|
1549
|
-
export interface
|
|
1550
|
-
/**
|
|
1551
|
-
* <p>Contains a chunk of text from a data source in the knowledge base.</p>
|
|
1552
|
-
* @public
|
|
1553
|
-
*/
|
|
1554
|
-
content: RetrievalResultContent | undefined;
|
|
2049
|
+
export interface RetrieveAndGenerateConfiguration {
|
|
1555
2050
|
/**
|
|
1556
|
-
* <p>
|
|
2051
|
+
* <p>The type of resource that is queried by the request.</p>
|
|
1557
2052
|
* @public
|
|
1558
2053
|
*/
|
|
1559
|
-
|
|
2054
|
+
type: RetrieveAndGenerateType | undefined;
|
|
1560
2055
|
/**
|
|
1561
|
-
* <p>
|
|
2056
|
+
* <p>Contains details about the resource being queried.</p>
|
|
1562
2057
|
* @public
|
|
1563
2058
|
*/
|
|
1564
|
-
|
|
2059
|
+
knowledgeBaseConfiguration?: KnowledgeBaseRetrieveAndGenerateConfiguration;
|
|
1565
2060
|
}
|
|
1566
2061
|
/**
|
|
1567
2062
|
* @public
|
|
1568
2063
|
*/
|
|
1569
|
-
export interface
|
|
2064
|
+
export interface RetrieveAndGenerateRequest {
|
|
1570
2065
|
/**
|
|
1571
|
-
* <p>
|
|
2066
|
+
* <p>The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.</p>
|
|
1572
2067
|
* @public
|
|
1573
2068
|
*/
|
|
1574
|
-
|
|
2069
|
+
sessionId?: string;
|
|
1575
2070
|
/**
|
|
1576
|
-
* <p>
|
|
2071
|
+
* <p>Contains the query to be made to the knowledge base.</p>
|
|
1577
2072
|
* @public
|
|
1578
2073
|
*/
|
|
1579
|
-
|
|
2074
|
+
input: RetrieveAndGenerateInput | undefined;
|
|
2075
|
+
/**
|
|
2076
|
+
* <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
|
|
2077
|
+
* @public
|
|
2078
|
+
*/
|
|
2079
|
+
retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration;
|
|
2080
|
+
/**
|
|
2081
|
+
* <p>Contains details about the session with the knowledge base.</p>
|
|
2082
|
+
* @public
|
|
2083
|
+
*/
|
|
2084
|
+
sessionConfiguration?: RetrieveAndGenerateSessionConfiguration;
|
|
1580
2085
|
}
|
|
1581
2086
|
/**
|
|
1582
2087
|
* @internal
|
|
@@ -1709,7 +2214,11 @@ export declare const RetrieveAndGenerateInputFilterSensitiveLog: (obj: RetrieveA
|
|
|
1709
2214
|
/**
|
|
1710
2215
|
* @internal
|
|
1711
2216
|
*/
|
|
1712
|
-
export declare const
|
|
2217
|
+
export declare const PromptTemplateFilterSensitiveLog: (obj: PromptTemplate) => any;
|
|
2218
|
+
/**
|
|
2219
|
+
* @internal
|
|
2220
|
+
*/
|
|
2221
|
+
export declare const GenerationConfigurationFilterSensitiveLog: (obj: GenerationConfiguration) => any;
|
|
1713
2222
|
/**
|
|
1714
2223
|
* @internal
|
|
1715
2224
|
*/
|
|
@@ -1722,6 +2231,30 @@ export declare const RetrieveAndGenerateResponseFilterSensitiveLog: (obj: Retrie
|
|
|
1722
2231
|
* @internal
|
|
1723
2232
|
*/
|
|
1724
2233
|
export declare const KnowledgeBaseQueryFilterSensitiveLog: (obj: KnowledgeBaseQuery) => any;
|
|
2234
|
+
/**
|
|
2235
|
+
* @internal
|
|
2236
|
+
*/
|
|
2237
|
+
export declare const KnowledgeBaseRetrievalResultFilterSensitiveLog: (obj: KnowledgeBaseRetrievalResult) => any;
|
|
2238
|
+
/**
|
|
2239
|
+
* @internal
|
|
2240
|
+
*/
|
|
2241
|
+
export declare const RetrieveResponseFilterSensitiveLog: (obj: RetrieveResponse) => any;
|
|
2242
|
+
/**
|
|
2243
|
+
* @internal
|
|
2244
|
+
*/
|
|
2245
|
+
export declare const RetrievalFilterFilterSensitiveLog: (obj: RetrievalFilter) => any;
|
|
2246
|
+
/**
|
|
2247
|
+
* @internal
|
|
2248
|
+
*/
|
|
2249
|
+
export declare const KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog: (obj: KnowledgeBaseVectorSearchConfiguration) => any;
|
|
2250
|
+
/**
|
|
2251
|
+
* @internal
|
|
2252
|
+
*/
|
|
2253
|
+
export declare const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog: (obj: KnowledgeBaseRetrievalConfiguration) => any;
|
|
2254
|
+
/**
|
|
2255
|
+
* @internal
|
|
2256
|
+
*/
|
|
2257
|
+
export declare const KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog: (obj: KnowledgeBaseRetrieveAndGenerateConfiguration) => any;
|
|
1725
2258
|
/**
|
|
1726
2259
|
* @internal
|
|
1727
2260
|
*/
|
|
@@ -1729,8 +2262,8 @@ export declare const RetrieveRequestFilterSensitiveLog: (obj: RetrieveRequest) =
|
|
|
1729
2262
|
/**
|
|
1730
2263
|
* @internal
|
|
1731
2264
|
*/
|
|
1732
|
-
export declare const
|
|
2265
|
+
export declare const RetrieveAndGenerateConfigurationFilterSensitiveLog: (obj: RetrieveAndGenerateConfiguration) => any;
|
|
1733
2266
|
/**
|
|
1734
2267
|
* @internal
|
|
1735
2268
|
*/
|
|
1736
|
-
export declare const
|
|
2269
|
+
export declare const RetrieveAndGenerateRequestFilterSensitiveLog: (obj: RetrieveAndGenerateRequest) => any;
|