@aws-sdk/client-bedrock-runtime 3.839.0 → 3.842.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 (40) hide show
  1. package/dist-cjs/auth/httpAuthSchemeProvider.js +17 -0
  2. package/dist-cjs/index.js +89 -5
  3. package/dist-cjs/runtimeConfig.browser.js +3 -3
  4. package/dist-cjs/runtimeConfig.js +23 -0
  5. package/dist-cjs/runtimeConfig.shared.js +6 -0
  6. package/dist-es/BedrockRuntimeClient.js +5 -2
  7. package/dist-es/auth/httpAuthExtensionConfiguration.js +8 -0
  8. package/dist-es/auth/httpAuthSchemeProvider.js +17 -0
  9. package/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js +4 -0
  10. package/dist-es/models/models_0.js +48 -0
  11. package/dist-es/protocols/Aws_restJson1.js +25 -0
  12. package/dist-es/runtimeConfig.browser.js +5 -5
  13. package/dist-es/runtimeConfig.js +24 -1
  14. package/dist-es/runtimeConfig.shared.js +6 -0
  15. package/dist-types/BedrockRuntimeClient.d.ts +3 -2
  16. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +4 -1
  17. package/dist-types/auth/httpAuthSchemeProvider.d.ts +9 -1
  18. package/dist-types/commands/ApplyGuardrailCommand.d.ts +6 -13
  19. package/dist-types/commands/ConverseCommand.d.ts +120 -44
  20. package/dist-types/commands/ConverseStreamCommand.d.ts +89 -48
  21. package/dist-types/commands/GetAsyncInvokeCommand.d.ts +4 -8
  22. package/dist-types/commands/InvokeModelCommand.d.ts +8 -30
  23. package/dist-types/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +8 -18
  24. package/dist-types/commands/InvokeModelWithResponseStreamCommand.d.ts +8 -35
  25. package/dist-types/commands/ListAsyncInvokesCommand.d.ts +4 -8
  26. package/dist-types/commands/StartAsyncInvokeCommand.d.ts +7 -21
  27. package/dist-types/models/models_0.d.ts +432 -296
  28. package/dist-types/runtimeConfig.browser.d.ts +12 -3
  29. package/dist-types/runtimeConfig.d.ts +13 -1
  30. package/dist-types/runtimeConfig.native.d.ts +14 -2
  31. package/dist-types/runtimeConfig.shared.d.ts +12 -1
  32. package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +6 -0
  33. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +5 -0
  34. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +4 -0
  35. package/dist-types/ts3.4/models/models_0.d.ts +192 -1
  36. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +29 -5
  37. package/dist-types/ts3.4/runtimeConfig.d.ts +30 -1
  38. package/dist-types/ts3.4/runtimeConfig.native.d.ts +41 -3
  39. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +27 -1
  40. package/package.json +16 -14
@@ -769,6 +769,7 @@ const se_BidirectionalInputPayloadPart = (input, context) => {
769
769
  const se_ContentBlock = (input, context) => {
770
770
  return ContentBlock.visit(input, {
771
771
  cachePoint: (value) => ({ cachePoint: _json(value) }),
772
+ citationsContent: (value) => ({ citationsContent: _json(value) }),
772
773
  document: (value) => ({ document: se_DocumentBlock(value, context) }),
773
774
  guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
774
775
  image: (value) => ({ image: se_ImageBlock(value, context) }),
@@ -789,6 +790,8 @@ const se_ContentBlocks = (input, context) => {
789
790
  };
790
791
  const se_DocumentBlock = (input, context) => {
791
792
  return take(input, {
793
+ citations: _json,
794
+ context: [],
792
795
  format: [],
793
796
  name: [],
794
797
  source: (_) => se_DocumentSource(_, context),
@@ -797,7 +800,9 @@ const se_DocumentBlock = (input, context) => {
797
800
  const se_DocumentSource = (input, context) => {
798
801
  return DocumentSource.visit(input, {
799
802
  bytes: (value) => ({ bytes: context.base64Encoder(value) }),
803
+ content: (value) => ({ content: _json(value) }),
800
804
  s3Location: (value) => ({ s3Location: _json(value) }),
805
+ text: (value) => ({ text: value }),
801
806
  _: (name, value) => ({ [name]: value }),
802
807
  });
803
808
  };
@@ -1017,6 +1022,11 @@ const de_ContentBlock = (output, context) => {
1017
1022
  cachePoint: _json(output.cachePoint),
1018
1023
  };
1019
1024
  }
1025
+ if (output.citationsContent != null) {
1026
+ return {
1027
+ citationsContent: _json(output.citationsContent),
1028
+ };
1029
+ }
1020
1030
  if (output.document != null) {
1021
1031
  return {
1022
1032
  document: de_DocumentBlock(output.document, context),
@@ -1058,6 +1068,11 @@ const de_ContentBlock = (output, context) => {
1058
1068
  return { $unknown: Object.entries(output)[0] };
1059
1069
  };
1060
1070
  const de_ContentBlockDelta = (output, context) => {
1071
+ if (output.citation != null) {
1072
+ return {
1073
+ citation: _json(output.citation),
1074
+ };
1075
+ }
1061
1076
  if (output.reasoningContent != null) {
1062
1077
  return {
1063
1078
  reasoningContent: de_ReasoningContentBlockDelta(__expectUnion(output.reasoningContent), context),
@@ -1117,6 +1132,8 @@ const de_ConverseTrace = (output, context) => {
1117
1132
  };
1118
1133
  const de_DocumentBlock = (output, context) => {
1119
1134
  return take(output, {
1135
+ citations: _json,
1136
+ context: __expectString,
1120
1137
  format: __expectString,
1121
1138
  name: __expectString,
1122
1139
  source: (_) => de_DocumentSource(__expectUnion(_), context),
@@ -1128,11 +1145,19 @@ const de_DocumentSource = (output, context) => {
1128
1145
  bytes: context.base64Decoder(output.bytes),
1129
1146
  };
1130
1147
  }
1148
+ if (output.content != null) {
1149
+ return {
1150
+ content: _json(output.content),
1151
+ };
1152
+ }
1131
1153
  if (output.s3Location != null) {
1132
1154
  return {
1133
1155
  s3Location: _json(output.s3Location),
1134
1156
  };
1135
1157
  }
1158
+ if (__expectString(output.text) !== undefined) {
1159
+ return { text: __expectString(output.text) };
1160
+ }
1136
1161
  return { $unknown: Object.entries(output)[0] };
1137
1162
  };
1138
1163
  const de_GuardrailAssessment = (output, context) => {
@@ -1,10 +1,11 @@
1
1
  import packageInfo from "../package.json";
2
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { WebSocketFetchHandler as WebSocketRequestHandler, eventStreamPayloadHandlerProvider, } from "@aws-sdk/middleware-websocket";
3
4
  import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
4
5
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
5
6
  import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser";
6
- import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
7
- import { invalidFunction, invalidProvider } from "@smithy/invalid-dependency";
7
+ import { FetchHttpHandler as HttpRequestHandler, streamCollector } from "@smithy/fetch-http-handler";
8
+ import { invalidProvider } from "@smithy/invalid-dependency";
8
9
  import { calculateBodyLength } from "@smithy/util-body-length-browser";
9
10
  import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
10
11
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
@@ -23,12 +24,11 @@ export const getRuntimeConfig = (config) => {
23
24
  credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
24
25
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
25
26
  createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
26
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
27
- (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })),
27
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
28
28
  eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
29
29
  maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
30
30
  region: config?.region ?? invalidProvider("Region is missing"),
31
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
31
+ requestHandler: WebSocketRequestHandler.create(config?.requestHandler ?? defaultConfigProvider, HttpRequestHandler.create(defaultConfigProvider)),
32
32
  retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
33
33
  sha256: config?.sha256 ?? Sha256,
34
34
  streamCollector: config?.streamCollector ?? streamCollector,
@@ -1,9 +1,11 @@
1
1
  import packageInfo from "../package.json";
2
- import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
2
+ import { AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion, } from "@aws-sdk/core";
3
3
  import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
4
4
  import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node";
5
+ import { fromEnvSigningName, nodeProvider } from "@aws-sdk/token-providers";
5
6
  import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
6
7
  import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
8
+ import { HttpBearerAuthSigner } from "@smithy/core";
7
9
  import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node";
8
10
  import { Hash } from "@smithy/hash-node";
9
11
  import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
@@ -24,6 +26,7 @@ export const getRuntimeConfig = (config) => {
24
26
  const loaderConfig = {
25
27
  profile: config?.profile,
26
28
  logger: clientSharedValues.logger,
29
+ signingName: "bedrock",
27
30
  };
28
31
  return {
29
32
  ...clientSharedValues,
@@ -37,6 +40,26 @@ export const getRuntimeConfig = (config) => {
37
40
  createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
38
41
  eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
39
42
  eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
43
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
44
+ {
45
+ schemeId: "aws.auth#sigv4",
46
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
47
+ signer: new AwsSdkSigV4Signer(),
48
+ },
49
+ {
50
+ schemeId: "smithy.api#httpBearerAuth",
51
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth") ||
52
+ (async (idProps) => {
53
+ try {
54
+ return await fromEnvSigningName({ signingName: "bedrock" })();
55
+ }
56
+ catch (error) {
57
+ return await nodeProvider(idProps)(idProps);
58
+ }
59
+ }),
60
+ signer: new HttpBearerAuthSigner(),
61
+ },
62
+ ],
40
63
  maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
41
64
  region: config?.region ??
42
65
  loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
@@ -1,4 +1,5 @@
1
1
  import { AwsSdkSigV4Signer } from "@aws-sdk/core";
2
+ import { HttpBearerAuthSigner } from "@smithy/core";
2
3
  import { NoOpLogger } from "@smithy/smithy-client";
3
4
  import { parseUrl } from "@smithy/url-parser";
4
5
  import { fromBase64, toBase64 } from "@smithy/util-base64";
@@ -20,6 +21,11 @@ export const getRuntimeConfig = (config) => {
20
21
  identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
21
22
  signer: new AwsSdkSigV4Signer(),
22
23
  },
24
+ {
25
+ schemeId: "smithy.api#httpBearerAuth",
26
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"),
27
+ signer: new HttpBearerAuthSigner(),
28
+ },
23
29
  ],
24
30
  logger: config?.logger ?? new NoOpLogger(),
25
31
  serviceId: config?.serviceId ?? "Bedrock Runtime",
@@ -1,6 +1,7 @@
1
1
  import { EventStreamInputConfig, EventStreamResolvedConfig } from "@aws-sdk/middleware-eventstream";
2
2
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
3
3
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
+ import { WebSocketInputConfig, WebSocketResolvedConfig } from "@aws-sdk/middleware-websocket";
4
5
  import { EventStreamPayloadHandlerProvider as __EventStreamPayloadHandlerProvider } from "@aws-sdk/types";
5
6
  import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
6
7
  import { EventStreamSerdeInputConfig, EventStreamSerdeResolvedConfig } from "@smithy/eventstream-serde-config-resolver";
@@ -170,7 +171,7 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
170
171
  /**
171
172
  * @public
172
173
  */
173
- export type BedrockRuntimeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> & EventStreamSerdeInputConfig & HttpAuthSchemeInputConfig & EventStreamInputConfig & ClientInputEndpointParameters;
174
+ export type BedrockRuntimeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> & EventStreamSerdeInputConfig & HttpAuthSchemeInputConfig & EventStreamInputConfig & WebSocketInputConfig & ClientInputEndpointParameters;
174
175
  /**
175
176
  * @public
176
177
  *
@@ -181,7 +182,7 @@ export interface BedrockRuntimeClientConfig extends BedrockRuntimeClientConfigTy
181
182
  /**
182
183
  * @public
183
184
  */
184
- export type BedrockRuntimeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> & EventStreamSerdeResolvedConfig & HttpAuthSchemeResolvedConfig & EventStreamResolvedConfig & ClientResolvedEndpointParameters;
185
+ export type BedrockRuntimeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> & EventStreamSerdeResolvedConfig & HttpAuthSchemeResolvedConfig & EventStreamResolvedConfig & WebSocketResolvedConfig & ClientResolvedEndpointParameters;
185
186
  /**
186
187
  * @public
187
188
  *
@@ -1,4 +1,4 @@
1
- import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
1
+ import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme, TokenIdentity, TokenIdentityProvider } from "@smithy/types";
2
2
  import { BedrockRuntimeHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
3
3
  /**
4
4
  * @internal
@@ -10,6 +10,8 @@ export interface HttpAuthExtensionConfiguration {
10
10
  httpAuthSchemeProvider(): BedrockRuntimeHttpAuthSchemeProvider;
11
11
  setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
12
12
  credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
13
+ setToken(token: TokenIdentity | TokenIdentityProvider): void;
14
+ token(): TokenIdentity | TokenIdentityProvider | undefined;
13
15
  }
14
16
  /**
15
17
  * @internal
@@ -18,6 +20,7 @@ export type HttpAuthRuntimeConfig = Partial<{
18
20
  httpAuthSchemes: HttpAuthScheme[];
19
21
  httpAuthSchemeProvider: BedrockRuntimeHttpAuthSchemeProvider;
20
22
  credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
23
+ token: TokenIdentity | TokenIdentityProvider;
21
24
  }>;
22
25
  /**
23
26
  * @internal
@@ -1,5 +1,5 @@
1
1
  import { AwsSdkSigV4AuthInputConfig, AwsSdkSigV4AuthResolvedConfig, AwsSdkSigV4PreviouslyResolved } from "@aws-sdk/core";
2
- import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider, Provider } from "@smithy/types";
2
+ import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider, Provider, TokenIdentity, TokenIdentityProvider } from "@smithy/types";
3
3
  import { BedrockRuntimeClientResolvedConfig } from "../BedrockRuntimeClient";
4
4
  /**
5
5
  * @internal
@@ -46,6 +46,10 @@ export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
46
46
  * @internal
47
47
  */
48
48
  httpAuthSchemeProvider?: BedrockRuntimeHttpAuthSchemeProvider;
49
+ /**
50
+ * The token used to authenticate requests.
51
+ */
52
+ token?: TokenIdentity | TokenIdentityProvider;
49
53
  }
50
54
  /**
51
55
  * @internal
@@ -68,6 +72,10 @@ export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedCon
68
72
  * @internal
69
73
  */
70
74
  readonly httpAuthSchemeProvider: BedrockRuntimeHttpAuthSchemeProvider;
75
+ /**
76
+ * The token used to authenticate requests.
77
+ */
78
+ readonly token?: TokenIdentityProvider;
71
79
  }
72
80
  /**
73
81
  * @internal
@@ -27,9 +27,7 @@ declare const ApplyGuardrailCommand_base: {
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
30
- * <p>The action to apply a guardrail.</p>
31
- * <p>For troubleshooting some of the common errors you might encounter when using the <code>ApplyGuardrail</code> API,
32
- * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
30
+ * <p>The action to apply a guardrail.</p> <p>For troubleshooting some of the common errors you might encounter when using the <code>ApplyGuardrail</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
33
31
  * @example
34
32
  * Use a bare-bones client and the command you need to make an API call.
35
33
  * ```javascript
@@ -192,27 +190,22 @@ declare const ApplyGuardrailCommand_base: {
192
190
  * @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
193
191
  *
194
192
  * @throws {@link AccessDeniedException} (client fault)
195
- * <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
196
- * 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>
193
+ * <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, 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>
197
194
  *
198
195
  * @throws {@link InternalServerException} (server fault)
199
- * <p>An internal server error occurred. For troubleshooting this error,
200
- * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
196
+ * <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
201
197
  *
202
198
  * @throws {@link ResourceNotFoundException} (client fault)
203
- * <p>The specified resource ARN was not found. For troubleshooting this error,
204
- * 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>
199
+ * <p>The specified resource ARN was not found. For troubleshooting this error, 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>
205
200
  *
206
201
  * @throws {@link ServiceQuotaExceededException} (client fault)
207
202
  * <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>
208
203
  *
209
204
  * @throws {@link ThrottlingException} (client fault)
210
- * <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
211
- * 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>
205
+ * <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For 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>
212
206
  *
213
207
  * @throws {@link ValidationException} (client fault)
214
- * <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
215
- * 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>
208
+ * <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, 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>
216
209
  *
217
210
  * @throws {@link BedrockRuntimeServiceException}
218
211
  * <p>Base exception class for all service exceptions from BedrockRuntime service.</p>
@@ -27,30 +27,7 @@ declare const ConverseCommand_base: {
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
30
- * <p>Sends messages to the specified Amazon Bedrock model. <code>Converse</code> provides
31
- * a consistent interface that works with all models that
32
- * support messages. This allows you to write code once and use it with different models.
33
- * If a model has unique inference parameters, you can also pass those unique parameters
34
- * to the model.</p>
35
- * <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p>
36
- * <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p>
37
- * <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p>
38
- * <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
39
- * To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
40
- * To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i>
41
- * </p>
42
- * <p>For example code, see <i>Converse API examples</i> in the <i>Amazon Bedrock User Guide</i>.
43
- * </p>
44
- * <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action. </p>
45
- * <important>
46
- * <p>To deny all inference access to resources that you specify in the modelId field, you
47
- * need to deny access to the <code>bedrock:InvokeModel</code> and
48
- * <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies
49
- * access to the resource through the base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.
50
- * </p>
51
- * </important>
52
- * <p>For troubleshooting some of the common errors you might encounter when using the <code>Converse</code> API,
53
- * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
30
+ * <p>Sends messages to the specified Amazon Bedrock model. <code>Converse</code> provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the model.</p> <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p> <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p> <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p> <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i> </p> <p>For example code, see <i>Converse API examples</i> in the <i>Amazon Bedrock User Guide</i>. </p> <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action. </p> <important> <p>To deny all inference access to resources that you specify in the modelId field, you need to deny access to the <code>bedrock:InvokeModel</code> and <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies access to the resource through the base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>. </p> </important> <p>For troubleshooting some of the common errors you might encounter when using the <code>Converse</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
54
31
  * @example
55
32
  * Use a bare-bones client and the command you need to make an API call.
56
33
  * ```javascript
@@ -76,7 +53,7 @@ declare const ConverseCommand_base: {
76
53
  * },
77
54
  * },
78
55
  * document: { // DocumentBlock
79
- * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
56
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md",
80
57
  * name: "STRING_VALUE", // required
81
58
  * source: { // DocumentSource Union: only one key present
82
59
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
@@ -84,6 +61,16 @@ declare const ConverseCommand_base: {
84
61
  * uri: "STRING_VALUE", // required
85
62
  * bucketOwner: "STRING_VALUE",
86
63
  * },
64
+ * text: "STRING_VALUE",
65
+ * content: [ // DocumentContentBlocks
66
+ * { // DocumentContentBlock Union: only one key present
67
+ * text: "STRING_VALUE",
68
+ * },
69
+ * ],
70
+ * },
71
+ * context: "STRING_VALUE",
72
+ * citations: { // CitationsConfig
73
+ * enabled: true || false, // required
87
74
  * },
88
75
  * },
89
76
  * video: { // VideoBlock
@@ -118,7 +105,7 @@ declare const ConverseCommand_base: {
118
105
  * },
119
106
  * },
120
107
  * document: {
121
- * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
108
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md",
122
109
  * name: "STRING_VALUE", // required
123
110
  * source: {// Union: only one key present
124
111
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
@@ -126,6 +113,16 @@ declare const ConverseCommand_base: {
126
113
  * uri: "STRING_VALUE", // required
127
114
  * bucketOwner: "STRING_VALUE",
128
115
  * },
116
+ * text: "STRING_VALUE",
117
+ * content: [
118
+ * {// Union: only one key present
119
+ * text: "STRING_VALUE",
120
+ * },
121
+ * ],
122
+ * },
123
+ * context: "STRING_VALUE",
124
+ * citations: {
125
+ * enabled: true || false, // required
129
126
  * },
130
127
  * },
131
128
  * video: {
@@ -163,6 +160,40 @@ declare const ConverseCommand_base: {
163
160
  * },
164
161
  * redactedContent: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
165
162
  * },
163
+ * citationsContent: { // CitationsContentBlock
164
+ * content: [ // CitationGeneratedContentList
165
+ * { // CitationGeneratedContent Union: only one key present
166
+ * text: "STRING_VALUE",
167
+ * },
168
+ * ],
169
+ * citations: [ // Citations
170
+ * { // Citation
171
+ * title: "STRING_VALUE",
172
+ * sourceContent: [ // CitationSourceContentList
173
+ * { // CitationSourceContent Union: only one key present
174
+ * text: "STRING_VALUE",
175
+ * },
176
+ * ],
177
+ * location: { // CitationLocation Union: only one key present
178
+ * documentChar: { // DocumentCharLocation
179
+ * documentIndex: Number("int"),
180
+ * start: Number("int"),
181
+ * end: Number("int"),
182
+ * },
183
+ * documentPage: { // DocumentPageLocation
184
+ * documentIndex: Number("int"),
185
+ * start: Number("int"),
186
+ * end: Number("int"),
187
+ * },
188
+ * documentChunk: { // DocumentChunkLocation
189
+ * documentIndex: Number("int"),
190
+ * start: Number("int"),
191
+ * end: Number("int"),
192
+ * },
193
+ * },
194
+ * },
195
+ * ],
196
+ * },
166
197
  * },
167
198
  * ],
168
199
  * },
@@ -259,7 +290,7 @@ declare const ConverseCommand_base: {
259
290
  * // },
260
291
  * // },
261
292
  * // document: { // DocumentBlock
262
- * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
293
+ * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md",
263
294
  * // name: "STRING_VALUE", // required
264
295
  * // source: { // DocumentSource Union: only one key present
265
296
  * // bytes: new Uint8Array(),
@@ -267,6 +298,16 @@ declare const ConverseCommand_base: {
267
298
  * // uri: "STRING_VALUE", // required
268
299
  * // bucketOwner: "STRING_VALUE",
269
300
  * // },
301
+ * // text: "STRING_VALUE",
302
+ * // content: [ // DocumentContentBlocks
303
+ * // { // DocumentContentBlock Union: only one key present
304
+ * // text: "STRING_VALUE",
305
+ * // },
306
+ * // ],
307
+ * // },
308
+ * // context: "STRING_VALUE",
309
+ * // citations: { // CitationsConfig
310
+ * // enabled: true || false, // required
270
311
  * // },
271
312
  * // },
272
313
  * // video: { // VideoBlock
@@ -301,7 +342,7 @@ declare const ConverseCommand_base: {
301
342
  * // },
302
343
  * // },
303
344
  * // document: {
304
- * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
345
+ * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md",
305
346
  * // name: "STRING_VALUE", // required
306
347
  * // source: {// Union: only one key present
307
348
  * // bytes: new Uint8Array(),
@@ -309,6 +350,16 @@ declare const ConverseCommand_base: {
309
350
  * // uri: "STRING_VALUE", // required
310
351
  * // bucketOwner: "STRING_VALUE",
311
352
  * // },
353
+ * // text: "STRING_VALUE",
354
+ * // content: [
355
+ * // {// Union: only one key present
356
+ * // text: "STRING_VALUE",
357
+ * // },
358
+ * // ],
359
+ * // },
360
+ * // context: "STRING_VALUE",
361
+ * // citations: {
362
+ * // enabled: true || false, // required
312
363
  * // },
313
364
  * // },
314
365
  * // video: {
@@ -346,6 +397,40 @@ declare const ConverseCommand_base: {
346
397
  * // },
347
398
  * // redactedContent: new Uint8Array(),
348
399
  * // },
400
+ * // citationsContent: { // CitationsContentBlock
401
+ * // content: [ // CitationGeneratedContentList
402
+ * // { // CitationGeneratedContent Union: only one key present
403
+ * // text: "STRING_VALUE",
404
+ * // },
405
+ * // ],
406
+ * // citations: [ // Citations
407
+ * // { // Citation
408
+ * // title: "STRING_VALUE",
409
+ * // sourceContent: [ // CitationSourceContentList
410
+ * // { // CitationSourceContent Union: only one key present
411
+ * // text: "STRING_VALUE",
412
+ * // },
413
+ * // ],
414
+ * // location: { // CitationLocation Union: only one key present
415
+ * // documentChar: { // DocumentCharLocation
416
+ * // documentIndex: Number("int"),
417
+ * // start: Number("int"),
418
+ * // end: Number("int"),
419
+ * // },
420
+ * // documentPage: { // DocumentPageLocation
421
+ * // documentIndex: Number("int"),
422
+ * // start: Number("int"),
423
+ * // end: Number("int"),
424
+ * // },
425
+ * // documentChunk: { // DocumentChunkLocation
426
+ * // documentIndex: Number("int"),
427
+ * // start: Number("int"),
428
+ * // end: Number("int"),
429
+ * // },
430
+ * // },
431
+ * // },
432
+ * // ],
433
+ * // },
349
434
  * // },
350
435
  * // ],
351
436
  * // },
@@ -577,40 +662,31 @@ declare const ConverseCommand_base: {
577
662
  * @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
578
663
  *
579
664
  * @throws {@link AccessDeniedException} (client fault)
580
- * <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
581
- * 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>
665
+ * <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, 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>
582
666
  *
583
667
  * @throws {@link InternalServerException} (server fault)
584
- * <p>An internal server error occurred. For troubleshooting this error,
585
- * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
668
+ * <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
586
669
  *
587
670
  * @throws {@link ModelErrorException} (client fault)
588
671
  * <p>The request failed due to an error while processing the model.</p>
589
672
  *
590
673
  * @throws {@link ModelNotReadyException} (client fault)
591
- * <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
592
- * will automatically retry the operation up to 5 times. For information about configuring
593
- * automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
594
- * reference guide.</p>
674
+ * <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
595
675
  *
596
676
  * @throws {@link ModelTimeoutException} (client fault)
597
677
  * <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
598
678
  *
599
679
  * @throws {@link ResourceNotFoundException} (client fault)
600
- * <p>The specified resource ARN was not found. For troubleshooting this error,
601
- * 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>
680
+ * <p>The specified resource ARN was not found. For troubleshooting this error, 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>
602
681
  *
603
682
  * @throws {@link ServiceUnavailableException} (server fault)
604
- * <p>The service isn't currently available. For troubleshooting this error,
605
- * see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
683
+ * <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
606
684
  *
607
685
  * @throws {@link ThrottlingException} (client fault)
608
- * <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
609
- * 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>
686
+ * <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For 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>
610
687
  *
611
688
  * @throws {@link ValidationException} (client fault)
612
- * <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
613
- * 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>
689
+ * <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, 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>
614
690
  *
615
691
  * @throws {@link BedrockRuntimeServiceException}
616
692
  * <p>Base exception class for all service exceptions from BedrockRuntime service.</p>