@aws-sdk/client-bedrock-runtime 3.782.0 → 3.785.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 (38) hide show
  1. package/README.md +8 -0
  2. package/dist-cjs/index.js +232 -8
  3. package/dist-cjs/runtimeConfig.browser.js +2 -0
  4. package/dist-cjs/runtimeConfig.js +2 -0
  5. package/dist-cjs/runtimeConfig.native.js +3 -0
  6. package/dist-es/BedrockRuntime.js +2 -0
  7. package/dist-es/BedrockRuntimeClient.js +4 -2
  8. package/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js +30 -0
  9. package/dist-es/commands/index.js +1 -0
  10. package/dist-es/models/models_0.js +78 -0
  11. package/dist-es/protocols/Aws_restJson1.js +105 -2
  12. package/dist-es/runtimeConfig.browser.js +3 -1
  13. package/dist-es/runtimeConfig.js +2 -0
  14. package/dist-es/runtimeConfig.native.js +3 -0
  15. package/dist-types/BedrockRuntime.d.ts +7 -0
  16. package/dist-types/BedrockRuntimeClient.d.ts +12 -4
  17. package/dist-types/commands/ApplyGuardrailCommand.d.ts +15 -6
  18. package/dist-types/commands/ConverseCommand.d.ts +28 -13
  19. package/dist-types/commands/ConverseStreamCommand.d.ts +28 -13
  20. package/dist-types/commands/InvokeModelCommand.d.ts +1 -1
  21. package/dist-types/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +144 -0
  22. package/dist-types/commands/InvokeModelWithResponseStreamCommand.d.ts +1 -1
  23. package/dist-types/commands/index.d.ts +1 -0
  24. package/dist-types/models/models_0.d.ts +302 -0
  25. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  26. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  27. package/dist-types/runtimeConfig.d.ts +1 -0
  28. package/dist-types/runtimeConfig.native.d.ts +1 -0
  29. package/dist-types/ts3.4/BedrockRuntime.d.ts +23 -0
  30. package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +14 -0
  31. package/dist-types/ts3.4/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +51 -0
  32. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  33. package/dist-types/ts3.4/models/models_0.d.ts +179 -0
  34. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  35. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
  36. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
  37. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
  38. package/package.json +3 -1
@@ -216,6 +216,12 @@ export declare namespace GuardrailContentBlock {
216
216
  }
217
217
  const visit: <T>(value: GuardrailContentBlock, visitor: Visitor<T>) => T;
218
218
  }
219
+ export declare const GuardrailOutputScope: {
220
+ readonly FULL: "FULL";
221
+ readonly INTERVENTIONS: "INTERVENTIONS";
222
+ };
223
+ export type GuardrailOutputScope =
224
+ (typeof GuardrailOutputScope)[keyof typeof GuardrailOutputScope];
219
225
  export declare const GuardrailContentSource: {
220
226
  readonly INPUT: "INPUT";
221
227
  readonly OUTPUT: "OUTPUT";
@@ -227,6 +233,7 @@ export interface ApplyGuardrailRequest {
227
233
  guardrailVersion: string | undefined;
228
234
  source: GuardrailContentSource | undefined;
229
235
  content: GuardrailContentBlock[] | undefined;
236
+ outputScope?: GuardrailOutputScope | undefined;
230
237
  }
231
238
  export declare const GuardrailAction: {
232
239
  readonly GUARDRAIL_INTERVENED: "GUARDRAIL_INTERVENED";
@@ -236,6 +243,7 @@ export type GuardrailAction =
236
243
  (typeof GuardrailAction)[keyof typeof GuardrailAction];
237
244
  export declare const GuardrailContentPolicyAction: {
238
245
  readonly BLOCKED: "BLOCKED";
246
+ readonly NONE: "NONE";
239
247
  };
240
248
  export type GuardrailContentPolicyAction =
241
249
  (typeof GuardrailContentPolicyAction)[keyof typeof GuardrailContentPolicyAction];
@@ -270,6 +278,7 @@ export interface GuardrailContentFilter {
270
278
  confidence: GuardrailContentFilterConfidence | undefined;
271
279
  filterStrength?: GuardrailContentFilterStrength | undefined;
272
280
  action: GuardrailContentPolicyAction | undefined;
281
+ detected?: boolean | undefined;
273
282
  }
274
283
  export interface GuardrailContentPolicyAssessment {
275
284
  filters: GuardrailContentFilter[] | undefined;
@@ -291,6 +300,7 @@ export interface GuardrailContextualGroundingFilter {
291
300
  threshold: number | undefined;
292
301
  score: number | undefined;
293
302
  action: GuardrailContextualGroundingPolicyAction | undefined;
303
+ detected?: boolean | undefined;
294
304
  }
295
305
  export interface GuardrailContextualGroundingPolicyAssessment {
296
306
  filters?: GuardrailContextualGroundingFilter[] | undefined;
@@ -324,6 +334,7 @@ export interface GuardrailInvocationMetrics {
324
334
  export declare const GuardrailSensitiveInformationPolicyAction: {
325
335
  readonly ANONYMIZED: "ANONYMIZED";
326
336
  readonly BLOCKED: "BLOCKED";
337
+ readonly NONE: "NONE";
327
338
  };
328
339
  export type GuardrailSensitiveInformationPolicyAction =
329
340
  (typeof GuardrailSensitiveInformationPolicyAction)[keyof typeof GuardrailSensitiveInformationPolicyAction];
@@ -366,12 +377,14 @@ export interface GuardrailPiiEntityFilter {
366
377
  match: string | undefined;
367
378
  type: GuardrailPiiEntityType | undefined;
368
379
  action: GuardrailSensitiveInformationPolicyAction | undefined;
380
+ detected?: boolean | undefined;
369
381
  }
370
382
  export interface GuardrailRegexFilter {
371
383
  name?: string | undefined;
372
384
  match?: string | undefined;
373
385
  regex?: string | undefined;
374
386
  action: GuardrailSensitiveInformationPolicyAction | undefined;
387
+ detected?: boolean | undefined;
375
388
  }
376
389
  export interface GuardrailSensitiveInformationPolicyAssessment {
377
390
  piiEntities: GuardrailPiiEntityFilter[] | undefined;
@@ -379,6 +392,7 @@ export interface GuardrailSensitiveInformationPolicyAssessment {
379
392
  }
380
393
  export declare const GuardrailTopicPolicyAction: {
381
394
  readonly BLOCKED: "BLOCKED";
395
+ readonly NONE: "NONE";
382
396
  };
383
397
  export type GuardrailTopicPolicyAction =
384
398
  (typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
@@ -391,18 +405,21 @@ export interface GuardrailTopic {
391
405
  name: string | undefined;
392
406
  type: GuardrailTopicType | undefined;
393
407
  action: GuardrailTopicPolicyAction | undefined;
408
+ detected?: boolean | undefined;
394
409
  }
395
410
  export interface GuardrailTopicPolicyAssessment {
396
411
  topics: GuardrailTopic[] | undefined;
397
412
  }
398
413
  export declare const GuardrailWordPolicyAction: {
399
414
  readonly BLOCKED: "BLOCKED";
415
+ readonly NONE: "NONE";
400
416
  };
401
417
  export type GuardrailWordPolicyAction =
402
418
  (typeof GuardrailWordPolicyAction)[keyof typeof GuardrailWordPolicyAction];
403
419
  export interface GuardrailCustomWord {
404
420
  match: string | undefined;
405
421
  action: GuardrailWordPolicyAction | undefined;
422
+ detected?: boolean | undefined;
406
423
  }
407
424
  export declare const GuardrailManagedWordType: {
408
425
  readonly PROFANITY: "PROFANITY";
@@ -413,6 +430,7 @@ export interface GuardrailManagedWord {
413
430
  match: string | undefined;
414
431
  type: GuardrailManagedWordType | undefined;
415
432
  action: GuardrailWordPolicyAction | undefined;
433
+ detected?: boolean | undefined;
416
434
  }
417
435
  export interface GuardrailWordPolicyAssessment {
418
436
  customWords: GuardrailCustomWord[] | undefined;
@@ -436,6 +454,7 @@ export interface GuardrailOutputContent {
436
454
  export interface ApplyGuardrailResponse {
437
455
  usage: GuardrailUsage | undefined;
438
456
  action: GuardrailAction | undefined;
457
+ actionReason?: string | undefined;
439
458
  outputs: GuardrailOutputContent[] | undefined;
440
459
  assessments: GuardrailAssessment[] | undefined;
441
460
  guardrailCoverage?: GuardrailCoverage | undefined;
@@ -443,6 +462,7 @@ export interface ApplyGuardrailResponse {
443
462
  export declare const GuardrailTrace: {
444
463
  readonly DISABLED: "disabled";
445
464
  readonly ENABLED: "enabled";
465
+ readonly ENABLED_FULL: "enabled_full";
446
466
  };
447
467
  export type GuardrailTrace =
448
468
  (typeof GuardrailTrace)[keyof typeof GuardrailTrace];
@@ -1125,6 +1145,7 @@ export interface GuardrailTraceAssessment {
1125
1145
  modelOutput?: string[] | undefined;
1126
1146
  inputAssessment?: Record<string, GuardrailAssessment> | undefined;
1127
1147
  outputAssessments?: Record<string, GuardrailAssessment[]> | undefined;
1148
+ actionReason?: string | undefined;
1128
1149
  }
1129
1150
  export interface PromptRouterTrace {
1130
1151
  invokedModelId?: string | undefined;
@@ -1543,6 +1564,7 @@ export interface ConverseStreamResponse {
1543
1564
  export declare const Trace: {
1544
1565
  readonly DISABLED: "DISABLED";
1545
1566
  readonly ENABLED: "ENABLED";
1567
+ readonly ENABLED_FULL: "ENABLED_FULL";
1546
1568
  };
1547
1569
  export type Trace = (typeof Trace)[keyof typeof Trace];
1548
1570
  export interface InvokeModelRequest {
@@ -1560,6 +1582,145 @@ export interface InvokeModelResponse {
1560
1582
  contentType: string | undefined;
1561
1583
  performanceConfigLatency?: PerformanceConfigLatency | undefined;
1562
1584
  }
1585
+ export interface BidirectionalInputPayloadPart {
1586
+ bytes?: Uint8Array | undefined;
1587
+ }
1588
+ export type InvokeModelWithBidirectionalStreamInput =
1589
+ | InvokeModelWithBidirectionalStreamInput.ChunkMember
1590
+ | InvokeModelWithBidirectionalStreamInput.$UnknownMember;
1591
+ export declare namespace InvokeModelWithBidirectionalStreamInput {
1592
+ interface ChunkMember {
1593
+ chunk: BidirectionalInputPayloadPart;
1594
+ $unknown?: never;
1595
+ }
1596
+ interface $UnknownMember {
1597
+ chunk?: never;
1598
+ $unknown: [string, any];
1599
+ }
1600
+ interface Visitor<T> {
1601
+ chunk: (value: BidirectionalInputPayloadPart) => T;
1602
+ _: (name: string, value: any) => T;
1603
+ }
1604
+ const visit: <T>(
1605
+ value: InvokeModelWithBidirectionalStreamInput,
1606
+ visitor: Visitor<T>
1607
+ ) => T;
1608
+ }
1609
+ export interface InvokeModelWithBidirectionalStreamRequest {
1610
+ modelId: string | undefined;
1611
+ body: AsyncIterable<InvokeModelWithBidirectionalStreamInput> | undefined;
1612
+ }
1613
+ export interface BidirectionalOutputPayloadPart {
1614
+ bytes?: Uint8Array | undefined;
1615
+ }
1616
+ export type InvokeModelWithBidirectionalStreamOutput =
1617
+ | InvokeModelWithBidirectionalStreamOutput.ChunkMember
1618
+ | InvokeModelWithBidirectionalStreamOutput.InternalServerExceptionMember
1619
+ | InvokeModelWithBidirectionalStreamOutput.ModelStreamErrorExceptionMember
1620
+ | InvokeModelWithBidirectionalStreamOutput.ModelTimeoutExceptionMember
1621
+ | InvokeModelWithBidirectionalStreamOutput.ServiceUnavailableExceptionMember
1622
+ | InvokeModelWithBidirectionalStreamOutput.ThrottlingExceptionMember
1623
+ | InvokeModelWithBidirectionalStreamOutput.ValidationExceptionMember
1624
+ | InvokeModelWithBidirectionalStreamOutput.$UnknownMember;
1625
+ export declare namespace InvokeModelWithBidirectionalStreamOutput {
1626
+ interface ChunkMember {
1627
+ chunk: BidirectionalOutputPayloadPart;
1628
+ internalServerException?: never;
1629
+ modelStreamErrorException?: never;
1630
+ validationException?: never;
1631
+ throttlingException?: never;
1632
+ modelTimeoutException?: never;
1633
+ serviceUnavailableException?: never;
1634
+ $unknown?: never;
1635
+ }
1636
+ interface InternalServerExceptionMember {
1637
+ chunk?: never;
1638
+ internalServerException: InternalServerException;
1639
+ modelStreamErrorException?: never;
1640
+ validationException?: never;
1641
+ throttlingException?: never;
1642
+ modelTimeoutException?: never;
1643
+ serviceUnavailableException?: never;
1644
+ $unknown?: never;
1645
+ }
1646
+ interface ModelStreamErrorExceptionMember {
1647
+ chunk?: never;
1648
+ internalServerException?: never;
1649
+ modelStreamErrorException: ModelStreamErrorException;
1650
+ validationException?: never;
1651
+ throttlingException?: never;
1652
+ modelTimeoutException?: never;
1653
+ serviceUnavailableException?: never;
1654
+ $unknown?: never;
1655
+ }
1656
+ interface ValidationExceptionMember {
1657
+ chunk?: never;
1658
+ internalServerException?: never;
1659
+ modelStreamErrorException?: never;
1660
+ validationException: ValidationException;
1661
+ throttlingException?: never;
1662
+ modelTimeoutException?: never;
1663
+ serviceUnavailableException?: never;
1664
+ $unknown?: never;
1665
+ }
1666
+ interface ThrottlingExceptionMember {
1667
+ chunk?: never;
1668
+ internalServerException?: never;
1669
+ modelStreamErrorException?: never;
1670
+ validationException?: never;
1671
+ throttlingException: ThrottlingException;
1672
+ modelTimeoutException?: never;
1673
+ serviceUnavailableException?: never;
1674
+ $unknown?: never;
1675
+ }
1676
+ interface ModelTimeoutExceptionMember {
1677
+ chunk?: never;
1678
+ internalServerException?: never;
1679
+ modelStreamErrorException?: never;
1680
+ validationException?: never;
1681
+ throttlingException?: never;
1682
+ modelTimeoutException: ModelTimeoutException;
1683
+ serviceUnavailableException?: never;
1684
+ $unknown?: never;
1685
+ }
1686
+ interface ServiceUnavailableExceptionMember {
1687
+ chunk?: never;
1688
+ internalServerException?: never;
1689
+ modelStreamErrorException?: never;
1690
+ validationException?: never;
1691
+ throttlingException?: never;
1692
+ modelTimeoutException?: never;
1693
+ serviceUnavailableException: ServiceUnavailableException;
1694
+ $unknown?: never;
1695
+ }
1696
+ interface $UnknownMember {
1697
+ chunk?: never;
1698
+ internalServerException?: never;
1699
+ modelStreamErrorException?: never;
1700
+ validationException?: never;
1701
+ throttlingException?: never;
1702
+ modelTimeoutException?: never;
1703
+ serviceUnavailableException?: never;
1704
+ $unknown: [string, any];
1705
+ }
1706
+ interface Visitor<T> {
1707
+ chunk: (value: BidirectionalOutputPayloadPart) => T;
1708
+ internalServerException: (value: InternalServerException) => T;
1709
+ modelStreamErrorException: (value: ModelStreamErrorException) => T;
1710
+ validationException: (value: ValidationException) => T;
1711
+ throttlingException: (value: ThrottlingException) => T;
1712
+ modelTimeoutException: (value: ModelTimeoutException) => T;
1713
+ serviceUnavailableException: (value: ServiceUnavailableException) => T;
1714
+ _: (name: string, value: any) => T;
1715
+ }
1716
+ const visit: <T>(
1717
+ value: InvokeModelWithBidirectionalStreamOutput,
1718
+ visitor: Visitor<T>
1719
+ ) => T;
1720
+ }
1721
+ export interface InvokeModelWithBidirectionalStreamResponse {
1722
+ body: AsyncIterable<InvokeModelWithBidirectionalStreamOutput> | undefined;
1723
+ }
1563
1724
  export interface InvokeModelWithResponseStreamRequest {
1564
1725
  body?: Uint8Array | undefined;
1565
1726
  contentType?: string | undefined;
@@ -1757,6 +1918,24 @@ export declare const InvokeModelRequestFilterSensitiveLog: (
1757
1918
  export declare const InvokeModelResponseFilterSensitiveLog: (
1758
1919
  obj: InvokeModelResponse
1759
1920
  ) => any;
1921
+ export declare const BidirectionalInputPayloadPartFilterSensitiveLog: (
1922
+ obj: BidirectionalInputPayloadPart
1923
+ ) => any;
1924
+ export declare const InvokeModelWithBidirectionalStreamInputFilterSensitiveLog: (
1925
+ obj: InvokeModelWithBidirectionalStreamInput
1926
+ ) => any;
1927
+ export declare const InvokeModelWithBidirectionalStreamRequestFilterSensitiveLog: (
1928
+ obj: InvokeModelWithBidirectionalStreamRequest
1929
+ ) => any;
1930
+ export declare const BidirectionalOutputPayloadPartFilterSensitiveLog: (
1931
+ obj: BidirectionalOutputPayloadPart
1932
+ ) => any;
1933
+ export declare const InvokeModelWithBidirectionalStreamOutputFilterSensitiveLog: (
1934
+ obj: InvokeModelWithBidirectionalStreamOutput
1935
+ ) => any;
1936
+ export declare const InvokeModelWithBidirectionalStreamResponseFilterSensitiveLog: (
1937
+ obj: InvokeModelWithBidirectionalStreamResponse
1938
+ ) => any;
1760
1939
  export declare const InvokeModelWithResponseStreamRequestFilterSensitiveLog: (
1761
1940
  obj: InvokeModelWithResponseStreamRequest
1762
1941
  ) => any;
@@ -26,6 +26,10 @@ import {
26
26
  InvokeModelCommandInput,
27
27
  InvokeModelCommandOutput,
28
28
  } from "../commands/InvokeModelCommand";
29
+ import {
30
+ InvokeModelWithBidirectionalStreamCommandInput,
31
+ InvokeModelWithBidirectionalStreamCommandOutput,
32
+ } from "../commands/InvokeModelWithBidirectionalStreamCommand";
29
33
  import {
30
34
  InvokeModelWithResponseStreamCommandInput,
31
35
  InvokeModelWithResponseStreamCommandOutput,
@@ -58,6 +62,10 @@ export declare const se_InvokeModelCommand: (
58
62
  input: InvokeModelCommandInput,
59
63
  context: __SerdeContext
60
64
  ) => Promise<__HttpRequest>;
65
+ export declare const se_InvokeModelWithBidirectionalStreamCommand: (
66
+ input: InvokeModelWithBidirectionalStreamCommandInput,
67
+ context: __SerdeContext & __EventStreamSerdeContext
68
+ ) => Promise<__HttpRequest>;
61
69
  export declare const se_InvokeModelWithResponseStreamCommand: (
62
70
  input: InvokeModelWithResponseStreamCommandInput,
63
71
  context: __SerdeContext
@@ -90,6 +98,10 @@ export declare const de_InvokeModelCommand: (
90
98
  output: __HttpResponse,
91
99
  context: __SerdeContext
92
100
  ) => Promise<InvokeModelCommandOutput>;
101
+ export declare const de_InvokeModelWithBidirectionalStreamCommand: (
102
+ output: __HttpResponse,
103
+ context: __SerdeContext & __EventStreamSerdeContext
104
+ ) => Promise<InvokeModelWithBidirectionalStreamCommandOutput>;
93
105
  export declare const de_InvokeModelWithResponseStreamCommand: (
94
106
  output: __HttpResponse,
95
107
  context: __SerdeContext & __EventStreamSerdeContext
@@ -16,6 +16,7 @@ export declare const getRuntimeConfig: (config: BedrockRuntimeClientConfig) => {
16
16
  | import("@aws-sdk/util-user-agent-browser").PreviouslyResolved
17
17
  | undefined
18
18
  ) => Promise<import("@smithy/types").UserAgent>;
19
+ eventStreamPayloadHandlerProvider: import("@smithy/types").EventStreamPayloadHandlerProvider;
19
20
  eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
20
21
  maxAttempts: number | import("@smithy/types").Provider<number>;
21
22
  region: string | import("@smithy/types").Provider<any>;
@@ -20,6 +20,7 @@ export declare const getRuntimeConfig: (config: BedrockRuntimeClientConfig) => {
20
20
  | import("@aws-sdk/util-user-agent-node").PreviouslyResolved
21
21
  | undefined
22
22
  ) => Promise<import("@smithy/types").UserAgent>;
23
+ eventStreamPayloadHandlerProvider: import("@smithy/types").EventStreamPayloadHandlerProvider;
23
24
  eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
24
25
  maxAttempts: number | import("@smithy/types").Provider<number>;
25
26
  region: string | import("@smithy/types").Provider<string>;
@@ -1,6 +1,7 @@
1
1
  import { BedrockRuntimeClientConfig } from "./BedrockRuntimeClient";
2
2
  export declare const getRuntimeConfig: (config: BedrockRuntimeClientConfig) => {
3
3
  runtime: string;
4
+ eventStreamPayloadHandlerProvider: import("@smithy/types").EventStreamPayloadHandlerProvider;
4
5
  sha256: import("@smithy/types").HashConstructor;
5
6
  requestHandler:
6
7
  | import("@smithy/types").NodeHttpHandlerOptions
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-bedrock-runtime",
3
3
  "description": "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.782.0",
4
+ "version": "3.785.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -22,6 +22,8 @@
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
23
  "@aws-sdk/core": "3.775.0",
24
24
  "@aws-sdk/credential-provider-node": "3.782.0",
25
+ "@aws-sdk/eventstream-handler-node": "3.775.0",
26
+ "@aws-sdk/middleware-eventstream": "3.775.0",
25
27
  "@aws-sdk/middleware-host-header": "3.775.0",
26
28
  "@aws-sdk/middleware-logger": "3.775.0",
27
29
  "@aws-sdk/middleware-recursion-detection": "3.775.0",