@ai-sdk/amazon-bedrock 4.0.86 → 4.0.88
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/CHANGELOG.md +13 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/docs/08-amazon-bedrock.mdx +31 -0
- package/package.json +2 -2
- package/src/bedrock-api-types.ts +3 -0
- package/src/bedrock-chat-language-model.ts +6 -0
- package/src/bedrock-chat-options.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 4.0.88
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [94aed06]
|
|
8
|
+
- @ai-sdk/anthropic@3.0.65
|
|
9
|
+
|
|
10
|
+
## 4.0.87
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- df099b9: feat(bedrock): add support for service tier for model inference
|
|
15
|
+
|
|
3
16
|
## 4.0.86
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/anthropic/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
|
35
35
|
var import_aws4fetch = require("aws4fetch");
|
|
36
36
|
|
|
37
37
|
// src/version.ts
|
|
38
|
-
var VERSION = true ? "4.0.
|
|
38
|
+
var VERSION = true ? "4.0.88" : "0.0.0-test";
|
|
39
39
|
|
|
40
40
|
// src/bedrock-sigv4-fetch.ts
|
|
41
41
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
package/dist/anthropic/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { AwsV4Signer } from "aws4fetch";
|
|
25
25
|
|
|
26
26
|
// src/version.ts
|
|
27
|
-
var VERSION = true ? "4.0.
|
|
27
|
+
var VERSION = true ? "4.0.88" : "0.0.0-test";
|
|
28
28
|
|
|
29
29
|
// src/bedrock-sigv4-fetch.ts
|
|
30
30
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
package/dist/index.d.mts
CHANGED
|
@@ -49,6 +49,12 @@ declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
|
49
49
|
}>>;
|
|
50
50
|
}, z.core.$strip>>;
|
|
51
51
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
default: "default";
|
|
54
|
+
reserved: "reserved";
|
|
55
|
+
priority: "priority";
|
|
56
|
+
flex: "flex";
|
|
57
|
+
}>>;
|
|
52
58
|
}, z.core.$strip>;
|
|
53
59
|
type AmazonBedrockLanguageModelOptions = z.infer<typeof amazonBedrockLanguageModelOptions>;
|
|
54
60
|
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,12 @@ declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
|
49
49
|
}>>;
|
|
50
50
|
}, z.core.$strip>>;
|
|
51
51
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
default: "default";
|
|
54
|
+
reserved: "reserved";
|
|
55
|
+
priority: "priority";
|
|
56
|
+
flex: "flex";
|
|
57
|
+
}>>;
|
|
52
58
|
}, z.core.$strip>;
|
|
53
59
|
type AmazonBedrockLanguageModelOptions = z.infer<typeof amazonBedrockLanguageModelOptions>;
|
|
54
60
|
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,17 @@ var amazonBedrockLanguageModelOptions = import_v4.z.object({
|
|
|
98
98
|
/**
|
|
99
99
|
* Anthropic beta features to enable
|
|
100
100
|
*/
|
|
101
|
-
anthropicBeta: import_v4.z.array(import_v4.z.string()).optional()
|
|
101
|
+
anthropicBeta: import_v4.z.array(import_v4.z.string()).optional(),
|
|
102
|
+
/**
|
|
103
|
+
* Service tier for the request.
|
|
104
|
+
* @see https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html
|
|
105
|
+
*
|
|
106
|
+
* - 'reserved': Uses provisioned throughput capacity
|
|
107
|
+
* - 'priority': Prioritizes low-latency inference when capacity is available
|
|
108
|
+
* - 'default': Standard on-demand tier
|
|
109
|
+
* - 'flex': Lower-cost tier for flexible latency workloads
|
|
110
|
+
*/
|
|
111
|
+
serviceTier: import_v4.z.enum(["reserved", "priority", "default", "flex"]).optional()
|
|
102
112
|
});
|
|
103
113
|
|
|
104
114
|
// src/bedrock-error.ts
|
|
@@ -995,6 +1005,7 @@ var BedrockChatLanguageModel = class {
|
|
|
995
1005
|
const {
|
|
996
1006
|
reasoningConfig: _,
|
|
997
1007
|
additionalModelRequestFields: __,
|
|
1008
|
+
serviceTier: ___,
|
|
998
1009
|
...filteredBedrockOptions
|
|
999
1010
|
} = (providerOptions == null ? void 0 : providerOptions.bedrock) || {};
|
|
1000
1011
|
const additionalModelResponseFieldPaths = isAnthropicModel ? ["/delta/stop_sequence"] : void 0;
|
|
@@ -1009,6 +1020,11 @@ var BedrockChatLanguageModel = class {
|
|
|
1009
1020
|
...Object.keys(inferenceConfig).length > 0 && {
|
|
1010
1021
|
inferenceConfig
|
|
1011
1022
|
},
|
|
1023
|
+
...bedrockOptions.serviceTier != null && {
|
|
1024
|
+
serviceTier: {
|
|
1025
|
+
type: bedrockOptions.serviceTier
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
1012
1028
|
...filteredBedrockOptions,
|
|
1013
1029
|
...toolConfig.tools !== void 0 && toolConfig.tools.length > 0 ? { toolConfig } : {}
|
|
1014
1030
|
},
|
|
@@ -1952,7 +1968,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
|
1952
1968
|
var import_aws4fetch = require("aws4fetch");
|
|
1953
1969
|
|
|
1954
1970
|
// src/version.ts
|
|
1955
|
-
var VERSION = true ? "4.0.
|
|
1971
|
+
var VERSION = true ? "4.0.88" : "0.0.0-test";
|
|
1956
1972
|
|
|
1957
1973
|
// src/bedrock-sigv4-fetch.ts
|
|
1958
1974
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|