@ai-sdk/amazon-bedrock 5.0.0-beta.15 → 5.0.0-beta.17

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 5.0.0-beta.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [986c6fd]
8
+ - Updated dependencies [493295c]
9
+ - @ai-sdk/provider-utils@5.0.0-beta.8
10
+ - @ai-sdk/anthropic@4.0.0-beta.13
11
+
12
+ ## 5.0.0-beta.16
13
+
14
+ ### Patch Changes
15
+
16
+ - 6d8716c: feat(bedrock): add support for service tier for model inference
17
+
3
18
  ## 5.0.0-beta.15
4
19
 
5
20
  ### Patch Changes
@@ -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 ? "5.0.0-beta.15" : "0.0.0-test";
38
+ var VERSION = true ? "5.0.0-beta.17" : "0.0.0-test";
39
39
 
40
40
  // src/bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
@@ -24,7 +24,7 @@ import {
24
24
  import { AwsV4Signer } from "aws4fetch";
25
25
 
26
26
  // src/version.ts
27
- var VERSION = true ? "5.0.0-beta.15" : "0.0.0-test";
27
+ var VERSION = true ? "5.0.0-beta.17" : "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
@@ -99,7 +99,17 @@ var amazonBedrockLanguageModelOptions = import_v4.z.object({
99
99
  /**
100
100
  * Anthropic beta features to enable
101
101
  */
102
- anthropicBeta: import_v4.z.array(import_v4.z.string()).optional()
102
+ anthropicBeta: import_v4.z.array(import_v4.z.string()).optional(),
103
+ /**
104
+ * Service tier for the request.
105
+ * @see https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html
106
+ *
107
+ * - 'reserved': Uses provisioned throughput capacity
108
+ * - 'priority': Prioritizes low-latency inference when capacity is available
109
+ * - 'default': Standard on-demand tier
110
+ * - 'flex': Lower-cost tier for flexible latency workloads
111
+ */
112
+ serviceTier: import_v4.z.enum(["reserved", "priority", "default", "flex"]).optional()
103
113
  });
104
114
 
105
115
  // src/bedrock-error.ts
@@ -1004,6 +1014,7 @@ var BedrockChatLanguageModel = class {
1004
1014
  const {
1005
1015
  reasoningConfig: _,
1006
1016
  additionalModelRequestFields: __,
1017
+ serviceTier: ___,
1007
1018
  ...filteredBedrockOptions
1008
1019
  } = (providerOptions == null ? void 0 : providerOptions.bedrock) || {};
1009
1020
  const additionalModelResponseFieldPaths = isAnthropicModel ? ["/delta/stop_sequence"] : void 0;
@@ -1018,6 +1029,11 @@ var BedrockChatLanguageModel = class {
1018
1029
  ...Object.keys(inferenceConfig).length > 0 && {
1019
1030
  inferenceConfig
1020
1031
  },
1032
+ ...bedrockOptions.serviceTier != null && {
1033
+ serviceTier: {
1034
+ type: bedrockOptions.serviceTier
1035
+ }
1036
+ },
1021
1037
  ...filteredBedrockOptions,
1022
1038
  ...toolConfig.tools !== void 0 && toolConfig.tools.length > 0 ? { toolConfig } : {}
1023
1039
  },
@@ -2017,7 +2033,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
2017
2033
  var import_aws4fetch = require("aws4fetch");
2018
2034
 
2019
2035
  // src/version.ts
2020
- var VERSION = true ? "5.0.0-beta.15" : "0.0.0-test";
2036
+ var VERSION = true ? "5.0.0-beta.17" : "0.0.0-test";
2021
2037
 
2022
2038
  // src/bedrock-sigv4-fetch.ts
2023
2039
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {