@ai-sdk/amazon-bedrock 2.2.9 → 3.0.0-alpha.2

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,42 +1,223 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
- ## 2.2.9
3
+ ## 3.0.0-alpha.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [d87b9d1]
8
- - @ai-sdk/provider-utils@2.2.8
7
+ - Updated dependencies [26535e0]
8
+ - @ai-sdk/provider@2.0.0-alpha.2
9
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
9
10
 
10
- ## 2.2.8
11
+ ## 3.0.0-alpha.1
11
12
 
12
13
  ### Patch Changes
13
14
 
14
- - Updated dependencies [beef951]
15
- - @ai-sdk/provider@1.1.3
16
- - @ai-sdk/provider-utils@2.2.7
15
+ - Updated dependencies [3f2f00c]
16
+ - @ai-sdk/provider@2.0.0-alpha.1
17
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
17
18
 
18
- ## 2.2.7
19
+ ## 3.0.0-canary.19
19
20
 
20
21
  ### Patch Changes
21
22
 
22
- - Updated dependencies [013faa8]
23
- - @ai-sdk/provider@1.1.2
24
- - @ai-sdk/provider-utils@2.2.6
23
+ - Updated dependencies [faf8446]
24
+ - @ai-sdk/provider-utils@3.0.0-canary.19
25
25
 
26
- ## 2.2.6
26
+ ## 3.0.0-canary.18
27
27
 
28
28
  ### Patch Changes
29
29
 
30
- - Updated dependencies [c21fa6d]
31
- - @ai-sdk/provider-utils@2.2.5
32
- - @ai-sdk/provider@1.1.1
30
+ - Updated dependencies [40acf9b]
31
+ - @ai-sdk/provider-utils@3.0.0-canary.18
33
32
 
34
- ## 2.2.5
33
+ ## 3.0.0-canary.17
35
34
 
36
35
  ### Patch Changes
37
36
 
38
- - Updated dependencies [2c19b9a]
39
- - @ai-sdk/provider-utils@2.2.4
37
+ - Updated dependencies [ea7a7c9]
38
+ - @ai-sdk/provider-utils@3.0.0-canary.17
39
+
40
+ ## 3.0.0-canary.16
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [87b828f]
45
+ - @ai-sdk/provider-utils@3.0.0-canary.16
46
+
47
+ ## 3.0.0-canary.15
48
+
49
+ ### Patch Changes
50
+
51
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
52
+ - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions
53
+ - Updated dependencies [a571d6e]
54
+ - Updated dependencies [a8c8bd5]
55
+ - Updated dependencies [7979f7f]
56
+ - Updated dependencies [41fa418]
57
+ - @ai-sdk/provider-utils@3.0.0-canary.15
58
+ - @ai-sdk/provider@2.0.0-canary.14
59
+
60
+ ## 3.0.0-canary.14
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [957b739]
65
+ - Updated dependencies [9bd5ab5]
66
+ - @ai-sdk/provider-utils@3.0.0-canary.14
67
+ - @ai-sdk/provider@2.0.0-canary.13
68
+
69
+ ## 3.0.0-canary.13
70
+
71
+ ### Patch Changes
72
+
73
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
74
+ - Updated dependencies [7b3ae3f]
75
+ - Updated dependencies [0ff02bb]
76
+ - @ai-sdk/provider@2.0.0-canary.12
77
+ - @ai-sdk/provider-utils@3.0.0-canary.13
78
+
79
+ ## 3.0.0-canary.12
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [9bf7291]
84
+ - Updated dependencies [4617fab]
85
+ - Updated dependencies [e030615]
86
+ - @ai-sdk/provider@2.0.0-canary.11
87
+ - @ai-sdk/provider-utils@3.0.0-canary.12
88
+
89
+ ## 3.0.0-canary.11
90
+
91
+ ### Patch Changes
92
+
93
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
94
+ - Updated dependencies [66962ed]
95
+ - Updated dependencies [9301f86]
96
+ - Updated dependencies [a3f768e]
97
+ - @ai-sdk/provider-utils@3.0.0-canary.11
98
+ - @ai-sdk/provider@2.0.0-canary.10
99
+
100
+ ## 3.0.0-canary.10
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [e86be6f]
105
+ - @ai-sdk/provider@2.0.0-canary.9
106
+ - @ai-sdk/provider-utils@3.0.0-canary.10
107
+
108
+ ## 3.0.0-canary.9
109
+
110
+ ### Patch Changes
111
+
112
+ - 92c0b4b: chore(providers/bedrock): update embedding model to use providerOptions
113
+ - Updated dependencies [95857aa]
114
+ - Updated dependencies [7ea4132]
115
+ - @ai-sdk/provider@2.0.0-canary.8
116
+ - @ai-sdk/provider-utils@3.0.0-canary.9
117
+
118
+ ## 3.0.0-canary.8
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [5d142ab]
123
+ - Updated dependencies [b6b43c7]
124
+ - Updated dependencies [8aa9e20]
125
+ - Updated dependencies [3795467]
126
+ - @ai-sdk/provider-utils@3.0.0-canary.8
127
+ - @ai-sdk/provider@2.0.0-canary.7
128
+
129
+ ## 3.0.0-canary.7
130
+
131
+ ### Patch Changes
132
+
133
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
134
+ - 26735b5: chore(embedding-model): add v2 interface
135
+ - Updated dependencies [26735b5]
136
+ - Updated dependencies [443d8ec]
137
+ - Updated dependencies [14c9410]
138
+ - Updated dependencies [d9c98f4]
139
+ - Updated dependencies [c4a2fec]
140
+ - Updated dependencies [0054544]
141
+ - Updated dependencies [9e9c809]
142
+ - Updated dependencies [32831c6]
143
+ - Updated dependencies [d0f9495]
144
+ - Updated dependencies [fd65bc6]
145
+ - Updated dependencies [393138b]
146
+ - Updated dependencies [7182d14]
147
+ - @ai-sdk/provider@2.0.0-canary.6
148
+ - @ai-sdk/provider-utils@3.0.0-canary.7
149
+
150
+ ## 3.0.0-canary.6
151
+
152
+ ### Patch Changes
153
+
154
+ - 97ea26f: chore(providers/bedrock): convert to providerOptions
155
+ - 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
156
+ - Updated dependencies [411e483]
157
+ - Updated dependencies [79457bd]
158
+ - Updated dependencies [ad80501]
159
+ - Updated dependencies [1766ede]
160
+ - Updated dependencies [f10304b]
161
+ - @ai-sdk/provider@2.0.0-canary.5
162
+ - @ai-sdk/provider-utils@3.0.0-canary.6
163
+
164
+ ## 3.0.0-canary.5
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies [6f6bb89]
169
+ - @ai-sdk/provider@2.0.0-canary.4
170
+ - @ai-sdk/provider-utils@3.0.0-canary.5
171
+
172
+ ## 3.0.0-canary.4
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies [d1a1aa1]
177
+ - @ai-sdk/provider@2.0.0-canary.3
178
+ - @ai-sdk/provider-utils@3.0.0-canary.4
179
+
180
+ ## 3.0.0-canary.3
181
+
182
+ ### Patch Changes
183
+
184
+ - Updated dependencies [a166433]
185
+ - Updated dependencies [abf9a79]
186
+ - Updated dependencies [9f95b35]
187
+ - Updated dependencies [0a87932]
188
+ - Updated dependencies [6dc848c]
189
+ - @ai-sdk/provider-utils@3.0.0-canary.3
190
+ - @ai-sdk/provider@2.0.0-canary.2
191
+
192
+ ## 3.0.0-canary.2
193
+
194
+ ### Patch Changes
195
+
196
+ - Updated dependencies [c57e248]
197
+ - Updated dependencies [33f4a6a]
198
+ - @ai-sdk/provider@2.0.0-canary.1
199
+ - @ai-sdk/provider-utils@3.0.0-canary.2
200
+
201
+ ## 3.0.0-canary.1
202
+
203
+ ### Patch Changes
204
+
205
+ - Updated dependencies [060370c]
206
+ - Updated dependencies [0c0c0b3]
207
+ - Updated dependencies [63d791d]
208
+ - @ai-sdk/provider-utils@3.0.0-canary.1
209
+
210
+ ## 3.0.0-canary.0
211
+
212
+ ### Major Changes
213
+
214
+ - d5f588f: AI SDK 5
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies [d5f588f]
219
+ - @ai-sdk/provider-utils@3.0.0-canary.0
220
+ - @ai-sdk/provider@2.0.0-canary.0
40
221
 
41
222
  ## 2.2.4
42
223
 
package/dist/index.d.mts CHANGED
@@ -1,38 +1,43 @@
1
- import { ProviderV1, LanguageModelV1, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod';
3
4
 
4
5
  type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
5
- interface BedrockChatSettings {
6
+ declare const bedrockProviderOptions: z.ZodObject<{
6
7
  /**
7
- Additional inference parameters that the model supports,
8
- beyond the base set of inference parameters that Converse
9
- supports in the inferenceConfig field
10
- */
11
- additionalModelRequestFields?: Record<string, any>;
12
- }
8
+ * Additional inference parameters that the model supports,
9
+ * beyond the base set of inference parameters that Converse
10
+ * supports in the inferenceConfig field
11
+ */
12
+ additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
+ reasoningConfig: z.ZodOptional<z.ZodObject<{
14
+ type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>;
15
+ budgetTokens: z.ZodOptional<z.ZodNumber>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type?: "enabled" | "disabled" | undefined;
18
+ budgetTokens?: number | undefined;
19
+ }, {
20
+ type?: "enabled" | "disabled" | undefined;
21
+ budgetTokens?: number | undefined;
22
+ }>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ additionalModelRequestFields?: Record<string, any> | undefined;
25
+ reasoningConfig?: {
26
+ type?: "enabled" | "disabled" | undefined;
27
+ budgetTokens?: number | undefined;
28
+ } | undefined;
29
+ }, {
30
+ additionalModelRequestFields?: Record<string, any> | undefined;
31
+ reasoningConfig?: {
32
+ type?: "enabled" | "disabled" | undefined;
33
+ budgetTokens?: number | undefined;
34
+ } | undefined;
35
+ }>;
36
+ type BedrockProviderOptions = z.infer<typeof bedrockProviderOptions>;
13
37
 
14
38
  type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
15
- interface BedrockEmbeddingSettings {
16
- /**
17
- The number of dimensions the resulting output embeddings should have (defaults to 1024).
18
- Only supported in amazon.titan-embed-text-v2:0.
19
- */
20
- dimensions?: 1024 | 512 | 256;
21
- /**
22
- Flag indicating whether or not to normalize the output embeddings. Defaults to true
23
- Only supported in amazon.titan-embed-text-v2:0.
24
- */
25
- normalize?: boolean;
26
- }
27
39
 
28
40
  type BedrockImageModelId = 'amazon.nova-canvas-v1:0' | (string & {});
29
- interface BedrockImageSettings {
30
- /**
31
- * Override the maximum number of images per call (default is dependent on the
32
- * model, or 1 for an unknown model).
33
- */
34
- maxImagesPerCall?: number;
35
- }
36
41
 
37
42
  interface BedrockCredentials {
38
43
  region: string;
@@ -84,12 +89,19 @@ interface AmazonBedrockProviderSettings {
84
89
  credentialProvider?: () => PromiseLike<Omit<BedrockCredentials, 'region'>>;
85
90
  generateId?: () => string;
86
91
  }
87
- interface AmazonBedrockProvider extends ProviderV1 {
88
- (modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV1;
89
- languageModel(modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV1;
90
- embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV1<string>;
91
- image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
- imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
+ interface AmazonBedrockProvider extends ProviderV2 {
93
+ (modelId: BedrockChatModelId): LanguageModelV2;
94
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
95
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
96
+ /**
97
+ Creates a model for image generation.
98
+ @deprecated Use `imageModel` instead.
99
+ */
100
+ image(modelId: BedrockImageModelId): ImageModelV2;
101
+ /**
102
+ Creates a model for image generation.
103
+ */
104
+ imageModel(modelId: BedrockImageModelId): ImageModelV2;
93
105
  }
94
106
  /**
95
107
  Create an Amazon Bedrock provider instance.
@@ -100,4 +112,4 @@ Default Bedrock provider instance.
100
112
  */
101
113
  declare const bedrock: AmazonBedrockProvider;
102
114
 
103
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
115
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };
package/dist/index.d.ts CHANGED
@@ -1,38 +1,43 @@
1
- import { ProviderV1, LanguageModelV1, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod';
3
4
 
4
5
  type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
5
- interface BedrockChatSettings {
6
+ declare const bedrockProviderOptions: z.ZodObject<{
6
7
  /**
7
- Additional inference parameters that the model supports,
8
- beyond the base set of inference parameters that Converse
9
- supports in the inferenceConfig field
10
- */
11
- additionalModelRequestFields?: Record<string, any>;
12
- }
8
+ * Additional inference parameters that the model supports,
9
+ * beyond the base set of inference parameters that Converse
10
+ * supports in the inferenceConfig field
11
+ */
12
+ additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
+ reasoningConfig: z.ZodOptional<z.ZodObject<{
14
+ type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>;
15
+ budgetTokens: z.ZodOptional<z.ZodNumber>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type?: "enabled" | "disabled" | undefined;
18
+ budgetTokens?: number | undefined;
19
+ }, {
20
+ type?: "enabled" | "disabled" | undefined;
21
+ budgetTokens?: number | undefined;
22
+ }>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ additionalModelRequestFields?: Record<string, any> | undefined;
25
+ reasoningConfig?: {
26
+ type?: "enabled" | "disabled" | undefined;
27
+ budgetTokens?: number | undefined;
28
+ } | undefined;
29
+ }, {
30
+ additionalModelRequestFields?: Record<string, any> | undefined;
31
+ reasoningConfig?: {
32
+ type?: "enabled" | "disabled" | undefined;
33
+ budgetTokens?: number | undefined;
34
+ } | undefined;
35
+ }>;
36
+ type BedrockProviderOptions = z.infer<typeof bedrockProviderOptions>;
13
37
 
14
38
  type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
15
- interface BedrockEmbeddingSettings {
16
- /**
17
- The number of dimensions the resulting output embeddings should have (defaults to 1024).
18
- Only supported in amazon.titan-embed-text-v2:0.
19
- */
20
- dimensions?: 1024 | 512 | 256;
21
- /**
22
- Flag indicating whether or not to normalize the output embeddings. Defaults to true
23
- Only supported in amazon.titan-embed-text-v2:0.
24
- */
25
- normalize?: boolean;
26
- }
27
39
 
28
40
  type BedrockImageModelId = 'amazon.nova-canvas-v1:0' | (string & {});
29
- interface BedrockImageSettings {
30
- /**
31
- * Override the maximum number of images per call (default is dependent on the
32
- * model, or 1 for an unknown model).
33
- */
34
- maxImagesPerCall?: number;
35
- }
36
41
 
37
42
  interface BedrockCredentials {
38
43
  region: string;
@@ -84,12 +89,19 @@ interface AmazonBedrockProviderSettings {
84
89
  credentialProvider?: () => PromiseLike<Omit<BedrockCredentials, 'region'>>;
85
90
  generateId?: () => string;
86
91
  }
87
- interface AmazonBedrockProvider extends ProviderV1 {
88
- (modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV1;
89
- languageModel(modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV1;
90
- embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV1<string>;
91
- image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
- imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
+ interface AmazonBedrockProvider extends ProviderV2 {
93
+ (modelId: BedrockChatModelId): LanguageModelV2;
94
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
95
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
96
+ /**
97
+ Creates a model for image generation.
98
+ @deprecated Use `imageModel` instead.
99
+ */
100
+ image(modelId: BedrockImageModelId): ImageModelV2;
101
+ /**
102
+ Creates a model for image generation.
103
+ */
104
+ imageModel(modelId: BedrockImageModelId): ImageModelV2;
93
105
  }
94
106
  /**
95
107
  Create an Amazon Bedrock provider instance.
@@ -100,4 +112,4 @@ Default Bedrock provider instance.
100
112
  */
101
113
  declare const bedrock: AmazonBedrockProvider;
102
114
 
103
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
115
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };