@aws-sdk/client-bedrock-runtime 3.941.0 → 3.946.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 (48) hide show
  1. package/dist-cjs/index.js +123 -335
  2. package/dist-cjs/runtimeConfig.browser.js +2 -2
  3. package/dist-cjs/runtimeConfig.js +8 -5
  4. package/dist-cjs/runtimeConfig.native.js +3 -1
  5. package/dist-es/BedrockRuntimeClient.js +3 -3
  6. package/dist-es/models/enums.js +19 -0
  7. package/dist-es/runtimeConfig.browser.js +2 -2
  8. package/dist-es/runtimeConfig.js +7 -4
  9. package/dist-es/runtimeConfig.native.js +3 -1
  10. package/dist-es/schemas/schemas_0.js +103 -335
  11. package/dist-types/BedrockRuntime.d.ts +1 -1
  12. package/dist-types/BedrockRuntimeClient.d.ts +13 -13
  13. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +2 -2
  14. package/dist-types/auth/httpAuthSchemeProvider.d.ts +2 -2
  15. package/dist-types/commands/ApplyGuardrailCommand.d.ts +3 -3
  16. package/dist-types/commands/ConverseCommand.d.ts +44 -12
  17. package/dist-types/commands/ConverseStreamCommand.d.ts +40 -8
  18. package/dist-types/commands/CountTokensCommand.d.ts +23 -7
  19. package/dist-types/commands/GetAsyncInvokeCommand.d.ts +3 -3
  20. package/dist-types/commands/InvokeModelCommand.d.ts +2 -2
  21. package/dist-types/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +3 -3
  22. package/dist-types/commands/InvokeModelWithResponseStreamCommand.d.ts +3 -3
  23. package/dist-types/commands/ListAsyncInvokesCommand.d.ts +3 -3
  24. package/dist-types/commands/StartAsyncInvokeCommand.d.ts +3 -3
  25. package/dist-types/endpoint/EndpointParameters.d.ts +13 -1
  26. package/dist-types/endpoint/endpointResolver.d.ts +5 -2
  27. package/dist-types/extensionConfiguration.d.ts +4 -4
  28. package/dist-types/models/BedrockRuntimeServiceException.d.ts +1 -1
  29. package/dist-types/models/enums.d.ts +27 -0
  30. package/dist-types/models/errors.d.ts +1 -1
  31. package/dist-types/models/models_0.d.ts +208 -21
  32. package/dist-types/pagination/Interfaces.d.ts +1 -1
  33. package/dist-types/pagination/ListAsyncInvokesPaginator.d.ts +1 -1
  34. package/dist-types/runtimeConfig.browser.d.ts +1 -1
  35. package/dist-types/runtimeConfig.d.ts +2 -2
  36. package/dist-types/runtimeConfig.native.d.ts +1 -1
  37. package/dist-types/runtimeConfig.shared.d.ts +2 -2
  38. package/dist-types/runtimeExtensions.d.ts +1 -1
  39. package/dist-types/schemas/schemas_0.d.ts +6 -1
  40. package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +3 -3
  41. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +1 -1
  42. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +1 -1
  43. package/dist-types/ts3.4/commands/InvokeModelWithResponseStreamCommand.d.ts +1 -1
  44. package/dist-types/ts3.4/models/BedrockRuntimeServiceException.d.ts +1 -1
  45. package/dist-types/ts3.4/models/enums.d.ts +20 -0
  46. package/dist-types/ts3.4/models/models_0.d.ts +113 -4
  47. package/dist-types/ts3.4/schemas/schemas_0.d.ts +5 -0
  48. package/package.json +14 -13
@@ -10,11 +10,11 @@ const config_resolver_1 = require("@smithy/config-resolver");
10
10
  const eventstream_serde_browser_1 = require("@smithy/eventstream-serde-browser");
11
11
  const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
12
12
  const invalid_dependency_1 = require("@smithy/invalid-dependency");
13
+ const smithy_client_1 = require("@smithy/smithy-client");
13
14
  const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
15
+ const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
14
16
  const util_retry_1 = require("@smithy/util-retry");
15
17
  const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
16
- const smithy_client_1 = require("@smithy/smithy-client");
17
- const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
18
18
  const getRuntimeConfig = (config) => {
19
19
  const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
20
20
  const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
@@ -15,14 +15,13 @@ const hash_node_1 = require("@smithy/hash-node");
15
15
  const middleware_retry_1 = require("@smithy/middleware-retry");
16
16
  const node_config_provider_1 = require("@smithy/node-config-provider");
17
17
  const node_http_handler_1 = require("@smithy/node-http-handler");
18
+ const smithy_client_1 = require("@smithy/smithy-client");
18
19
  const util_body_length_node_1 = require("@smithy/util-body-length-node");
20
+ const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
19
21
  const util_retry_1 = require("@smithy/util-retry");
20
22
  const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
21
- const smithy_client_1 = require("@smithy/smithy-client");
22
- const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
23
- const smithy_client_2 = require("@smithy/smithy-client");
24
23
  const getRuntimeConfig = (config) => {
25
- (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
24
+ (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version);
26
25
  const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
27
26
  const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
28
27
  const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
@@ -67,7 +66,11 @@ const getRuntimeConfig = (config) => {
67
66
  maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
68
67
  region: config?.region ??
69
68
  (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
70
- requestHandler: node_http_handler_1.NodeHttp2Handler.create(config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true }))),
69
+ requestHandler: node_http_handler_1.NodeHttp2Handler.create(config?.requestHandler ??
70
+ (async () => ({
71
+ ...(await defaultConfigProvider()),
72
+ disableConcurrentStreams: true,
73
+ }))),
71
74
  retryMode: config?.retryMode ??
72
75
  (0, node_config_provider_1.loadConfig)({
73
76
  ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
@@ -11,7 +11,9 @@ const getRuntimeConfig = (config) => {
11
11
  ...config,
12
12
  runtime: "react-native",
13
13
  eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
14
- (() => ({ handle: (0, invalid_dependency_1.invalidFunction)("event stream request is not supported in ReactNative.") })),
14
+ (() => ({
15
+ handle: (0, invalid_dependency_1.invalidFunction)("event stream request is not supported in ReactNative."),
16
+ })),
15
17
  sha256: config?.sha256 ?? sha256_js_1.Sha256,
16
18
  };
17
19
  };
@@ -3,14 +3,14 @@ import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middlewa
3
3
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
4
4
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
5
5
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
- import { resolveWebSocketConfig } from "@aws-sdk/middleware-websocket";
6
+ import { resolveWebSocketConfig, } from "@aws-sdk/middleware-websocket";
7
7
  import { resolveRegionConfig } from "@smithy/config-resolver";
8
8
  import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
9
9
  import { getSchemaSerdePlugin } from "@smithy/core/schema";
10
10
  import { resolveEventStreamSerdeConfig, } from "@smithy/eventstream-serde-config-resolver";
11
11
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
12
- import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
13
- import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
12
+ import { resolveEndpointConfig, } from "@smithy/middleware-endpoint";
13
+ import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
14
14
  import { Client as __Client, } from "@smithy/smithy-client";
15
15
  import { defaultBedrockRuntimeHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
16
16
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
@@ -133,6 +133,23 @@ export const GuardrailTrace = {
133
133
  ENABLED: "enabled",
134
134
  ENABLED_FULL: "enabled_full",
135
135
  };
136
+ export const AudioFormat = {
137
+ AAC: "aac",
138
+ FLAC: "flac",
139
+ M4A: "m4a",
140
+ MKA: "mka",
141
+ MKV: "mkv",
142
+ MP3: "mp3",
143
+ MP4: "mp4",
144
+ MPEG: "mpeg",
145
+ MPGA: "mpga",
146
+ OGG: "ogg",
147
+ OPUS: "opus",
148
+ PCM: "pcm",
149
+ WAV: "wav",
150
+ WEBM: "webm",
151
+ X_AAC: "x-aac",
152
+ };
136
153
  export const CachePointType = {
137
154
  DEFAULT: "default",
138
155
  };
@@ -198,6 +215,8 @@ export const StopReason = {
198
215
  CONTENT_FILTERED: "content_filtered",
199
216
  END_TURN: "end_turn",
200
217
  GUARDRAIL_INTERVENED: "guardrail_intervened",
218
+ MALFORMED_MODEL_OUTPUT: "malformed_model_output",
219
+ MALFORMED_TOOL_USE: "malformed_tool_use",
201
220
  MAX_TOKENS: "max_tokens",
202
221
  MODEL_CONTEXT_WINDOW_EXCEEDED: "model_context_window_exceeded",
203
222
  STOP_SEQUENCE: "stop_sequence",
@@ -6,11 +6,11 @@ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smit
6
6
  import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser";
7
7
  import { FetchHttpHandler as HttpRequestHandler, streamCollector } from "@smithy/fetch-http-handler";
8
8
  import { invalidProvider } from "@smithy/invalid-dependency";
9
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
9
10
  import { calculateBodyLength } from "@smithy/util-body-length-browser";
11
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
10
12
  import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
11
13
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
12
- import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
13
- import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
14
14
  export const getRuntimeConfig = (config) => {
15
15
  const defaultsMode = resolveDefaultsModeConfig(config);
16
16
  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
@@ -11,12 +11,11 @@ import { Hash } from "@smithy/hash-node";
11
11
  import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
12
12
  import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
13
13
  import { NodeHttp2Handler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
14
+ import { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from "@smithy/smithy-client";
14
15
  import { calculateBodyLength } from "@smithy/util-body-length-node";
16
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
15
17
  import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
16
18
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
17
- import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
18
- import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
19
- import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
20
19
  export const getRuntimeConfig = (config) => {
21
20
  emitWarningIfUnsupportedVersion(process.version);
22
21
  const defaultsMode = resolveDefaultsModeConfig(config);
@@ -63,7 +62,11 @@ export const getRuntimeConfig = (config) => {
63
62
  maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
64
63
  region: config?.region ??
65
64
  loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
66
- requestHandler: RequestHandler.create(config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true }))),
65
+ requestHandler: RequestHandler.create(config?.requestHandler ??
66
+ (async () => ({
67
+ ...(await defaultConfigProvider()),
68
+ disableConcurrentStreams: true,
69
+ }))),
67
70
  retryMode: config?.retryMode ??
68
71
  loadNodeConfig({
69
72
  ...NODE_RETRY_MODE_CONFIG_OPTIONS,
@@ -8,7 +8,9 @@ export const getRuntimeConfig = (config) => {
8
8
  ...config,
9
9
  runtime: "react-native",
10
10
  eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
11
- (() => ({ handle: invalidFunction("event stream request is not supported in ReactNative.") })),
11
+ (() => ({
12
+ handle: invalidFunction("event stream request is not supported in ReactNative."),
13
+ })),
12
14
  sha256: config?.sha256 ?? Sha256,
13
15
  };
14
16
  };