@ai-sdk/amazon-bedrock 4.0.85 → 4.0.87
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 +12 -0
- package/dist/anthropic/index.js +19 -1
- package/dist/anthropic/index.js.map +1 -1
- package/dist/anthropic/index.mjs +19 -1
- package/dist/anthropic/index.mjs.map +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 +1 -1
- package/src/anthropic/bedrock-anthropic-fetch.ts +26 -0
- 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/dist/index.mjs
CHANGED
|
@@ -83,7 +83,17 @@ var amazonBedrockLanguageModelOptions = z.object({
|
|
|
83
83
|
/**
|
|
84
84
|
* Anthropic beta features to enable
|
|
85
85
|
*/
|
|
86
|
-
anthropicBeta: z.array(z.string()).optional()
|
|
86
|
+
anthropicBeta: z.array(z.string()).optional(),
|
|
87
|
+
/**
|
|
88
|
+
* Service tier for the request.
|
|
89
|
+
* @see https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html
|
|
90
|
+
*
|
|
91
|
+
* - 'reserved': Uses provisioned throughput capacity
|
|
92
|
+
* - 'priority': Prioritizes low-latency inference when capacity is available
|
|
93
|
+
* - 'default': Standard on-demand tier
|
|
94
|
+
* - 'flex': Lower-cost tier for flexible latency workloads
|
|
95
|
+
*/
|
|
96
|
+
serviceTier: z.enum(["reserved", "priority", "default", "flex"]).optional()
|
|
87
97
|
});
|
|
88
98
|
|
|
89
99
|
// 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
|
},
|
|
@@ -1973,7 +1989,7 @@ import {
|
|
|
1973
1989
|
import { AwsV4Signer } from "aws4fetch";
|
|
1974
1990
|
|
|
1975
1991
|
// src/version.ts
|
|
1976
|
-
var VERSION = true ? "4.0.
|
|
1992
|
+
var VERSION = true ? "4.0.87" : "0.0.0-test";
|
|
1977
1993
|
|
|
1978
1994
|
// src/bedrock-sigv4-fetch.ts
|
|
1979
1995
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|