@aws-sdk/client-bedrock-runtime 3.1077.0 → 3.1078.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +25 -132
- package/dist-es/commandBuilder.js +14 -0
- package/dist-es/commands/ApplyGuardrailCommand.js +2 -14
- package/dist-es/commands/ConverseCommand.js +2 -14
- package/dist-es/commands/ConverseStreamCommand.js +2 -18
- package/dist-es/commands/CountTokensCommand.js +2 -14
- package/dist-es/commands/GetAsyncInvokeCommand.js +2 -14
- package/dist-es/commands/InvokeGuardrailChecksCommand.js +2 -14
- package/dist-es/commands/InvokeModelCommand.js +2 -14
- package/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js +2 -27
- package/dist-es/commands/InvokeModelWithResponseStreamCommand.js +2 -18
- package/dist-es/commands/ListAsyncInvokesCommand.js +2 -14
- package/dist-es/commands/StartAsyncInvokeCommand.js +2 -14
- package/dist-es/index.js +1 -0
- package/dist-types/commandBuilder.d.ts +22 -0
- package/dist-types/commands/ApplyGuardrailCommand.d.ts +3 -8
- package/dist-types/commands/ConverseCommand.d.ts +3 -8
- package/dist-types/commands/ConverseStreamCommand.d.ts +3 -8
- package/dist-types/commands/CountTokensCommand.d.ts +3 -8
- package/dist-types/commands/GetAsyncInvokeCommand.d.ts +3 -8
- package/dist-types/commands/InvokeGuardrailChecksCommand.d.ts +3 -8
- package/dist-types/commands/InvokeModelCommand.d.ts +3 -8
- package/dist-types/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +3 -8
- package/dist-types/commands/InvokeModelWithResponseStreamCommand.d.ts +3 -8
- package/dist-types/commands/ListAsyncInvokesCommand.d.ts +3 -8
- package/dist-types/commands/StartAsyncInvokeCommand.d.ts +3 -8
- package/dist-types/index.d.ts +1 -0
- package/dist-types/ts3.4/commandBuilder.d.ts +52 -0
- package/dist-types/ts3.4/commands/ApplyGuardrailCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/ConverseCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/ConverseStreamCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/CountTokensCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/GetAsyncInvokeCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/InvokeGuardrailChecksCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/InvokeModelCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/InvokeModelWithBidirectionalStreamCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/InvokeModelWithResponseStreamCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/ListAsyncInvokesCommand.d.ts +7 -16
- package/dist-types/ts3.4/commands/StartAsyncInvokeCommand.d.ts +7 -16
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/package.json +13 -13
package/dist-cjs/index.js
CHANGED
|
@@ -2,8 +2,9 @@ const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsu
|
|
|
2
2
|
const { resolveEventStreamConfig, getEventStreamPlugin } = require("@aws-sdk/middleware-eventstream");
|
|
3
3
|
const { resolveWebSocketConfig, getWebSocketPlugin } = require("@aws-sdk/middleware-websocket");
|
|
4
4
|
const { memoizeIdentityProvider, isIdentityExpired, doesIdentityRequireRefresh, HttpBearerAuthSigner, getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, createPaginator } = require("@smithy/core");
|
|
5
|
-
const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client,
|
|
6
|
-
|
|
5
|
+
const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, makeBuilder, createAggregatedClient } = require("@smithy/core/client");
|
|
6
|
+
const { Command: $Command } = require("@smithy/core/client");
|
|
7
|
+
exports.$Command = $Command;
|
|
7
8
|
exports.__Client = Client;
|
|
8
9
|
const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config");
|
|
9
10
|
const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
|
|
@@ -89,7 +90,7 @@ const commonParams = {
|
|
|
89
90
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
90
91
|
};
|
|
91
92
|
|
|
92
|
-
var version = "3.
|
|
93
|
+
var version = "3.1077.0";
|
|
93
94
|
var packageInfo = {
|
|
94
95
|
version: version};
|
|
95
96
|
|
|
@@ -2177,155 +2178,47 @@ class BedrockRuntimeClient extends Client {
|
|
|
2177
2178
|
}
|
|
2178
2179
|
}
|
|
2179
2180
|
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2181
|
+
const command = makeBuilder(commonParams, "AmazonBedrockFrontendService", "BedrockRuntimeClient", getEndpointPlugin);
|
|
2182
|
+
const _ep0 = {};
|
|
2183
|
+
const _mw0 = (Command, cs, config, o) => [];
|
|
2184
|
+
const _mw1 = (Command, cs, config, o) => [
|
|
2185
|
+
getEventStreamPlugin(config),
|
|
2186
|
+
getWebSocketPlugin(config, {
|
|
2187
|
+
headerPrefix: "x-amz-bedrock-",
|
|
2188
|
+
}),
|
|
2189
|
+
];
|
|
2190
|
+
|
|
2191
|
+
class ApplyGuardrailCommand extends command(_ep0, _mw0, "ApplyGuardrail", ApplyGuardrail$) {
|
|
2190
2192
|
}
|
|
2191
2193
|
|
|
2192
|
-
class ConverseCommand extends
|
|
2193
|
-
.classBuilder()
|
|
2194
|
-
.ep(commonParams)
|
|
2195
|
-
.m(function (Command, cs, config, o) {
|
|
2196
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2197
|
-
})
|
|
2198
|
-
.s("AmazonBedrockFrontendService", "Converse", {})
|
|
2199
|
-
.n("BedrockRuntimeClient", "ConverseCommand")
|
|
2200
|
-
.sc(Converse$)
|
|
2201
|
-
.build() {
|
|
2194
|
+
class ConverseCommand extends command(_ep0, _mw0, "Converse", Converse$) {
|
|
2202
2195
|
}
|
|
2203
2196
|
|
|
2204
|
-
class ConverseStreamCommand extends
|
|
2205
|
-
.classBuilder()
|
|
2206
|
-
.ep(commonParams)
|
|
2207
|
-
.m(function (Command, cs, config, o) {
|
|
2208
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2209
|
-
})
|
|
2210
|
-
.s("AmazonBedrockFrontendService", "ConverseStream", {
|
|
2211
|
-
eventStream: {
|
|
2212
|
-
output: true,
|
|
2213
|
-
},
|
|
2214
|
-
})
|
|
2215
|
-
.n("BedrockRuntimeClient", "ConverseStreamCommand")
|
|
2216
|
-
.sc(ConverseStream$)
|
|
2217
|
-
.build() {
|
|
2197
|
+
class ConverseStreamCommand extends command(_ep0, _mw0, "ConverseStream", ConverseStream$) {
|
|
2218
2198
|
}
|
|
2219
2199
|
|
|
2220
|
-
class CountTokensCommand extends
|
|
2221
|
-
.classBuilder()
|
|
2222
|
-
.ep(commonParams)
|
|
2223
|
-
.m(function (Command, cs, config, o) {
|
|
2224
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2225
|
-
})
|
|
2226
|
-
.s("AmazonBedrockFrontendService", "CountTokens", {})
|
|
2227
|
-
.n("BedrockRuntimeClient", "CountTokensCommand")
|
|
2228
|
-
.sc(CountTokens$)
|
|
2229
|
-
.build() {
|
|
2200
|
+
class CountTokensCommand extends command(_ep0, _mw0, "CountTokens", CountTokens$) {
|
|
2230
2201
|
}
|
|
2231
2202
|
|
|
2232
|
-
class GetAsyncInvokeCommand extends
|
|
2233
|
-
.classBuilder()
|
|
2234
|
-
.ep(commonParams)
|
|
2235
|
-
.m(function (Command, cs, config, o) {
|
|
2236
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2237
|
-
})
|
|
2238
|
-
.s("AmazonBedrockFrontendService", "GetAsyncInvoke", {})
|
|
2239
|
-
.n("BedrockRuntimeClient", "GetAsyncInvokeCommand")
|
|
2240
|
-
.sc(GetAsyncInvoke$)
|
|
2241
|
-
.build() {
|
|
2203
|
+
class GetAsyncInvokeCommand extends command(_ep0, _mw0, "GetAsyncInvoke", GetAsyncInvoke$) {
|
|
2242
2204
|
}
|
|
2243
2205
|
|
|
2244
|
-
class InvokeGuardrailChecksCommand extends
|
|
2245
|
-
.classBuilder()
|
|
2246
|
-
.ep(commonParams)
|
|
2247
|
-
.m(function (Command, cs, config, o) {
|
|
2248
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2249
|
-
})
|
|
2250
|
-
.s("AmazonBedrockFrontendService", "InvokeGuardrailChecks", {})
|
|
2251
|
-
.n("BedrockRuntimeClient", "InvokeGuardrailChecksCommand")
|
|
2252
|
-
.sc(InvokeGuardrailChecks$)
|
|
2253
|
-
.build() {
|
|
2206
|
+
class InvokeGuardrailChecksCommand extends command(_ep0, _mw0, "InvokeGuardrailChecks", InvokeGuardrailChecks$) {
|
|
2254
2207
|
}
|
|
2255
2208
|
|
|
2256
|
-
class InvokeModelCommand extends
|
|
2257
|
-
.classBuilder()
|
|
2258
|
-
.ep(commonParams)
|
|
2259
|
-
.m(function (Command, cs, config, o) {
|
|
2260
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2261
|
-
})
|
|
2262
|
-
.s("AmazonBedrockFrontendService", "InvokeModel", {})
|
|
2263
|
-
.n("BedrockRuntimeClient", "InvokeModelCommand")
|
|
2264
|
-
.sc(InvokeModel$)
|
|
2265
|
-
.build() {
|
|
2209
|
+
class InvokeModelCommand extends command(_ep0, _mw0, "InvokeModel", InvokeModel$) {
|
|
2266
2210
|
}
|
|
2267
2211
|
|
|
2268
|
-
class InvokeModelWithBidirectionalStreamCommand extends
|
|
2269
|
-
.classBuilder()
|
|
2270
|
-
.ep(commonParams)
|
|
2271
|
-
.m(function (Command, cs, config, o) {
|
|
2272
|
-
return [
|
|
2273
|
-
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
2274
|
-
getEventStreamPlugin(config),
|
|
2275
|
-
getWebSocketPlugin(config, {
|
|
2276
|
-
headerPrefix: 'x-amz-bedrock-',
|
|
2277
|
-
}),
|
|
2278
|
-
];
|
|
2279
|
-
})
|
|
2280
|
-
.s("AmazonBedrockFrontendService", "InvokeModelWithBidirectionalStream", {
|
|
2281
|
-
eventStream: {
|
|
2282
|
-
input: true,
|
|
2283
|
-
output: true,
|
|
2284
|
-
},
|
|
2285
|
-
})
|
|
2286
|
-
.n("BedrockRuntimeClient", "InvokeModelWithBidirectionalStreamCommand")
|
|
2287
|
-
.sc(InvokeModelWithBidirectionalStream$)
|
|
2288
|
-
.build() {
|
|
2212
|
+
class InvokeModelWithBidirectionalStreamCommand extends command(_ep0, _mw1, "InvokeModelWithBidirectionalStream", InvokeModelWithBidirectionalStream$) {
|
|
2289
2213
|
}
|
|
2290
2214
|
|
|
2291
|
-
class InvokeModelWithResponseStreamCommand extends
|
|
2292
|
-
.classBuilder()
|
|
2293
|
-
.ep(commonParams)
|
|
2294
|
-
.m(function (Command, cs, config, o) {
|
|
2295
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2296
|
-
})
|
|
2297
|
-
.s("AmazonBedrockFrontendService", "InvokeModelWithResponseStream", {
|
|
2298
|
-
eventStream: {
|
|
2299
|
-
output: true,
|
|
2300
|
-
},
|
|
2301
|
-
})
|
|
2302
|
-
.n("BedrockRuntimeClient", "InvokeModelWithResponseStreamCommand")
|
|
2303
|
-
.sc(InvokeModelWithResponseStream$)
|
|
2304
|
-
.build() {
|
|
2215
|
+
class InvokeModelWithResponseStreamCommand extends command(_ep0, _mw0, "InvokeModelWithResponseStream", InvokeModelWithResponseStream$) {
|
|
2305
2216
|
}
|
|
2306
2217
|
|
|
2307
|
-
class ListAsyncInvokesCommand extends
|
|
2308
|
-
.classBuilder()
|
|
2309
|
-
.ep(commonParams)
|
|
2310
|
-
.m(function (Command, cs, config, o) {
|
|
2311
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2312
|
-
})
|
|
2313
|
-
.s("AmazonBedrockFrontendService", "ListAsyncInvokes", {})
|
|
2314
|
-
.n("BedrockRuntimeClient", "ListAsyncInvokesCommand")
|
|
2315
|
-
.sc(ListAsyncInvokes$)
|
|
2316
|
-
.build() {
|
|
2218
|
+
class ListAsyncInvokesCommand extends command(_ep0, _mw0, "ListAsyncInvokes", ListAsyncInvokes$) {
|
|
2317
2219
|
}
|
|
2318
2220
|
|
|
2319
|
-
class StartAsyncInvokeCommand extends
|
|
2320
|
-
.classBuilder()
|
|
2321
|
-
.ep(commonParams)
|
|
2322
|
-
.m(function (Command, cs, config, o) {
|
|
2323
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
2324
|
-
})
|
|
2325
|
-
.s("AmazonBedrockFrontendService", "StartAsyncInvoke", {})
|
|
2326
|
-
.n("BedrockRuntimeClient", "StartAsyncInvokeCommand")
|
|
2327
|
-
.sc(StartAsyncInvoke$)
|
|
2328
|
-
.build() {
|
|
2221
|
+
class StartAsyncInvokeCommand extends command(_ep0, _mw0, "StartAsyncInvoke", StartAsyncInvoke$) {
|
|
2329
2222
|
}
|
|
2330
2223
|
|
|
2331
2224
|
const paginateListAsyncInvokes = createPaginator(BedrockRuntimeClient, ListAsyncInvokesCommand, "nextToken", "nextToken", "maxResults");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
|
|
2
|
+
import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
|
|
3
|
+
import { makeBuilder } from "@smithy/core/client";
|
|
4
|
+
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
5
|
+
import { commonParams } from "./endpoint/EndpointParameters";
|
|
6
|
+
export const command = makeBuilder(commonParams, "AmazonBedrockFrontendService", "BedrockRuntimeClient", getEndpointPlugin);
|
|
7
|
+
export const _ep0 = {};
|
|
8
|
+
export const _mw0 = (Command, cs, config, o) => [];
|
|
9
|
+
export const _mw1 = (Command, cs, config, o) => [
|
|
10
|
+
getEventStreamPlugin(config),
|
|
11
|
+
getWebSocketPlugin(config, {
|
|
12
|
+
headerPrefix: "x-amz-bedrock-",
|
|
13
|
+
}),
|
|
14
|
+
];
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { ApplyGuardrail$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class ApplyGuardrailCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "ApplyGuardrail", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "ApplyGuardrailCommand")
|
|
14
|
-
.sc(ApplyGuardrail$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class ApplyGuardrailCommand extends command(_ep0, _mw0, "ApplyGuardrail", ApplyGuardrail$) {
|
|
16
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { Converse$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class ConverseCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "Converse", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "ConverseCommand")
|
|
14
|
-
.sc(Converse$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class ConverseCommand extends command(_ep0, _mw0, "Converse", Converse$) {
|
|
16
4
|
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { ConverseStream$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class ConverseStreamCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "ConverseStream", {
|
|
13
|
-
eventStream: {
|
|
14
|
-
output: true,
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
.n("BedrockRuntimeClient", "ConverseStreamCommand")
|
|
18
|
-
.sc(ConverseStream$)
|
|
19
|
-
.build() {
|
|
3
|
+
export class ConverseStreamCommand extends command(_ep0, _mw0, "ConverseStream", ConverseStream$) {
|
|
20
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { CountTokens$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class CountTokensCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "CountTokens", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "CountTokensCommand")
|
|
14
|
-
.sc(CountTokens$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class CountTokensCommand extends command(_ep0, _mw0, "CountTokens", CountTokens$) {
|
|
16
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { GetAsyncInvoke$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class GetAsyncInvokeCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "GetAsyncInvoke", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "GetAsyncInvokeCommand")
|
|
14
|
-
.sc(GetAsyncInvoke$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class GetAsyncInvokeCommand extends command(_ep0, _mw0, "GetAsyncInvoke", GetAsyncInvoke$) {
|
|
16
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { InvokeGuardrailChecks$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class InvokeGuardrailChecksCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "InvokeGuardrailChecks", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "InvokeGuardrailChecksCommand")
|
|
14
|
-
.sc(InvokeGuardrailChecks$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class InvokeGuardrailChecksCommand extends command(_ep0, _mw0, "InvokeGuardrailChecks", InvokeGuardrailChecks$) {
|
|
16
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { InvokeModel$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class InvokeModelCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "InvokeModel", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "InvokeModelCommand")
|
|
14
|
-
.sc(InvokeModel$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class InvokeModelCommand extends command(_ep0, _mw0, "InvokeModel", InvokeModel$) {
|
|
16
4
|
}
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
|
|
3
|
-
import { Command as $Command } from "@smithy/core/client";
|
|
4
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
5
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw1, command } from "../commandBuilder";
|
|
6
2
|
import { InvokeModelWithBidirectionalStream$ } from "../schemas/schemas_0";
|
|
7
|
-
export
|
|
8
|
-
export class InvokeModelWithBidirectionalStreamCommand extends $Command
|
|
9
|
-
.classBuilder()
|
|
10
|
-
.ep(commonParams)
|
|
11
|
-
.m(function (Command, cs, config, o) {
|
|
12
|
-
return [
|
|
13
|
-
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
14
|
-
getEventStreamPlugin(config),
|
|
15
|
-
getWebSocketPlugin(config, {
|
|
16
|
-
headerPrefix: 'x-amz-bedrock-',
|
|
17
|
-
}),
|
|
18
|
-
];
|
|
19
|
-
})
|
|
20
|
-
.s("AmazonBedrockFrontendService", "InvokeModelWithBidirectionalStream", {
|
|
21
|
-
eventStream: {
|
|
22
|
-
input: true,
|
|
23
|
-
output: true,
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
.n("BedrockRuntimeClient", "InvokeModelWithBidirectionalStreamCommand")
|
|
27
|
-
.sc(InvokeModelWithBidirectionalStream$)
|
|
28
|
-
.build() {
|
|
3
|
+
export class InvokeModelWithBidirectionalStreamCommand extends command(_ep0, _mw1, "InvokeModelWithBidirectionalStream", InvokeModelWithBidirectionalStream$) {
|
|
29
4
|
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { InvokeModelWithResponseStream$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class InvokeModelWithResponseStreamCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "InvokeModelWithResponseStream", {
|
|
13
|
-
eventStream: {
|
|
14
|
-
output: true,
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
.n("BedrockRuntimeClient", "InvokeModelWithResponseStreamCommand")
|
|
18
|
-
.sc(InvokeModelWithResponseStream$)
|
|
19
|
-
.build() {
|
|
3
|
+
export class InvokeModelWithResponseStreamCommand extends command(_ep0, _mw0, "InvokeModelWithResponseStream", InvokeModelWithResponseStream$) {
|
|
20
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { ListAsyncInvokes$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class ListAsyncInvokesCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "ListAsyncInvokes", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "ListAsyncInvokesCommand")
|
|
14
|
-
.sc(ListAsyncInvokes$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class ListAsyncInvokesCommand extends command(_ep0, _mw0, "ListAsyncInvokes", ListAsyncInvokes$) {
|
|
16
4
|
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
-
import { commonParams } from "../endpoint/EndpointParameters";
|
|
1
|
+
import { _ep0, _mw0, command } from "../commandBuilder";
|
|
4
2
|
import { StartAsyncInvoke$ } from "../schemas/schemas_0";
|
|
5
|
-
export
|
|
6
|
-
export class StartAsyncInvokeCommand extends $Command
|
|
7
|
-
.classBuilder()
|
|
8
|
-
.ep(commonParams)
|
|
9
|
-
.m(function (Command, cs, config, o) {
|
|
10
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
-
})
|
|
12
|
-
.s("AmazonBedrockFrontendService", "StartAsyncInvoke", {})
|
|
13
|
-
.n("BedrockRuntimeClient", "StartAsyncInvokeCommand")
|
|
14
|
-
.sc(StartAsyncInvoke$)
|
|
15
|
-
.build() {
|
|
3
|
+
export class StartAsyncInvokeCommand extends command(_ep0, _mw0, "StartAsyncInvoke", StartAsyncInvoke$) {
|
|
16
4
|
}
|
package/dist-es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./BedrockRuntimeClient";
|
|
2
2
|
export * from "./BedrockRuntime";
|
|
3
3
|
export * from "./commands";
|
|
4
|
+
export { Command as $Command } from "@smithy/core/client";
|
|
4
5
|
export * from "./schemas/schemas_0";
|
|
5
6
|
export * from "./pagination";
|
|
6
7
|
export * from "./models/enums";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EndpointParameterInstructions } from "@smithy/types";
|
|
2
|
+
import type { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "./BedrockRuntimeClient";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const command: <I extends ServiceInputTypes, O extends ServiceOutputTypes>(added: EndpointParameterInstructions, plugins: (CommandCtor: any, clientStack: any, config: any, options: any) => import("@smithy/types").Pluggable<any, any>[], op: string, $: import("@smithy/types").StaticOperationSchema, smithyContext?: Record<string, unknown>) => {
|
|
7
|
+
new (input: I): import("@smithy/core/client").CommandImpl<I, O, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
8
|
+
new (...[input]: import("@smithy/types").OptionalParameter<I>): import("@smithy/core/client").CommandImpl<I, O, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
9
|
+
getEndpointParameterInstructions(): EndpointParameterInstructions;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const _ep0: EndpointParameterInstructions;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const _mw0: (Command: any, cs: any, config: any, o: any) => never[];
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare const _mw1: (Command: any, cs: any, config: any, o: any) => import("@smithy/types").Pluggable<any, any>[];
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Command as $Command } from "@smithy/core/client";
|
|
2
1
|
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
-
import type { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
|
|
4
2
|
import type { ApplyGuardrailRequest, ApplyGuardrailResponse } from "../models/models_0";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
6
|
export type { __MetadataBearer };
|
|
9
|
-
export { $Command };
|
|
10
7
|
/**
|
|
11
8
|
* @public
|
|
12
9
|
*
|
|
@@ -22,11 +19,9 @@ export interface ApplyGuardrailCommandInput extends ApplyGuardrailRequest {
|
|
|
22
19
|
export interface ApplyGuardrailCommandOutput extends ApplyGuardrailResponse, __MetadataBearer {
|
|
23
20
|
}
|
|
24
21
|
declare const ApplyGuardrailCommand_base: {
|
|
25
|
-
new (input: ApplyGuardrailCommandInput): import("@smithy/core/client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
-
new (input: ApplyGuardrailCommandInput): import("@smithy/core/client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
-
getEndpointParameterInstructions():
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
};
|
|
22
|
+
new (input: ApplyGuardrailCommandInput): import("@smithy/core/client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: ApplyGuardrailCommandInput): import("@smithy/core/client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
30
25
|
};
|
|
31
26
|
/**
|
|
32
27
|
* <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>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Command as $Command } from "@smithy/core/client";
|
|
2
1
|
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
-
import type { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
|
|
4
2
|
import type { ConverseRequest, ConverseResponse } from "../models/models_0";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
6
|
export type { __MetadataBearer };
|
|
9
|
-
export { $Command };
|
|
10
7
|
/**
|
|
11
8
|
* @public
|
|
12
9
|
*
|
|
@@ -22,11 +19,9 @@ export interface ConverseCommandInput extends ConverseRequest {
|
|
|
22
19
|
export interface ConverseCommandOutput extends ConverseResponse, __MetadataBearer {
|
|
23
20
|
}
|
|
24
21
|
declare const ConverseCommand_base: {
|
|
25
|
-
new (input: ConverseCommandInput): import("@smithy/core/client").CommandImpl<ConverseCommandInput, ConverseCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
-
new (input: ConverseCommandInput): import("@smithy/core/client").CommandImpl<ConverseCommandInput, ConverseCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
-
getEndpointParameterInstructions():
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
};
|
|
22
|
+
new (input: ConverseCommandInput): import("@smithy/core/client").CommandImpl<ConverseCommandInput, ConverseCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: ConverseCommandInput): import("@smithy/core/client").CommandImpl<ConverseCommandInput, ConverseCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
30
25
|
};
|
|
31
26
|
/**
|
|
32
27
|
* <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>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Command as $Command } from "@smithy/core/client";
|
|
2
1
|
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
-
import type { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
|
|
4
2
|
import type { ConverseStreamRequest, ConverseStreamResponse } from "../models/models_0";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
6
|
export type { __MetadataBearer };
|
|
9
|
-
export { $Command };
|
|
10
7
|
/**
|
|
11
8
|
* @public
|
|
12
9
|
*
|
|
@@ -22,11 +19,9 @@ export interface ConverseStreamCommandInput extends ConverseStreamRequest {
|
|
|
22
19
|
export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __MetadataBearer {
|
|
23
20
|
}
|
|
24
21
|
declare const ConverseStreamCommand_base: {
|
|
25
|
-
new (input: ConverseStreamCommandInput): import("@smithy/core/client").CommandImpl<ConverseStreamCommandInput, ConverseStreamCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
-
new (input: ConverseStreamCommandInput): import("@smithy/core/client").CommandImpl<ConverseStreamCommandInput, ConverseStreamCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
-
getEndpointParameterInstructions():
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
};
|
|
22
|
+
new (input: ConverseStreamCommandInput): import("@smithy/core/client").CommandImpl<ConverseStreamCommandInput, ConverseStreamCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: ConverseStreamCommandInput): import("@smithy/core/client").CommandImpl<ConverseStreamCommandInput, ConverseStreamCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
30
25
|
};
|
|
31
26
|
/**
|
|
32
27
|
* <p>Sends messages to the specified Amazon Bedrock model and returns the response in a stream. <code>ConverseStream</code> provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. </p> <p>To find out if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a> and check the <code>responseStreamingSupported</code> field in the response.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>ConverseStream</code>.</p> </note> <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>Conversation streaming example</i> in the <i>Amazon Bedrock User Guide</i>. </p> <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</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>ConverseStream</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>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Command as $Command } from "@smithy/core/client";
|
|
2
1
|
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
-
import type { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
|
|
4
2
|
import type { CountTokensRequest, CountTokensResponse } from "../models/models_0";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
6
|
export type { __MetadataBearer };
|
|
9
|
-
export { $Command };
|
|
10
7
|
/**
|
|
11
8
|
* @public
|
|
12
9
|
*
|
|
@@ -22,11 +19,9 @@ export interface CountTokensCommandInput extends CountTokensRequest {
|
|
|
22
19
|
export interface CountTokensCommandOutput extends CountTokensResponse, __MetadataBearer {
|
|
23
20
|
}
|
|
24
21
|
declare const CountTokensCommand_base: {
|
|
25
|
-
new (input: CountTokensCommandInput): import("@smithy/core/client").CommandImpl<CountTokensCommandInput, CountTokensCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
-
new (input: CountTokensCommandInput): import("@smithy/core/client").CommandImpl<CountTokensCommandInput, CountTokensCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
-
getEndpointParameterInstructions():
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
};
|
|
22
|
+
new (input: CountTokensCommandInput): import("@smithy/core/client").CommandImpl<CountTokensCommandInput, CountTokensCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: CountTokensCommandInput): import("@smithy/core/client").CommandImpl<CountTokensCommandInput, CountTokensCommandOutput, import("..").BedrockRuntimeClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
30
25
|
};
|
|
31
26
|
/**
|
|
32
27
|
* <p>Returns the token count for a given inference request. This operation helps you estimate token usage before sending requests to foundation models by returning the token count that would be used if the same input were sent to the model in an inference request.</p> <p>Token counting is model-specific because different models use different tokenization strategies. The token count returned by this operation will match the token count that would be charged if the same input were sent to the model in an <code>InvokeModel</code> or <code>Converse</code> request.</p> <p>You can use this operation to:</p> <ul> <li> <p>Estimate costs before sending inference requests.</p> </li> <li> <p>Optimize prompts to fit within token limits.</p> </li> <li> <p>Plan for token usage in your applications.</p> </li> </ul> <p>This operation accepts the same input formats as <code>InvokeModel</code> and <code>Converse</code>, allowing you to count tokens for both raw text inputs and structured conversation formats.</p> <p>The following operations are related to <code>CountTokens</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_InvokeModel.html">InvokeModel</a> - Sends inference requests to foundation models</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_Converse.html">Converse</a> - Sends conversation-based inference requests to foundation models</p> </li> </ul>
|