@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.
Files changed (33) hide show
  1. package/README.md +16 -0
  2. package/dist-cjs/index.js +552 -4
  3. package/dist-es/BedrockAgentRuntime.js +4 -0
  4. package/dist-es/commands/RerankCommand.js +23 -0
  5. package/dist-es/commands/RetrieveAndGenerateStreamCommand.js +27 -0
  6. package/dist-es/commands/index.js +2 -0
  7. package/dist-es/models/models_0.js +191 -0
  8. package/dist-es/pagination/RerankPaginator.js +4 -0
  9. package/dist-es/pagination/index.js +1 -0
  10. package/dist-es/protocols/Aws_restJson1.js +237 -0
  11. package/dist-types/BedrockAgentRuntime.d.ts +14 -0
  12. package/dist-types/BedrockAgentRuntimeClient.d.ts +4 -2
  13. package/dist-types/commands/InvokeAgentCommand.d.ts +55 -2
  14. package/dist-types/commands/InvokeInlineAgentCommand.d.ts +51 -2
  15. package/dist-types/commands/RerankCommand.d.ts +143 -0
  16. package/dist-types/commands/RetrieveAndGenerateCommand.d.ts +42 -2
  17. package/dist-types/commands/RetrieveAndGenerateStreamCommand.d.ts +371 -0
  18. package/dist-types/commands/RetrieveCommand.d.ts +46 -1
  19. package/dist-types/commands/index.d.ts +2 -0
  20. package/dist-types/models/models_0.d.ts +1093 -125
  21. package/dist-types/pagination/RerankPaginator.d.ts +7 -0
  22. package/dist-types/pagination/index.d.ts +1 -0
  23. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  24. package/dist-types/ts3.4/BedrockAgentRuntime.d.ts +34 -0
  25. package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +12 -0
  26. package/dist-types/ts3.4/commands/RerankCommand.d.ts +41 -0
  27. package/dist-types/ts3.4/commands/RetrieveAndGenerateStreamCommand.d.ts +51 -0
  28. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  29. package/dist-types/ts3.4/models/models_0.d.ts +490 -0
  30. package/dist-types/ts3.4/pagination/RerankPaginator.d.ts +11 -0
  31. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  32. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
  33. package/package.json +1 -1
@@ -1357,6 +1357,57 @@ export interface FilterAttribute {
1357
1357
  */
1358
1358
  value: __DocumentType | undefined;
1359
1359
  }
1360
+ /**
1361
+ * @public
1362
+ * @enum
1363
+ */
1364
+ export declare const AttributeType: {
1365
+ readonly BOOLEAN: "BOOLEAN";
1366
+ readonly NUMBER: "NUMBER";
1367
+ readonly STRING: "STRING";
1368
+ readonly STRING_LIST: "STRING_LIST";
1369
+ };
1370
+ /**
1371
+ * @public
1372
+ */
1373
+ export type AttributeType = (typeof AttributeType)[keyof typeof AttributeType];
1374
+ /**
1375
+ * <p>Details about a metadata attribute.</p>
1376
+ * @public
1377
+ */
1378
+ export interface MetadataAttributeSchema {
1379
+ /**
1380
+ * <p>The attribute's key.</p>
1381
+ * @public
1382
+ */
1383
+ key: string | undefined;
1384
+ /**
1385
+ * <p>The attribute's type.</p>
1386
+ * @public
1387
+ */
1388
+ type: AttributeType | undefined;
1389
+ /**
1390
+ * <p>The attribute's description.</p>
1391
+ * @public
1392
+ */
1393
+ description: string | undefined;
1394
+ }
1395
+ /**
1396
+ * <p>Settings for implicit filtering, where a model generates a metadata filter based on the prompt.</p>
1397
+ * @public
1398
+ */
1399
+ export interface ImplicitFilterConfiguration {
1400
+ /**
1401
+ * <p>Metadata that can be used in a filter.</p>
1402
+ * @public
1403
+ */
1404
+ metadataAttributes: MetadataAttributeSchema[] | undefined;
1405
+ /**
1406
+ * <p>The model that generates the filter.</p>
1407
+ * @public
1408
+ */
1409
+ modelArn: string | undefined;
1410
+ }
1360
1411
  /**
1361
1412
  * @public
1362
1413
  * @enum
@@ -1369,6 +1420,151 @@ export declare const SearchType: {
1369
1420
  * @public
1370
1421
  */
1371
1422
  export type SearchType = (typeof SearchType)[keyof typeof SearchType];
1423
+ /**
1424
+ * @public
1425
+ * @enum
1426
+ */
1427
+ export declare const RerankingMetadataSelectionMode: {
1428
+ readonly ALL: "ALL";
1429
+ readonly SELECTIVE: "SELECTIVE";
1430
+ };
1431
+ /**
1432
+ * @public
1433
+ */
1434
+ export type RerankingMetadataSelectionMode = (typeof RerankingMetadataSelectionMode)[keyof typeof RerankingMetadataSelectionMode];
1435
+ /**
1436
+ * <p>Contains information for a metadata field to include in or exclude from consideration when reranking.</p>
1437
+ * @public
1438
+ */
1439
+ export interface FieldForReranking {
1440
+ /**
1441
+ * <p>The name of a metadata field to include in or exclude from consideration when reranking.</p>
1442
+ * @public
1443
+ */
1444
+ fieldName: string | undefined;
1445
+ }
1446
+ /**
1447
+ * <p>Contains configurations for the metadata fields to include or exclude when considering reranking. If you include the <code>fieldsToExclude</code> field, the reranker ignores all the metadata fields that you specify. If you include the <code>fieldsToInclude</code> field, the reranker uses only the metadata fields that you specify and ignores all others. You can include only one of these fields.</p>
1448
+ * @public
1449
+ */
1450
+ export type RerankingMetadataSelectiveModeConfiguration = RerankingMetadataSelectiveModeConfiguration.FieldsToExcludeMember | RerankingMetadataSelectiveModeConfiguration.FieldsToIncludeMember | RerankingMetadataSelectiveModeConfiguration.$UnknownMember;
1451
+ /**
1452
+ * @public
1453
+ */
1454
+ export declare namespace RerankingMetadataSelectiveModeConfiguration {
1455
+ /**
1456
+ * <p>An array of objects, each of which specifies a metadata field to include in consideration when reranking. The remaining metadata fields are ignored.</p>
1457
+ * @public
1458
+ */
1459
+ interface FieldsToIncludeMember {
1460
+ fieldsToInclude: FieldForReranking[];
1461
+ fieldsToExclude?: never;
1462
+ $unknown?: never;
1463
+ }
1464
+ /**
1465
+ * <p>An array of objects, each of which specifies a metadata field to exclude from consideration when reranking.</p>
1466
+ * @public
1467
+ */
1468
+ interface FieldsToExcludeMember {
1469
+ fieldsToInclude?: never;
1470
+ fieldsToExclude: FieldForReranking[];
1471
+ $unknown?: never;
1472
+ }
1473
+ /**
1474
+ * @public
1475
+ */
1476
+ interface $UnknownMember {
1477
+ fieldsToInclude?: never;
1478
+ fieldsToExclude?: never;
1479
+ $unknown: [string, any];
1480
+ }
1481
+ interface Visitor<T> {
1482
+ fieldsToInclude: (value: FieldForReranking[]) => T;
1483
+ fieldsToExclude: (value: FieldForReranking[]) => T;
1484
+ _: (name: string, value: any) => T;
1485
+ }
1486
+ const visit: <T>(value: RerankingMetadataSelectiveModeConfiguration, visitor: Visitor<T>) => T;
1487
+ }
1488
+ /**
1489
+ * <p>Contains configurations for the metadata to use in reranking.</p>
1490
+ * @public
1491
+ */
1492
+ export interface MetadataConfigurationForReranking {
1493
+ /**
1494
+ * <p>Specifies whether to consider all metadata when reranking, or only the metadata that you select. If you specify <code>SELECTIVE</code>, include the <code>selectiveModeConfiguration</code> field.</p>
1495
+ * @public
1496
+ */
1497
+ selectionMode: RerankingMetadataSelectionMode | undefined;
1498
+ /**
1499
+ * <p>Contains configurations for the metadata fields to include or exclude when considering reranking.</p>
1500
+ * @public
1501
+ */
1502
+ selectiveModeConfiguration?: RerankingMetadataSelectiveModeConfiguration | undefined;
1503
+ }
1504
+ /**
1505
+ * <p>Contains configurations for an Amazon Bedrock reranker model.</p>
1506
+ * @public
1507
+ */
1508
+ export interface VectorSearchBedrockRerankingModelConfiguration {
1509
+ /**
1510
+ * <p>The ARN of the reranker model to use.</p>
1511
+ * @public
1512
+ */
1513
+ modelArn: string | undefined;
1514
+ /**
1515
+ * <p>A JSON object whose keys are request fields for the model and whose values are values for those fields.</p>
1516
+ * @public
1517
+ */
1518
+ additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
1519
+ }
1520
+ /**
1521
+ * <p>Contains configurations for reranking with an Amazon Bedrock reranker model.</p>
1522
+ * @public
1523
+ */
1524
+ export interface VectorSearchBedrockRerankingConfiguration {
1525
+ /**
1526
+ * <p>Contains configurations for the reranker model.</p>
1527
+ * @public
1528
+ */
1529
+ modelConfiguration: VectorSearchBedrockRerankingModelConfiguration | undefined;
1530
+ /**
1531
+ * <p>The number of results to return after reranking.</p>
1532
+ * @public
1533
+ */
1534
+ numberOfRerankedResults?: number | undefined;
1535
+ /**
1536
+ * <p>Contains configurations for the metadata to use in reranking.</p>
1537
+ * @public
1538
+ */
1539
+ metadataConfiguration?: MetadataConfigurationForReranking | undefined;
1540
+ }
1541
+ /**
1542
+ * @public
1543
+ * @enum
1544
+ */
1545
+ export declare const VectorSearchRerankingConfigurationType: {
1546
+ readonly BEDROCK_RERANKING_MODEL: "BEDROCK_RERANKING_MODEL";
1547
+ };
1548
+ /**
1549
+ * @public
1550
+ */
1551
+ export type VectorSearchRerankingConfigurationType = (typeof VectorSearchRerankingConfigurationType)[keyof typeof VectorSearchRerankingConfigurationType];
1552
+ /**
1553
+ * <p>Contains configurations for reranking the retrieved results.</p>
1554
+ * @public
1555
+ */
1556
+ export interface VectorSearchRerankingConfiguration {
1557
+ /**
1558
+ * <p>The type of reranker model.</p>
1559
+ * @public
1560
+ */
1561
+ type: VectorSearchRerankingConfigurationType | undefined;
1562
+ /**
1563
+ * <p>Contains configurations for an Amazon Bedrock reranker model.</p>
1564
+ * @public
1565
+ */
1566
+ bedrockRerankingConfiguration?: VectorSearchBedrockRerankingConfiguration | undefined;
1567
+ }
1372
1568
  /**
1373
1569
  * @public
1374
1570
  * @enum
@@ -1547,6 +1743,28 @@ export declare namespace InvocationResultMember {
1547
1743
  }
1548
1744
  const visit: <T>(value: InvocationResultMember, visitor: Visitor<T>) => T;
1549
1745
  }
1746
+ /**
1747
+ * <p>
1748
+ * Configurations for streaming.
1749
+ * </p>
1750
+ * @public
1751
+ */
1752
+ export interface StreamingConfigurations {
1753
+ /**
1754
+ * <p>
1755
+ * Specifies whether to enable streaming for the final response. This is set to <code>false</code> by default.
1756
+ * </p>
1757
+ * @public
1758
+ */
1759
+ streamFinalResponse?: boolean | undefined;
1760
+ /**
1761
+ * <p>
1762
+ * The guardrail interval to apply as response is generated.
1763
+ * </p>
1764
+ * @public
1765
+ */
1766
+ applyGuardrailInterval?: number | undefined;
1767
+ }
1550
1768
  /**
1551
1769
  * <p>Contains information about where the text with a citation begins and ends in the generated output.</p>
1552
1770
  * <p>This data type is used in the following API operations:</p>
@@ -1660,6 +1878,17 @@ export interface RetrievalResultConfluenceLocation {
1660
1878
  */
1661
1879
  url?: string | undefined;
1662
1880
  }
1881
+ /**
1882
+ * <p>Contains information about the location of a document in a custom data source.</p>
1883
+ * @public
1884
+ */
1885
+ export interface RetrievalResultCustomDocumentLocation {
1886
+ /**
1887
+ * <p>The ID of the document.</p>
1888
+ * @public
1889
+ */
1890
+ id?: string | undefined;
1891
+ }
1663
1892
  /**
1664
1893
  * <p>The S3 data source location.</p>
1665
1894
  * <p>This data type is used in the following API operations:</p>
@@ -1714,6 +1943,7 @@ export interface RetrievalResultSharePointLocation {
1714
1943
  */
1715
1944
  export declare const RetrievalResultLocationType: {
1716
1945
  readonly CONFLUENCE: "CONFLUENCE";
1946
+ readonly CUSTOM: "CUSTOM";
1717
1947
  readonly S3: "S3";
1718
1948
  readonly SALESFORCE: "SALESFORCE";
1719
1949
  readonly SHAREPOINT: "SHAREPOINT";
@@ -1784,6 +2014,11 @@ export interface RetrievalResultLocation {
1784
2014
  * @public
1785
2015
  */
1786
2016
  sharePointLocation?: RetrievalResultSharePointLocation | undefined;
2017
+ /**
2018
+ * <p>Specifies the location of a document in a custom data source.</p>
2019
+ * @public
2020
+ */
2021
+ customDocumentLocation?: RetrievalResultCustomDocumentLocation | undefined;
1787
2022
  }
1788
2023
  /**
1789
2024
  * <p>Contains metadata about a source cited for the generated response.</p>
@@ -2139,6 +2374,43 @@ export interface ReturnControlPayload {
2139
2374
  */
2140
2375
  invocationId?: string | undefined;
2141
2376
  }
2377
+ /**
2378
+ * <p>
2379
+ * The event in the custom orchestration sequence. Events are the responses which the custom orchestration Lambda function sends as response to the agent.
2380
+ * </p>
2381
+ * @public
2382
+ */
2383
+ export interface CustomOrchestrationTraceEvent {
2384
+ /**
2385
+ * <p>
2386
+ * The text that prompted the event at this step.
2387
+ * </p>
2388
+ * @public
2389
+ */
2390
+ text?: string | undefined;
2391
+ }
2392
+ /**
2393
+ * <p>
2394
+ * The trace behavior for the custom orchestration.
2395
+ * </p>
2396
+ * @public
2397
+ */
2398
+ export interface CustomOrchestrationTrace {
2399
+ /**
2400
+ * <p>
2401
+ * The unique identifier of the trace.
2402
+ * </p>
2403
+ * @public
2404
+ */
2405
+ traceId?: string | undefined;
2406
+ /**
2407
+ * <p>
2408
+ * The event details used with the custom orchestration.
2409
+ * </p>
2410
+ * @public
2411
+ */
2412
+ event?: CustomOrchestrationTraceEvent | undefined;
2413
+ }
2142
2414
  /**
2143
2415
  * <p>Contains information about the failure of the interaction.</p>
2144
2416
  * @public
@@ -3252,7 +3524,7 @@ export declare namespace PreProcessingTrace {
3252
3524
  * <p>Contains one part of the agent's reasoning process and results from calling API actions and querying knowledge bases. You can use the trace to understand how the agent arrived at the response it provided the customer. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement">Trace enablement</a>.</p>
3253
3525
  * @public
3254
3526
  */
3255
- export type Trace = Trace.FailureTraceMember | Trace.GuardrailTraceMember | Trace.OrchestrationTraceMember | Trace.PostProcessingTraceMember | Trace.PreProcessingTraceMember | Trace.$UnknownMember;
3527
+ export type Trace = Trace.CustomOrchestrationTraceMember | Trace.FailureTraceMember | Trace.GuardrailTraceMember | Trace.OrchestrationTraceMember | Trace.PostProcessingTraceMember | Trace.PreProcessingTraceMember | Trace.$UnknownMember;
3256
3528
  /**
3257
3529
  * @public
3258
3530
  */
@@ -3267,6 +3539,7 @@ export declare namespace Trace {
3267
3539
  orchestrationTrace?: never;
3268
3540
  postProcessingTrace?: never;
3269
3541
  failureTrace?: never;
3542
+ customOrchestrationTrace?: never;
3270
3543
  $unknown?: never;
3271
3544
  }
3272
3545
  /**
@@ -3279,6 +3552,7 @@ export declare namespace Trace {
3279
3552
  orchestrationTrace?: never;
3280
3553
  postProcessingTrace?: never;
3281
3554
  failureTrace?: never;
3555
+ customOrchestrationTrace?: never;
3282
3556
  $unknown?: never;
3283
3557
  }
3284
3558
  /**
@@ -3291,6 +3565,7 @@ export declare namespace Trace {
3291
3565
  orchestrationTrace: OrchestrationTrace;
3292
3566
  postProcessingTrace?: never;
3293
3567
  failureTrace?: never;
3568
+ customOrchestrationTrace?: never;
3294
3569
  $unknown?: never;
3295
3570
  }
3296
3571
  /**
@@ -3303,6 +3578,7 @@ export declare namespace Trace {
3303
3578
  orchestrationTrace?: never;
3304
3579
  postProcessingTrace: PostProcessingTrace;
3305
3580
  failureTrace?: never;
3581
+ customOrchestrationTrace?: never;
3306
3582
  $unknown?: never;
3307
3583
  }
3308
3584
  /**
@@ -3315,6 +3591,22 @@ export declare namespace Trace {
3315
3591
  orchestrationTrace?: never;
3316
3592
  postProcessingTrace?: never;
3317
3593
  failureTrace: FailureTrace;
3594
+ customOrchestrationTrace?: never;
3595
+ $unknown?: never;
3596
+ }
3597
+ /**
3598
+ * <p>
3599
+ * Details about the custom orchestration step in which the agent determines the order in which actions are executed.
3600
+ * </p>
3601
+ * @public
3602
+ */
3603
+ interface CustomOrchestrationTraceMember {
3604
+ guardrailTrace?: never;
3605
+ preProcessingTrace?: never;
3606
+ orchestrationTrace?: never;
3607
+ postProcessingTrace?: never;
3608
+ failureTrace?: never;
3609
+ customOrchestrationTrace: CustomOrchestrationTrace;
3318
3610
  $unknown?: never;
3319
3611
  }
3320
3612
  /**
@@ -3326,6 +3618,7 @@ export declare namespace Trace {
3326
3618
  orchestrationTrace?: never;
3327
3619
  postProcessingTrace?: never;
3328
3620
  failureTrace?: never;
3621
+ customOrchestrationTrace?: never;
3329
3622
  $unknown: [string, any];
3330
3623
  }
3331
3624
  interface Visitor<T> {
@@ -3334,6 +3627,7 @@ export declare namespace Trace {
3334
3627
  orchestrationTrace: (value: OrchestrationTrace) => T;
3335
3628
  postProcessingTrace: (value: PostProcessingTrace) => T;
3336
3629
  failureTrace: (value: FailureTrace) => T;
3630
+ customOrchestrationTrace: (value: CustomOrchestrationTrace) => T;
3337
3631
  _: (name: string, value: any) => T;
3338
3632
  }
3339
3633
  const visit: <T>(value: Trace, visitor: Visitor<T>) => T;
@@ -4692,85 +4986,303 @@ export interface OptimizePromptResponse {
4692
4986
  optimizedPrompt: AsyncIterable<OptimizedPromptStream> | undefined;
4693
4987
  }
4694
4988
  /**
4695
- * <p>Contains the query made to the knowledge base.</p>
4696
- * <p>This data type is used in the following API operations:</p>
4697
- * <ul>
4698
- * <li>
4699
- * <p>
4700
- * <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>
4701
- * </li>
4702
- * </ul>
4989
+ * <p>Contains information about a text document to rerank.</p>
4703
4990
  * @public
4704
4991
  */
4705
- export interface RetrieveAndGenerateInput {
4992
+ export interface RerankTextDocument {
4706
4993
  /**
4707
- * <p>The query made to the knowledge base.</p>
4994
+ * <p>The text of the document.</p>
4708
4995
  * @public
4709
4996
  */
4710
- text: string | undefined;
4997
+ text?: string | undefined;
4711
4998
  }
4712
4999
  /**
4713
- * <p>The configuration details for the guardrail.</p>
4714
5000
  * @public
5001
+ * @enum
4715
5002
  */
4716
- export interface GuardrailConfiguration {
5003
+ export declare const RerankQueryContentType: {
5004
+ readonly TEXT: "TEXT";
5005
+ };
5006
+ /**
5007
+ * @public
5008
+ */
5009
+ export type RerankQueryContentType = (typeof RerankQueryContentType)[keyof typeof RerankQueryContentType];
5010
+ /**
5011
+ * <p>Contains information about a query to submit to the reranker model.</p>
5012
+ * @public
5013
+ */
5014
+ export interface RerankQuery {
4717
5015
  /**
4718
- * <p>The unique identifier for the guardrail.</p>
5016
+ * <p>The type of the query.</p>
4719
5017
  * @public
4720
5018
  */
4721
- guardrailId: string | undefined;
5019
+ type: RerankQueryContentType | undefined;
4722
5020
  /**
4723
- * <p>The version of the guardrail.</p>
5021
+ * <p>Contains information about a text query.</p>
4724
5022
  * @public
4725
5023
  */
4726
- guardrailVersion: string | undefined;
5024
+ textQuery: RerankTextDocument | undefined;
4727
5025
  }
4728
5026
  /**
4729
- * <p>Configuration settings for text generation using a language model via the
4730
- * RetrieveAndGenerate operation. Includes parameters like temperature, top-p, maximum token
4731
- * count, and stop sequences. </p>
4732
- * <note>
4733
- * <p>The valid range of <code>maxTokens</code> depends on the accepted values for your chosen
4734
- * model's inference parameters. To see the inference parameters for your model, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference
4735
- * parameters for foundation models.</a>
4736
- * </p>
4737
- * </note>
5027
+ * <p>Contains configurations for a reranker model.</p>
4738
5028
  * @public
4739
5029
  */
4740
- export interface TextInferenceConfig {
5030
+ export interface BedrockRerankingModelConfiguration {
4741
5031
  /**
4742
- * <p> Controls the random-ness of text generated by the language model, influencing how much the model sticks to the most predictable next words versus exploring more surprising options. A lower temperature value (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more creative or unpredictable. </p>
5032
+ * <p>The ARN of the reranker model.</p>
4743
5033
  * @public
4744
5034
  */
4745
- temperature?: number | undefined;
5035
+ modelArn: string | undefined;
4746
5036
  /**
4747
- * <p> A probability distribution threshold which controls what the model considers for the set of possible next tokens. The model will only consider the top p% of the probability distribution when generating the next token. </p>
5037
+ * <p>A JSON object whose keys are request fields for the model and whose values are values for those fields.</p>
4748
5038
  * @public
4749
5039
  */
4750
- topP?: number | undefined;
5040
+ additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
5041
+ }
5042
+ /**
5043
+ * <p>Contains configurations for an Amazon Bedrock reranker model.</p>
5044
+ * @public
5045
+ */
5046
+ export interface BedrockRerankingConfiguration {
4751
5047
  /**
4752
- * <p>The maximum number of tokens to generate in the output text. Do not use the minimum of 0
4753
- * or the maximum of 65536. The limit values described here are arbitary values, for actual
4754
- * values consult the limits defined by your specific model.</p>
5048
+ * <p>The number of results to return after reranking.</p>
4755
5049
  * @public
4756
5050
  */
4757
- maxTokens?: number | undefined;
5051
+ numberOfResults?: number | undefined;
4758
5052
  /**
4759
- * <p>A list of sequences of characters that, if generated, will cause the model to stop
4760
- * generating further tokens. Do not use a minimum length of 1 or a maximum length of 1000. The
4761
- * limit values described here are arbitary values, for actual values consult the limits defined
4762
- * by your specific model.</p>
5053
+ * <p>Contains configurations for a reranker model.</p>
4763
5054
  * @public
4764
5055
  */
4765
- stopSequences?: string[] | undefined;
5056
+ modelConfiguration: BedrockRerankingModelConfiguration | undefined;
4766
5057
  }
4767
5058
  /**
4768
- * <p> The configuration for inference settings when generating responses using RetrieveAndGenerate. </p>
4769
5059
  * @public
5060
+ * @enum
4770
5061
  */
4771
- export interface InferenceConfig {
4772
- /**
4773
- * <p> Configuration settings specific to text generation while generating responses using RetrieveAndGenerate. </p>
5062
+ export declare const RerankingConfigurationType: {
5063
+ readonly BEDROCK_RERANKING_MODEL: "BEDROCK_RERANKING_MODEL";
5064
+ };
5065
+ /**
5066
+ * @public
5067
+ */
5068
+ export type RerankingConfigurationType = (typeof RerankingConfigurationType)[keyof typeof RerankingConfigurationType];
5069
+ /**
5070
+ * <p>Contains configurations for reranking.</p>
5071
+ * @public
5072
+ */
5073
+ export interface RerankingConfiguration {
5074
+ /**
5075
+ * <p>The type of reranker that the configurations apply to.</p>
5076
+ * @public
5077
+ */
5078
+ type: RerankingConfigurationType | undefined;
5079
+ /**
5080
+ * <p>Contains configurations for an Amazon Bedrock reranker.</p>
5081
+ * @public
5082
+ */
5083
+ bedrockRerankingConfiguration: BedrockRerankingConfiguration | undefined;
5084
+ }
5085
+ /**
5086
+ * @public
5087
+ * @enum
5088
+ */
5089
+ export declare const RerankDocumentType: {
5090
+ readonly JSON: "JSON";
5091
+ readonly TEXT: "TEXT";
5092
+ };
5093
+ /**
5094
+ * @public
5095
+ */
5096
+ export type RerankDocumentType = (typeof RerankDocumentType)[keyof typeof RerankDocumentType];
5097
+ /**
5098
+ * <p>Contains information about a document to rerank. Choose the <code>type</code> to define and include the field that corresponds to the type.</p>
5099
+ * @public
5100
+ */
5101
+ export interface RerankDocument {
5102
+ /**
5103
+ * <p>The type of document to rerank.</p>
5104
+ * @public
5105
+ */
5106
+ type: RerankDocumentType | undefined;
5107
+ /**
5108
+ * <p>Contains information about a text document to rerank.</p>
5109
+ * @public
5110
+ */
5111
+ textDocument?: RerankTextDocument | undefined;
5112
+ /**
5113
+ * <p>Contains a JSON document to rerank.</p>
5114
+ * @public
5115
+ */
5116
+ jsonDocument?: __DocumentType | undefined;
5117
+ }
5118
+ /**
5119
+ * @public
5120
+ * @enum
5121
+ */
5122
+ export declare const RerankSourceType: {
5123
+ readonly INLINE: "INLINE";
5124
+ };
5125
+ /**
5126
+ * @public
5127
+ */
5128
+ export type RerankSourceType = (typeof RerankSourceType)[keyof typeof RerankSourceType];
5129
+ /**
5130
+ * <p>Contains information about a source for reranking.</p>
5131
+ * @public
5132
+ */
5133
+ export interface RerankSource {
5134
+ /**
5135
+ * <p>The type of the source.</p>
5136
+ * @public
5137
+ */
5138
+ type: RerankSourceType | undefined;
5139
+ /**
5140
+ * <p>Contains an inline definition of a source for reranking.</p>
5141
+ * @public
5142
+ */
5143
+ inlineDocumentSource: RerankDocument | undefined;
5144
+ }
5145
+ /**
5146
+ * @public
5147
+ */
5148
+ export interface RerankRequest {
5149
+ /**
5150
+ * <p>An array of objects, each of which contains information about a query to submit to the reranker model.</p>
5151
+ * @public
5152
+ */
5153
+ queries: RerankQuery[] | undefined;
5154
+ /**
5155
+ * <p>An array of objects, each of which contains information about the sources to rerank.</p>
5156
+ * @public
5157
+ */
5158
+ sources: RerankSource[] | undefined;
5159
+ /**
5160
+ * <p>Contains configurations for reranking.</p>
5161
+ * @public
5162
+ */
5163
+ rerankingConfiguration: RerankingConfiguration | undefined;
5164
+ /**
5165
+ * <p>If the total number of results was greater than could fit in a response, a token is returned in the <code>nextToken</code> field. You can enter that token in this field to return the next batch of results.</p>
5166
+ * @public
5167
+ */
5168
+ nextToken?: string | undefined;
5169
+ }
5170
+ /**
5171
+ * <p>Contains information about a document that was reranked.</p>
5172
+ * @public
5173
+ */
5174
+ export interface RerankResult {
5175
+ /**
5176
+ * <p>The ranking of the document. The lower a number, the higher the document is ranked.</p>
5177
+ * @public
5178
+ */
5179
+ index: number | undefined;
5180
+ /**
5181
+ * <p>The relevance score of the document.</p>
5182
+ * @public
5183
+ */
5184
+ relevanceScore: number | undefined;
5185
+ /**
5186
+ * <p>Contains information about the document.</p>
5187
+ * @public
5188
+ */
5189
+ document?: RerankDocument | undefined;
5190
+ }
5191
+ /**
5192
+ * @public
5193
+ */
5194
+ export interface RerankResponse {
5195
+ /**
5196
+ * <p>An array of objects, each of which contains information about the results of reranking.</p>
5197
+ * @public
5198
+ */
5199
+ results: RerankResult[] | undefined;
5200
+ /**
5201
+ * <p>If the total number of results is greater than can fit in the response, use this token in the <code>nextToken</code> field when making another request to return the next batch of results.</p>
5202
+ * @public
5203
+ */
5204
+ nextToken?: string | undefined;
5205
+ }
5206
+ /**
5207
+ * <p>Contains the query made to the knowledge base.</p>
5208
+ * <p>This data type is used in the following API operations:</p>
5209
+ * <ul>
5210
+ * <li>
5211
+ * <p>
5212
+ * <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>
5213
+ * </li>
5214
+ * </ul>
5215
+ * @public
5216
+ */
5217
+ export interface RetrieveAndGenerateInput {
5218
+ /**
5219
+ * <p>The query made to the knowledge base.</p>
5220
+ * @public
5221
+ */
5222
+ text: string | undefined;
5223
+ }
5224
+ /**
5225
+ * <p>The configuration details for the guardrail.</p>
5226
+ * @public
5227
+ */
5228
+ export interface GuardrailConfiguration {
5229
+ /**
5230
+ * <p>The unique identifier for the guardrail.</p>
5231
+ * @public
5232
+ */
5233
+ guardrailId: string | undefined;
5234
+ /**
5235
+ * <p>The version of the guardrail.</p>
5236
+ * @public
5237
+ */
5238
+ guardrailVersion: string | undefined;
5239
+ }
5240
+ /**
5241
+ * <p>Configuration settings for text generation using a language model via the
5242
+ * RetrieveAndGenerate operation. Includes parameters like temperature, top-p, maximum token
5243
+ * count, and stop sequences. </p>
5244
+ * <note>
5245
+ * <p>The valid range of <code>maxTokens</code> depends on the accepted values for your chosen
5246
+ * model's inference parameters. To see the inference parameters for your model, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference
5247
+ * parameters for foundation models.</a>
5248
+ * </p>
5249
+ * </note>
5250
+ * @public
5251
+ */
5252
+ export interface TextInferenceConfig {
5253
+ /**
5254
+ * <p> Controls the random-ness of text generated by the language model, influencing how much the model sticks to the most predictable next words versus exploring more surprising options. A lower temperature value (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more creative or unpredictable. </p>
5255
+ * @public
5256
+ */
5257
+ temperature?: number | undefined;
5258
+ /**
5259
+ * <p> A probability distribution threshold which controls what the model considers for the set of possible next tokens. The model will only consider the top p% of the probability distribution when generating the next token. </p>
5260
+ * @public
5261
+ */
5262
+ topP?: number | undefined;
5263
+ /**
5264
+ * <p>The maximum number of tokens to generate in the output text. Do not use the minimum of 0
5265
+ * or the maximum of 65536. The limit values described here are arbitary values, for actual
5266
+ * values consult the limits defined by your specific model.</p>
5267
+ * @public
5268
+ */
5269
+ maxTokens?: number | undefined;
5270
+ /**
5271
+ * <p>A list of sequences of characters that, if generated, will cause the model to stop
5272
+ * generating further tokens. Do not use a minimum length of 1 or a maximum length of 1000. The
5273
+ * limit values described here are arbitary values, for actual values consult the limits defined
5274
+ * by your specific model.</p>
5275
+ * @public
5276
+ */
5277
+ stopSequences?: string[] | undefined;
5278
+ }
5279
+ /**
5280
+ * <p> The configuration for inference settings when generating responses using RetrieveAndGenerate. </p>
5281
+ * @public
5282
+ */
5283
+ export interface InferenceConfig {
5284
+ /**
5285
+ * <p> Configuration settings specific to text generation while generating responses using RetrieveAndGenerate. </p>
4774
5286
  * @public
4775
5287
  */
4776
5288
  textInferenceConfig?: TextInferenceConfig | undefined;
@@ -4981,111 +5493,435 @@ export interface QueryTransformationConfiguration {
4981
5493
  */
4982
5494
  export interface OrchestrationConfiguration {
4983
5495
  /**
4984
- * <p>Contains the template for the prompt that's sent to the model. Orchestration prompts must include the <code>$conversation_history$</code> and <code>$output_format_instructions$</code> variables. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html">Use placeholder variables</a> in the user guide.</p>
5496
+ * <p>Contains the template for the prompt that's sent to the model. Orchestration prompts must include the <code>$conversation_history$</code> and <code>$output_format_instructions$</code> variables. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html">Use placeholder variables</a> in the user guide.</p>
5497
+ * @public
5498
+ */
5499
+ promptTemplate?: PromptTemplate | undefined;
5500
+ /**
5501
+ * <p> Configuration settings for inference when using RetrieveAndGenerate to generate responses while using a knowledge base as a source. </p>
5502
+ * @public
5503
+ */
5504
+ inferenceConfig?: InferenceConfig | undefined;
5505
+ /**
5506
+ * <p> Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used. </p>
5507
+ * @public
5508
+ */
5509
+ additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
5510
+ /**
5511
+ * <p>To split up the prompt and retrieve multiple sources, set the transformation type to
5512
+ * <code>QUERY_DECOMPOSITION</code>.</p>
5513
+ * @public
5514
+ */
5515
+ queryTransformationConfiguration?: QueryTransformationConfiguration | undefined;
5516
+ }
5517
+ /**
5518
+ * @public
5519
+ * @enum
5520
+ */
5521
+ export declare const RetrieveAndGenerateType: {
5522
+ readonly EXTERNAL_SOURCES: "EXTERNAL_SOURCES";
5523
+ readonly KNOWLEDGE_BASE: "KNOWLEDGE_BASE";
5524
+ };
5525
+ /**
5526
+ * @public
5527
+ */
5528
+ export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typeof RetrieveAndGenerateType];
5529
+ /**
5530
+ * <p>Contains configuration about the session with the knowledge base.</p>
5531
+ * <p>This data type is used in the following API operations:</p>
5532
+ * <ul>
5533
+ * <li>
5534
+ * <p>
5535
+ * <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>
5536
+ * </li>
5537
+ * </ul>
5538
+ * @public
5539
+ */
5540
+ export interface RetrieveAndGenerateSessionConfiguration {
5541
+ /**
5542
+ * <p>The ARN of the KMS key encrypting the session.</p>
5543
+ * @public
5544
+ */
5545
+ kmsKeyArn: string | undefined;
5546
+ }
5547
+ /**
5548
+ * @public
5549
+ * @enum
5550
+ */
5551
+ export declare const GuadrailAction: {
5552
+ readonly INTERVENED: "INTERVENED";
5553
+ readonly NONE: "NONE";
5554
+ };
5555
+ /**
5556
+ * @public
5557
+ */
5558
+ export type GuadrailAction = (typeof GuadrailAction)[keyof typeof GuadrailAction];
5559
+ /**
5560
+ * <p>Contains the response generated from querying the knowledge base.</p>
5561
+ * <p>This data type is used in the following API operations:</p>
5562
+ * <ul>
5563
+ * <li>
5564
+ * <p>
5565
+ * <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>
5566
+ * </li>
5567
+ * </ul>
5568
+ * @public
5569
+ */
5570
+ export interface RetrieveAndGenerateOutput {
5571
+ /**
5572
+ * <p>The response generated from querying the knowledge base.</p>
5573
+ * @public
5574
+ */
5575
+ text: string | undefined;
5576
+ }
5577
+ /**
5578
+ * @public
5579
+ */
5580
+ export interface RetrieveAndGenerateResponse {
5581
+ /**
5582
+ * <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
5583
+ * @public
5584
+ */
5585
+ sessionId: string | undefined;
5586
+ /**
5587
+ * <p>Contains the response generated from querying the knowledge base.</p>
5588
+ * @public
5589
+ */
5590
+ output: RetrieveAndGenerateOutput | undefined;
5591
+ /**
5592
+ * <p>A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.</p>
5593
+ * @public
5594
+ */
5595
+ citations?: Citation[] | undefined;
5596
+ /**
5597
+ * <p>Specifies if there is a guardrail intervention in the response.</p>
5598
+ * @public
5599
+ */
5600
+ guardrailAction?: GuadrailAction | undefined;
5601
+ }
5602
+ /**
5603
+ * <p>A citation event.</p>
5604
+ * @public
5605
+ */
5606
+ export interface CitationEvent {
5607
+ /**
5608
+ * <p>The citation.</p>
5609
+ * @public
5610
+ */
5611
+ citation?: Citation | undefined;
5612
+ }
5613
+ /**
5614
+ * <p>A guardrail event.</p>
5615
+ * @public
5616
+ */
5617
+ export interface GuardrailEvent {
5618
+ /**
5619
+ * <p>The guardrail action.</p>
5620
+ * @public
5621
+ */
5622
+ action?: GuadrailAction | undefined;
5623
+ }
5624
+ /**
5625
+ * <p>A retrieve and generate output event.</p>
5626
+ * @public
5627
+ */
5628
+ export interface RetrieveAndGenerateOutputEvent {
5629
+ /**
5630
+ * <p>A text response.</p>
5631
+ * @public
5632
+ */
5633
+ text: string | undefined;
5634
+ }
5635
+ /**
5636
+ * <p>A retrieve and generate stream response output.</p>
5637
+ * @public
5638
+ */
5639
+ export type RetrieveAndGenerateStreamResponseOutput = RetrieveAndGenerateStreamResponseOutput.AccessDeniedExceptionMember | RetrieveAndGenerateStreamResponseOutput.BadGatewayExceptionMember | RetrieveAndGenerateStreamResponseOutput.CitationMember | RetrieveAndGenerateStreamResponseOutput.ConflictExceptionMember | RetrieveAndGenerateStreamResponseOutput.DependencyFailedExceptionMember | RetrieveAndGenerateStreamResponseOutput.GuardrailMember | RetrieveAndGenerateStreamResponseOutput.InternalServerExceptionMember | RetrieveAndGenerateStreamResponseOutput.OutputMember | RetrieveAndGenerateStreamResponseOutput.ResourceNotFoundExceptionMember | RetrieveAndGenerateStreamResponseOutput.ServiceQuotaExceededExceptionMember | RetrieveAndGenerateStreamResponseOutput.ThrottlingExceptionMember | RetrieveAndGenerateStreamResponseOutput.ValidationExceptionMember | RetrieveAndGenerateStreamResponseOutput.$UnknownMember;
5640
+ /**
5641
+ * @public
5642
+ */
5643
+ export declare namespace RetrieveAndGenerateStreamResponseOutput {
5644
+ /**
5645
+ * <p>An output event.</p>
5646
+ * @public
5647
+ */
5648
+ interface OutputMember {
5649
+ output: RetrieveAndGenerateOutputEvent;
5650
+ citation?: never;
5651
+ guardrail?: never;
5652
+ internalServerException?: never;
5653
+ validationException?: never;
5654
+ resourceNotFoundException?: never;
5655
+ serviceQuotaExceededException?: never;
5656
+ throttlingException?: never;
5657
+ accessDeniedException?: never;
5658
+ conflictException?: never;
5659
+ dependencyFailedException?: never;
5660
+ badGatewayException?: never;
5661
+ $unknown?: never;
5662
+ }
5663
+ /**
5664
+ * <p>A citation event.</p>
5665
+ * @public
5666
+ */
5667
+ interface CitationMember {
5668
+ output?: never;
5669
+ citation: CitationEvent;
5670
+ guardrail?: never;
5671
+ internalServerException?: never;
5672
+ validationException?: never;
5673
+ resourceNotFoundException?: never;
5674
+ serviceQuotaExceededException?: never;
5675
+ throttlingException?: never;
5676
+ accessDeniedException?: never;
5677
+ conflictException?: never;
5678
+ dependencyFailedException?: never;
5679
+ badGatewayException?: never;
5680
+ $unknown?: never;
5681
+ }
5682
+ /**
5683
+ * <p>A guardrail event.</p>
5684
+ * @public
5685
+ */
5686
+ interface GuardrailMember {
5687
+ output?: never;
5688
+ citation?: never;
5689
+ guardrail: GuardrailEvent;
5690
+ internalServerException?: never;
5691
+ validationException?: never;
5692
+ resourceNotFoundException?: never;
5693
+ serviceQuotaExceededException?: never;
5694
+ throttlingException?: never;
5695
+ accessDeniedException?: never;
5696
+ conflictException?: never;
5697
+ dependencyFailedException?: never;
5698
+ badGatewayException?: never;
5699
+ $unknown?: never;
5700
+ }
5701
+ /**
5702
+ * <p>An internal server error occurred. Retry your request.</p>
5703
+ * @public
5704
+ */
5705
+ interface InternalServerExceptionMember {
5706
+ output?: never;
5707
+ citation?: never;
5708
+ guardrail?: never;
5709
+ internalServerException: InternalServerException;
5710
+ validationException?: never;
5711
+ resourceNotFoundException?: never;
5712
+ serviceQuotaExceededException?: never;
5713
+ throttlingException?: never;
5714
+ accessDeniedException?: never;
5715
+ conflictException?: never;
5716
+ dependencyFailedException?: never;
5717
+ badGatewayException?: never;
5718
+ $unknown?: never;
5719
+ }
5720
+ /**
5721
+ * <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
5722
+ * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide.</p>
5723
+ * @public
5724
+ */
5725
+ interface ValidationExceptionMember {
5726
+ output?: never;
5727
+ citation?: never;
5728
+ guardrail?: never;
5729
+ internalServerException?: never;
5730
+ validationException: ValidationException;
5731
+ resourceNotFoundException?: never;
5732
+ serviceQuotaExceededException?: never;
5733
+ throttlingException?: never;
5734
+ accessDeniedException?: never;
5735
+ conflictException?: never;
5736
+ dependencyFailedException?: never;
5737
+ badGatewayException?: never;
5738
+ $unknown?: never;
5739
+ }
5740
+ /**
5741
+ * <p>The specified resource ARN was not found. For troubleshooting this error,
5742
+ * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide.</p>
5743
+ * @public
5744
+ */
5745
+ interface ResourceNotFoundExceptionMember {
5746
+ output?: never;
5747
+ citation?: never;
5748
+ guardrail?: never;
5749
+ internalServerException?: never;
5750
+ validationException?: never;
5751
+ resourceNotFoundException: ResourceNotFoundException;
5752
+ serviceQuotaExceededException?: never;
5753
+ throttlingException?: never;
5754
+ accessDeniedException?: never;
5755
+ conflictException?: never;
5756
+ dependencyFailedException?: never;
5757
+ badGatewayException?: never;
5758
+ $unknown?: never;
5759
+ }
5760
+ /**
5761
+ * <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
5762
+ * @public
5763
+ */
5764
+ interface ServiceQuotaExceededExceptionMember {
5765
+ output?: never;
5766
+ citation?: never;
5767
+ guardrail?: never;
5768
+ internalServerException?: never;
5769
+ validationException?: never;
5770
+ resourceNotFoundException?: never;
5771
+ serviceQuotaExceededException: ServiceQuotaExceededException;
5772
+ throttlingException?: never;
5773
+ accessDeniedException?: never;
5774
+ conflictException?: never;
5775
+ dependencyFailedException?: never;
5776
+ badGatewayException?: never;
5777
+ $unknown?: never;
5778
+ }
5779
+ /**
5780
+ * <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
5781
+ * troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide.</p>
5782
+ * @public
5783
+ */
5784
+ interface ThrottlingExceptionMember {
5785
+ output?: never;
5786
+ citation?: never;
5787
+ guardrail?: never;
5788
+ internalServerException?: never;
5789
+ validationException?: never;
5790
+ resourceNotFoundException?: never;
5791
+ serviceQuotaExceededException?: never;
5792
+ throttlingException: ThrottlingException;
5793
+ accessDeniedException?: never;
5794
+ conflictException?: never;
5795
+ dependencyFailedException?: never;
5796
+ badGatewayException?: never;
5797
+ $unknown?: never;
5798
+ }
5799
+ /**
5800
+ * <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
5801
+ * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide.</p>
4985
5802
  * @public
4986
5803
  */
4987
- promptTemplate?: PromptTemplate | undefined;
5804
+ interface AccessDeniedExceptionMember {
5805
+ output?: never;
5806
+ citation?: never;
5807
+ guardrail?: never;
5808
+ internalServerException?: never;
5809
+ validationException?: never;
5810
+ resourceNotFoundException?: never;
5811
+ serviceQuotaExceededException?: never;
5812
+ throttlingException?: never;
5813
+ accessDeniedException: AccessDeniedException;
5814
+ conflictException?: never;
5815
+ dependencyFailedException?: never;
5816
+ badGatewayException?: never;
5817
+ $unknown?: never;
5818
+ }
4988
5819
  /**
4989
- * <p> Configuration settings for inference when using RetrieveAndGenerate to generate responses while using a knowledge base as a source. </p>
5820
+ * <p>Error occurred because of a conflict while performing an operation.</p>
4990
5821
  * @public
4991
5822
  */
4992
- inferenceConfig?: InferenceConfig | undefined;
5823
+ interface ConflictExceptionMember {
5824
+ output?: never;
5825
+ citation?: never;
5826
+ guardrail?: never;
5827
+ internalServerException?: never;
5828
+ validationException?: never;
5829
+ resourceNotFoundException?: never;
5830
+ serviceQuotaExceededException?: never;
5831
+ throttlingException?: never;
5832
+ accessDeniedException?: never;
5833
+ conflictException: ConflictException;
5834
+ dependencyFailedException?: never;
5835
+ badGatewayException?: never;
5836
+ $unknown?: never;
5837
+ }
4993
5838
  /**
4994
- * <p> Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used. </p>
5839
+ * <p>The request failed due to a dependency error.</p>
4995
5840
  * @public
4996
5841
  */
4997
- additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
5842
+ interface DependencyFailedExceptionMember {
5843
+ output?: never;
5844
+ citation?: never;
5845
+ guardrail?: never;
5846
+ internalServerException?: never;
5847
+ validationException?: never;
5848
+ resourceNotFoundException?: never;
5849
+ serviceQuotaExceededException?: never;
5850
+ throttlingException?: never;
5851
+ accessDeniedException?: never;
5852
+ conflictException?: never;
5853
+ dependencyFailedException: DependencyFailedException;
5854
+ badGatewayException?: never;
5855
+ $unknown?: never;
5856
+ }
4998
5857
  /**
4999
- * <p>To split up the prompt and retrieve multiple sources, set the transformation type to
5000
- * <code>QUERY_DECOMPOSITION</code>.</p>
5858
+ * <p>The request failed due to a bad gateway error.</p>
5001
5859
  * @public
5002
5860
  */
5003
- queryTransformationConfiguration?: QueryTransformationConfiguration | undefined;
5004
- }
5005
- /**
5006
- * @public
5007
- * @enum
5008
- */
5009
- export declare const RetrieveAndGenerateType: {
5010
- readonly EXTERNAL_SOURCES: "EXTERNAL_SOURCES";
5011
- readonly KNOWLEDGE_BASE: "KNOWLEDGE_BASE";
5012
- };
5013
- /**
5014
- * @public
5015
- */
5016
- export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typeof RetrieveAndGenerateType];
5017
- /**
5018
- * <p>Contains configuration about the session with the knowledge base.</p>
5019
- * <p>This data type is used in the following API operations:</p>
5020
- * <ul>
5021
- * <li>
5022
- * <p>
5023
- * <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>
5024
- * </li>
5025
- * </ul>
5026
- * @public
5027
- */
5028
- export interface RetrieveAndGenerateSessionConfiguration {
5861
+ interface BadGatewayExceptionMember {
5862
+ output?: never;
5863
+ citation?: never;
5864
+ guardrail?: never;
5865
+ internalServerException?: never;
5866
+ validationException?: never;
5867
+ resourceNotFoundException?: never;
5868
+ serviceQuotaExceededException?: never;
5869
+ throttlingException?: never;
5870
+ accessDeniedException?: never;
5871
+ conflictException?: never;
5872
+ dependencyFailedException?: never;
5873
+ badGatewayException: BadGatewayException;
5874
+ $unknown?: never;
5875
+ }
5029
5876
  /**
5030
- * <p>The ARN of the KMS key encrypting the session.</p>
5031
5877
  * @public
5032
5878
  */
5033
- kmsKeyArn: string | undefined;
5879
+ interface $UnknownMember {
5880
+ output?: never;
5881
+ citation?: never;
5882
+ guardrail?: never;
5883
+ internalServerException?: never;
5884
+ validationException?: never;
5885
+ resourceNotFoundException?: never;
5886
+ serviceQuotaExceededException?: never;
5887
+ throttlingException?: never;
5888
+ accessDeniedException?: never;
5889
+ conflictException?: never;
5890
+ dependencyFailedException?: never;
5891
+ badGatewayException?: never;
5892
+ $unknown: [string, any];
5893
+ }
5894
+ interface Visitor<T> {
5895
+ output: (value: RetrieveAndGenerateOutputEvent) => T;
5896
+ citation: (value: CitationEvent) => T;
5897
+ guardrail: (value: GuardrailEvent) => T;
5898
+ internalServerException: (value: InternalServerException) => T;
5899
+ validationException: (value: ValidationException) => T;
5900
+ resourceNotFoundException: (value: ResourceNotFoundException) => T;
5901
+ serviceQuotaExceededException: (value: ServiceQuotaExceededException) => T;
5902
+ throttlingException: (value: ThrottlingException) => T;
5903
+ accessDeniedException: (value: AccessDeniedException) => T;
5904
+ conflictException: (value: ConflictException) => T;
5905
+ dependencyFailedException: (value: DependencyFailedException) => T;
5906
+ badGatewayException: (value: BadGatewayException) => T;
5907
+ _: (name: string, value: any) => T;
5908
+ }
5909
+ const visit: <T>(value: RetrieveAndGenerateStreamResponseOutput, visitor: Visitor<T>) => T;
5034
5910
  }
5035
5911
  /**
5036
- * @public
5037
- * @enum
5038
- */
5039
- export declare const GuadrailAction: {
5040
- readonly INTERVENED: "INTERVENED";
5041
- readonly NONE: "NONE";
5042
- };
5043
- /**
5044
- * @public
5045
- */
5046
- export type GuadrailAction = (typeof GuadrailAction)[keyof typeof GuadrailAction];
5047
- /**
5048
- * <p>Contains the response generated from querying the knowledge base.</p>
5049
- * <p>This data type is used in the following API operations:</p>
5050
- * <ul>
5051
- * <li>
5052
- * <p>
5053
- * <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>
5054
- * </li>
5055
- * </ul>
5056
5912
  * @public
5057
5913
  */
5058
- export interface RetrieveAndGenerateOutput {
5914
+ export interface RetrieveAndGenerateStreamResponse {
5059
5915
  /**
5060
- * <p>The response generated from querying the knowledge base.</p>
5916
+ * <p>A stream of events from the model.</p>
5061
5917
  * @public
5062
5918
  */
5063
- text: string | undefined;
5064
- }
5065
- /**
5066
- * @public
5067
- */
5068
- export interface RetrieveAndGenerateResponse {
5919
+ stream: AsyncIterable<RetrieveAndGenerateStreamResponseOutput> | undefined;
5069
5920
  /**
5070
- * <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
5921
+ * <p>The session ID.</p>
5071
5922
  * @public
5072
5923
  */
5073
5924
  sessionId: string | undefined;
5074
- /**
5075
- * <p>Contains the response generated from querying the knowledge base.</p>
5076
- * @public
5077
- */
5078
- output: RetrieveAndGenerateOutput | undefined;
5079
- /**
5080
- * <p>A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.</p>
5081
- * @public
5082
- */
5083
- citations?: Citation[] | undefined;
5084
- /**
5085
- * <p>Specifies if there is a guardrail intervention in the response.</p>
5086
- * @public
5087
- */
5088
- guardrailAction?: GuadrailAction | undefined;
5089
5925
  }
5090
5926
  /**
5091
5927
  * <p>Contains the query made to the knowledge base.</p>
@@ -5147,6 +5983,11 @@ export interface RetrieveResponse {
5147
5983
  * @public
5148
5984
  */
5149
5985
  retrievalResults: KnowledgeBaseRetrievalResult[] | undefined;
5986
+ /**
5987
+ * <p>Specifies if there is a guardrail intervention in the response.</p>
5988
+ * @public
5989
+ */
5990
+ guardrailAction?: GuadrailAction | undefined;
5150
5991
  /**
5151
5992
  * <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>
5152
5993
  * @public
@@ -5555,6 +6396,16 @@ export interface KnowledgeBaseVectorSearchConfiguration {
5555
6396
  * @public
5556
6397
  */
5557
6398
  filter?: RetrievalFilter | undefined;
6399
+ /**
6400
+ * <p>Contains configurations for reranking the retrieved results. 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>
6401
+ * @public
6402
+ */
6403
+ rerankingConfiguration?: VectorSearchRerankingConfiguration | undefined;
6404
+ /**
6405
+ * <p>Settings for implicit filtering.</p>
6406
+ * @public
6407
+ */
6408
+ implicitFilterConfiguration?: ImplicitFilterConfiguration | undefined;
5558
6409
  }
5559
6410
  /**
5560
6411
  * <p>Contains configurations for knowledge base query. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
@@ -5684,6 +6535,11 @@ export interface RetrieveRequest {
5684
6535
  * @public
5685
6536
  */
5686
6537
  retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | undefined;
6538
+ /**
6539
+ * <p>Guardrail settings.</p>
6540
+ * @public
6541
+ */
6542
+ guardrailConfiguration?: GuardrailConfiguration | undefined;
5687
6543
  /**
5688
6544
  * <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>
5689
6545
  * @public
@@ -5849,6 +6705,31 @@ export interface RetrieveAndGenerateRequest {
5849
6705
  */
5850
6706
  sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined;
5851
6707
  }
6708
+ /**
6709
+ * @public
6710
+ */
6711
+ export interface RetrieveAndGenerateStreamRequest {
6712
+ /**
6713
+ * <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
6714
+ * @public
6715
+ */
6716
+ sessionId?: string | undefined;
6717
+ /**
6718
+ * <p>Contains the query to be made to the knowledge base.</p>
6719
+ * @public
6720
+ */
6721
+ input: RetrieveAndGenerateInput | undefined;
6722
+ /**
6723
+ * <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>
6724
+ * @public
6725
+ */
6726
+ retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration | undefined;
6727
+ /**
6728
+ * <p>Contains details about the session with the knowledge base.</p>
6729
+ * @public
6730
+ */
6731
+ sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined;
6732
+ }
5852
6733
  /**
5853
6734
  * <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>
5854
6735
  * @public
@@ -5938,6 +6819,13 @@ export interface InvokeAgentRequest {
5938
6819
  * @public
5939
6820
  */
5940
6821
  memoryId?: string | undefined;
6822
+ /**
6823
+ * <p>
6824
+ * Specifies the configurations for streaming.
6825
+ * </p>
6826
+ * @public
6827
+ */
6828
+ streamingConfigurations?: StreamingConfigurations | undefined;
5941
6829
  }
5942
6830
  /**
5943
6831
  * @internal
@@ -6039,6 +6927,30 @@ export declare const FileSourceFilterSensitiveLog: (obj: FileSource) => any;
6039
6927
  * @internal
6040
6928
  */
6041
6929
  export declare const InputFileFilterSensitiveLog: (obj: InputFile) => any;
6930
+ /**
6931
+ * @internal
6932
+ */
6933
+ export declare const MetadataAttributeSchemaFilterSensitiveLog: (obj: MetadataAttributeSchema) => any;
6934
+ /**
6935
+ * @internal
6936
+ */
6937
+ export declare const ImplicitFilterConfigurationFilterSensitiveLog: (obj: ImplicitFilterConfiguration) => any;
6938
+ /**
6939
+ * @internal
6940
+ */
6941
+ export declare const RerankingMetadataSelectiveModeConfigurationFilterSensitiveLog: (obj: RerankingMetadataSelectiveModeConfiguration) => any;
6942
+ /**
6943
+ * @internal
6944
+ */
6945
+ export declare const MetadataConfigurationForRerankingFilterSensitiveLog: (obj: MetadataConfigurationForReranking) => any;
6946
+ /**
6947
+ * @internal
6948
+ */
6949
+ export declare const VectorSearchBedrockRerankingConfigurationFilterSensitiveLog: (obj: VectorSearchBedrockRerankingConfiguration) => any;
6950
+ /**
6951
+ * @internal
6952
+ */
6953
+ export declare const VectorSearchRerankingConfigurationFilterSensitiveLog: (obj: VectorSearchRerankingConfiguration) => any;
6042
6954
  /**
6043
6955
  * @internal
6044
6956
  */
@@ -6099,6 +7011,14 @@ export declare const InvocationInputMemberFilterSensitiveLog: (obj: InvocationIn
6099
7011
  * @internal
6100
7012
  */
6101
7013
  export declare const ReturnControlPayloadFilterSensitiveLog: (obj: ReturnControlPayload) => any;
7014
+ /**
7015
+ * @internal
7016
+ */
7017
+ export declare const CustomOrchestrationTraceEventFilterSensitiveLog: (obj: CustomOrchestrationTraceEvent) => any;
7018
+ /**
7019
+ * @internal
7020
+ */
7021
+ export declare const CustomOrchestrationTraceFilterSensitiveLog: (obj: CustomOrchestrationTrace) => any;
6102
7022
  /**
6103
7023
  * @internal
6104
7024
  */
@@ -6311,6 +7231,34 @@ export declare const OptimizedPromptStreamFilterSensitiveLog: (obj: OptimizedPro
6311
7231
  * @internal
6312
7232
  */
6313
7233
  export declare const OptimizePromptResponseFilterSensitiveLog: (obj: OptimizePromptResponse) => any;
7234
+ /**
7235
+ * @internal
7236
+ */
7237
+ export declare const RerankTextDocumentFilterSensitiveLog: (obj: RerankTextDocument) => any;
7238
+ /**
7239
+ * @internal
7240
+ */
7241
+ export declare const RerankQueryFilterSensitiveLog: (obj: RerankQuery) => any;
7242
+ /**
7243
+ * @internal
7244
+ */
7245
+ export declare const RerankDocumentFilterSensitiveLog: (obj: RerankDocument) => any;
7246
+ /**
7247
+ * @internal
7248
+ */
7249
+ export declare const RerankSourceFilterSensitiveLog: (obj: RerankSource) => any;
7250
+ /**
7251
+ * @internal
7252
+ */
7253
+ export declare const RerankRequestFilterSensitiveLog: (obj: RerankRequest) => any;
7254
+ /**
7255
+ * @internal
7256
+ */
7257
+ export declare const RerankResultFilterSensitiveLog: (obj: RerankResult) => any;
7258
+ /**
7259
+ * @internal
7260
+ */
7261
+ export declare const RerankResponseFilterSensitiveLog: (obj: RerankResponse) => any;
6314
7262
  /**
6315
7263
  * @internal
6316
7264
  */
@@ -6351,6 +7299,22 @@ export declare const RetrieveAndGenerateOutputFilterSensitiveLog: (obj: Retrieve
6351
7299
  * @internal
6352
7300
  */
6353
7301
  export declare const RetrieveAndGenerateResponseFilterSensitiveLog: (obj: RetrieveAndGenerateResponse) => any;
7302
+ /**
7303
+ * @internal
7304
+ */
7305
+ export declare const CitationEventFilterSensitiveLog: (obj: CitationEvent) => any;
7306
+ /**
7307
+ * @internal
7308
+ */
7309
+ export declare const RetrieveAndGenerateOutputEventFilterSensitiveLog: (obj: RetrieveAndGenerateOutputEvent) => any;
7310
+ /**
7311
+ * @internal
7312
+ */
7313
+ export declare const RetrieveAndGenerateStreamResponseOutputFilterSensitiveLog: (obj: RetrieveAndGenerateStreamResponseOutput) => any;
7314
+ /**
7315
+ * @internal
7316
+ */
7317
+ export declare const RetrieveAndGenerateStreamResponseFilterSensitiveLog: (obj: RetrieveAndGenerateStreamResponse) => any;
6354
7318
  /**
6355
7319
  * @internal
6356
7320
  */
@@ -6403,6 +7367,10 @@ export declare const InvokeInlineAgentRequestFilterSensitiveLog: (obj: InvokeInl
6403
7367
  * @internal
6404
7368
  */
6405
7369
  export declare const RetrieveAndGenerateRequestFilterSensitiveLog: (obj: RetrieveAndGenerateRequest) => any;
7370
+ /**
7371
+ * @internal
7372
+ */
7373
+ export declare const RetrieveAndGenerateStreamRequestFilterSensitiveLog: (obj: RetrieveAndGenerateStreamRequest) => any;
6406
7374
  /**
6407
7375
  * @internal
6408
7376
  */