@ai-sdk/amazon-bedrock 4.0.0-beta.98 → 4.0.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/CHANGELOG.md +307 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +229 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +230 -90
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,312 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dee8b05: ai SDK 6 beta
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 78928cb: release: start 5.1 beta
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 0c3b58b: fix(provider): add specificationVersion to ProviderV3
|
|
16
|
+
- ef9d7d6: fix(bedrock): send {} as tool input when streaming tool calls without arguments
|
|
17
|
+
- 9ab6ebe: feat(provider/amazon-bedrock): expose stop_sequence in provider metadata
|
|
18
|
+
|
|
19
|
+
The Bedrock provider now exposes the specific stop sequence that triggered generation to halt via `providerMetadata.bedrock.stopSequence`. This is implemented by:
|
|
20
|
+
|
|
21
|
+
- Requesting `/stop_sequence` via `additionalModelResponseFieldPaths` in the API call
|
|
22
|
+
- Parsing the value from `additionalModelResponseFields.stop_sequence` in both generate and stream responses
|
|
23
|
+
- Exposing it as `stopSequence` in the provider metadata (returns `null` when no stop sequence was matched)
|
|
24
|
+
|
|
25
|
+
- 0adc679: feat(provider): shared spec v3
|
|
26
|
+
- 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
|
|
27
|
+
|
|
28
|
+
Before
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
model.textEmbeddingModel('my-model-id');
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
After
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
model.embeddingModel('my-model-id');
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- 2625a04: feat(openai); update spec for mcp approval
|
|
41
|
+
- cc24427: Fix reasoning with Bedrock when additionalModelRequestFields is used
|
|
42
|
+
- 95f65c2: chore: use import \* from zod/v4
|
|
43
|
+
- 58920e0: refactor: consolidate header normalization across packages, remove duplicates, preserve custom headers
|
|
44
|
+
- 2a2e17d: fix (provider/amazon-bedrock): deal gracefully with empty tool descriptions
|
|
45
|
+
- 9524761: feat: shorthand names for reranking models
|
|
46
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
47
|
+
- 0c4822d: feat: `EmbeddingModelV3`
|
|
48
|
+
- 33343c3: fix(amazon-bedrock): clamp temperature to valid 0-1 range with warnings
|
|
49
|
+
- 11eefa4: Support user provided filenames in amazon-bedrock-provider
|
|
50
|
+
- e8109d3: feat: tool execution approval
|
|
51
|
+
- ed329cb: feat: `Provider-V3`
|
|
52
|
+
- 3bd2689: feat: extended token usage
|
|
53
|
+
- d1bdadb: Added support for reranking models
|
|
54
|
+
- 1cad0ab: feat: add provider version to user-agent header
|
|
55
|
+
- d711ff8: chore: add model ID for Haiku 4.5
|
|
56
|
+
- 8dac895: feat: `LanguageModelV3`
|
|
57
|
+
- 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
|
|
58
|
+
- 9061dc0: feat: image editing
|
|
59
|
+
- 366f50b: chore(provider): add deprecated textEmbeddingModel and textEmbedding aliases
|
|
60
|
+
- c5e2a7c: Support citations in amazon-bedrock-provider
|
|
61
|
+
- 4616b86: chore: update zod peer depenedency version
|
|
62
|
+
- d4b2964: fix(provider/amazon-bedrock): normalise headers and body if input is of instance Request
|
|
63
|
+
- 88b2c7e: feat(provider/amazon-bedrock,provider/google-vertex-anthropic): add support for tool calling with structured output
|
|
64
|
+
|
|
65
|
+
Added support for combining tool calling with structured outputs in both Amazon Bedrock and Google Vertex Anthropic providers. This allows developers to use tools (like weather lookups, web search, etc.) alongside structured JSON output schemas, enabling multi-step agentic workflows with structured final outputs.
|
|
66
|
+
|
|
67
|
+
**Amazon Bedrock Changes:**
|
|
68
|
+
|
|
69
|
+
- Removed incorrect warning that prevented using tools with JSON response format
|
|
70
|
+
- Updated tool choice to use `{ type: 'required' }` instead of specific tool selection when using structured outputs
|
|
71
|
+
- Added `isJsonResponseFromTool` parameter to finish reason mapping
|
|
72
|
+
- JSON tool responses are correctly converted to text content and finish reason is mapped from `tool_use` to `stop`
|
|
73
|
+
- Added comprehensive test coverage for combining tools with structured outputs
|
|
74
|
+
- Added example files demonstrating the feature
|
|
75
|
+
|
|
76
|
+
**Google Vertex Anthropic Changes:**
|
|
77
|
+
|
|
78
|
+
- Inherits support from underlying Anthropic provider implementation
|
|
79
|
+
- Added test coverage to verify the feature works correctly
|
|
80
|
+
- Added example files demonstrating the feature
|
|
81
|
+
|
|
82
|
+
This brings Anthropic provider's structured output capabilities to the Amazon Bedrock and Google Vertex Anthropic providers.
|
|
83
|
+
|
|
84
|
+
- 3aeb791: Add Claude Sonnet 4.5 (claude-sonnet-4-5-20250929-v1:0) model support
|
|
85
|
+
- 522f6b8: feat: `ImageModelV3`
|
|
86
|
+
- 0a6fd91: fix(amazon-bedrock): move anthropic_beta to request body
|
|
87
|
+
- 3794514: feat: flexible tool output content support
|
|
88
|
+
- cbf52cd: feat: expose raw finish reason
|
|
89
|
+
- f65d7df: feat(provider/bedrock): Support Nova 2 extended reasoning `maxReasoningEffort` field
|
|
90
|
+
- 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
|
|
91
|
+
- 9ab6ebe: Add stop sequence support for amazon bedrock provider
|
|
92
|
+
- 1bd7d32: feat: tool-specific strict mode
|
|
93
|
+
- Updated dependencies [0c3b58b]
|
|
94
|
+
- Updated dependencies [0adc679]
|
|
95
|
+
- Updated dependencies [50b70d6]
|
|
96
|
+
- Updated dependencies [d1bdadb]
|
|
97
|
+
- Updated dependencies [b8ea36e]
|
|
98
|
+
- Updated dependencies [ed537e1]
|
|
99
|
+
- Updated dependencies [2109385]
|
|
100
|
+
- Updated dependencies [dee8b05]
|
|
101
|
+
- Updated dependencies [046aa3b]
|
|
102
|
+
- Updated dependencies [7c4328e]
|
|
103
|
+
- Updated dependencies [8d9e8ad]
|
|
104
|
+
- Updated dependencies [f33a018]
|
|
105
|
+
- Updated dependencies [78928cb]
|
|
106
|
+
- Updated dependencies [b2dbfbf]
|
|
107
|
+
- Updated dependencies [dce03c4]
|
|
108
|
+
- Updated dependencies [2625a04]
|
|
109
|
+
- Updated dependencies [37c58a0]
|
|
110
|
+
- Updated dependencies [11e4abe]
|
|
111
|
+
- Updated dependencies [3b1d015]
|
|
112
|
+
- Updated dependencies [2b0caef]
|
|
113
|
+
- Updated dependencies [f13958c]
|
|
114
|
+
- Updated dependencies [afb00e3]
|
|
115
|
+
- Updated dependencies [95f65c2]
|
|
116
|
+
- Updated dependencies [016b111]
|
|
117
|
+
- Updated dependencies [58920e0]
|
|
118
|
+
- Updated dependencies [954c356]
|
|
119
|
+
- Updated dependencies [9e35785]
|
|
120
|
+
- Updated dependencies [544d4e8]
|
|
121
|
+
- Updated dependencies [a5f77a6]
|
|
122
|
+
- Updated dependencies [ca07285]
|
|
123
|
+
- Updated dependencies [0c4822d]
|
|
124
|
+
- Updated dependencies [a5a8db4]
|
|
125
|
+
- Updated dependencies [521c537]
|
|
126
|
+
- Updated dependencies [1742445]
|
|
127
|
+
- Updated dependencies [4c44a5b]
|
|
128
|
+
- Updated dependencies [e8109d3]
|
|
129
|
+
- Updated dependencies [87db851]
|
|
130
|
+
- Updated dependencies [03849b0]
|
|
131
|
+
- Updated dependencies [f6603b7]
|
|
132
|
+
- Updated dependencies [ed329cb]
|
|
133
|
+
- Updated dependencies [e06565c]
|
|
134
|
+
- Updated dependencies [32d8dbb]
|
|
135
|
+
- Updated dependencies [53f3368]
|
|
136
|
+
- Updated dependencies [d116b4b]
|
|
137
|
+
- Updated dependencies [3bd2689]
|
|
138
|
+
- Updated dependencies [293a6b7]
|
|
139
|
+
- Updated dependencies [703459a]
|
|
140
|
+
- Updated dependencies [1cad0ab]
|
|
141
|
+
- Updated dependencies [bb36798]
|
|
142
|
+
- Updated dependencies [83e5744]
|
|
143
|
+
- Updated dependencies [7e32fea]
|
|
144
|
+
- Updated dependencies [2049c5b]
|
|
145
|
+
- Updated dependencies [3ed5519]
|
|
146
|
+
- Updated dependencies [4c5a6be]
|
|
147
|
+
- Updated dependencies [9e1e758]
|
|
148
|
+
- Updated dependencies [589a4ee]
|
|
149
|
+
- Updated dependencies [8dac895]
|
|
150
|
+
- Updated dependencies [6f845b4]
|
|
151
|
+
- Updated dependencies [a755db5]
|
|
152
|
+
- Updated dependencies [cbb1d35]
|
|
153
|
+
- Updated dependencies [9354297]
|
|
154
|
+
- Updated dependencies [475189e]
|
|
155
|
+
- Updated dependencies [03849b0]
|
|
156
|
+
- Updated dependencies [0ae783e]
|
|
157
|
+
- Updated dependencies [457318b]
|
|
158
|
+
- Updated dependencies [b681d7d]
|
|
159
|
+
- Updated dependencies [eb56fc6]
|
|
160
|
+
- Updated dependencies [db913bd]
|
|
161
|
+
- Updated dependencies [9061dc0]
|
|
162
|
+
- Updated dependencies [fa35e95]
|
|
163
|
+
- Updated dependencies [32223c8]
|
|
164
|
+
- Updated dependencies [c1efac4]
|
|
165
|
+
- Updated dependencies [80894b3]
|
|
166
|
+
- Updated dependencies [366f50b]
|
|
167
|
+
- Updated dependencies [81d4308]
|
|
168
|
+
- Updated dependencies [6fc35cb]
|
|
169
|
+
- Updated dependencies [f4db7b5]
|
|
170
|
+
- Updated dependencies [6c38080]
|
|
171
|
+
- Updated dependencies [4616b86]
|
|
172
|
+
- Updated dependencies [81d4308]
|
|
173
|
+
- Updated dependencies [9549c9e]
|
|
174
|
+
- Updated dependencies [dedf206]
|
|
175
|
+
- Updated dependencies [af3780b]
|
|
176
|
+
- Updated dependencies [4f16c37]
|
|
177
|
+
- Updated dependencies [983e394]
|
|
178
|
+
- Updated dependencies [81e29ab]
|
|
179
|
+
- Updated dependencies [0e38a79]
|
|
180
|
+
- Updated dependencies [cf4e2a9]
|
|
181
|
+
- Updated dependencies [f4e4a95]
|
|
182
|
+
- Updated dependencies [522f6b8]
|
|
183
|
+
- Updated dependencies [6306603]
|
|
184
|
+
- Updated dependencies [21f378c]
|
|
185
|
+
- Updated dependencies [c5440c5]
|
|
186
|
+
- Updated dependencies [fca786b]
|
|
187
|
+
- Updated dependencies [1d15673]
|
|
188
|
+
- Updated dependencies [763d04a]
|
|
189
|
+
- Updated dependencies [9cff587]
|
|
190
|
+
- Updated dependencies [d129d89]
|
|
191
|
+
- Updated dependencies [10d819b]
|
|
192
|
+
- Updated dependencies [3794514]
|
|
193
|
+
- Updated dependencies [e1e2821]
|
|
194
|
+
- Updated dependencies [cbf52cd]
|
|
195
|
+
- Updated dependencies [e9e157f]
|
|
196
|
+
- Updated dependencies [10c1322]
|
|
197
|
+
- Updated dependencies [d08308b]
|
|
198
|
+
- Updated dependencies [05d5b9a]
|
|
199
|
+
- Updated dependencies [960ec8f]
|
|
200
|
+
- Updated dependencies [1bd7d32]
|
|
201
|
+
- Updated dependencies [83aaad8]
|
|
202
|
+
- Updated dependencies [f0b2157]
|
|
203
|
+
- Updated dependencies [95f65c2]
|
|
204
|
+
- @ai-sdk/anthropic@3.0.0
|
|
205
|
+
- @ai-sdk/provider@3.0.0
|
|
206
|
+
- @ai-sdk/provider-utils@4.0.0
|
|
207
|
+
|
|
208
|
+
## 4.0.0-beta.109
|
|
209
|
+
|
|
210
|
+
### Patch Changes
|
|
211
|
+
|
|
212
|
+
- Updated dependencies [2049c5b]
|
|
213
|
+
- @ai-sdk/anthropic@3.0.0-beta.98
|
|
214
|
+
|
|
215
|
+
## 4.0.0-beta.108
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- Updated dependencies [475189e]
|
|
220
|
+
- @ai-sdk/provider@3.0.0-beta.32
|
|
221
|
+
- @ai-sdk/anthropic@3.0.0-beta.97
|
|
222
|
+
- @ai-sdk/provider-utils@4.0.0-beta.59
|
|
223
|
+
|
|
224
|
+
## 4.0.0-beta.107
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- 2625a04: feat(openai); update spec for mcp approval
|
|
229
|
+
- Updated dependencies [2625a04]
|
|
230
|
+
- @ai-sdk/anthropic@3.0.0-beta.96
|
|
231
|
+
- @ai-sdk/provider@3.0.0-beta.31
|
|
232
|
+
- @ai-sdk/provider-utils@4.0.0-beta.58
|
|
233
|
+
|
|
234
|
+
## 4.0.0-beta.106
|
|
235
|
+
|
|
236
|
+
### Patch Changes
|
|
237
|
+
|
|
238
|
+
- cbf52cd: feat: expose raw finish reason
|
|
239
|
+
- Updated dependencies [cbf52cd]
|
|
240
|
+
- @ai-sdk/anthropic@3.0.0-beta.95
|
|
241
|
+
- @ai-sdk/provider@3.0.0-beta.30
|
|
242
|
+
- @ai-sdk/provider-utils@4.0.0-beta.57
|
|
243
|
+
|
|
244
|
+
## 4.0.0-beta.105
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- Updated dependencies [9549c9e]
|
|
249
|
+
- @ai-sdk/provider@3.0.0-beta.29
|
|
250
|
+
- @ai-sdk/anthropic@3.0.0-beta.94
|
|
251
|
+
- @ai-sdk/provider-utils@4.0.0-beta.56
|
|
252
|
+
|
|
253
|
+
## 4.0.0-beta.104
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- Updated dependencies [50b70d6]
|
|
258
|
+
- @ai-sdk/provider-utils@4.0.0-beta.55
|
|
259
|
+
- @ai-sdk/anthropic@3.0.0-beta.93
|
|
260
|
+
|
|
261
|
+
## 4.0.0-beta.103
|
|
262
|
+
|
|
263
|
+
### Patch Changes
|
|
264
|
+
|
|
265
|
+
- 9061dc0: feat: image editing
|
|
266
|
+
- Updated dependencies [9061dc0]
|
|
267
|
+
- @ai-sdk/provider-utils@4.0.0-beta.54
|
|
268
|
+
- @ai-sdk/provider@3.0.0-beta.28
|
|
269
|
+
- @ai-sdk/anthropic@3.0.0-beta.92
|
|
270
|
+
|
|
271
|
+
## 4.0.0-beta.102
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- 9ab6ebe: feat(provider/amazon-bedrock): expose stop_sequence in provider metadata
|
|
276
|
+
|
|
277
|
+
The Bedrock provider now exposes the specific stop sequence that triggered generation to halt via `providerMetadata.bedrock.stopSequence`. This is implemented by:
|
|
278
|
+
|
|
279
|
+
- Requesting `/stop_sequence` via `additionalModelResponseFieldPaths` in the API call
|
|
280
|
+
- Parsing the value from `additionalModelResponseFields.stop_sequence` in both generate and stream responses
|
|
281
|
+
- Exposing it as `stopSequence` in the provider metadata (returns `null` when no stop sequence was matched)
|
|
282
|
+
|
|
283
|
+
- 9ab6ebe: Add stop sequence support for amazon bedrock provider
|
|
284
|
+
|
|
285
|
+
## 4.0.0-beta.101
|
|
286
|
+
|
|
287
|
+
### Patch Changes
|
|
288
|
+
|
|
289
|
+
- Updated dependencies [d129d89]
|
|
290
|
+
- @ai-sdk/anthropic@3.0.0-beta.91
|
|
291
|
+
|
|
292
|
+
## 4.0.0-beta.100
|
|
293
|
+
|
|
294
|
+
### Patch Changes
|
|
295
|
+
|
|
296
|
+
- 366f50b: chore(provider): add deprecated textEmbeddingModel and textEmbedding aliases
|
|
297
|
+
- Updated dependencies [366f50b]
|
|
298
|
+
- @ai-sdk/anthropic@3.0.0-beta.90
|
|
299
|
+
- @ai-sdk/provider@3.0.0-beta.27
|
|
300
|
+
- @ai-sdk/provider-utils@4.0.0-beta.53
|
|
301
|
+
|
|
302
|
+
## 4.0.0-beta.99
|
|
303
|
+
|
|
304
|
+
### Patch Changes
|
|
305
|
+
|
|
306
|
+
- Updated dependencies [763d04a]
|
|
307
|
+
- @ai-sdk/provider-utils@4.0.0-beta.52
|
|
308
|
+
- @ai-sdk/anthropic@3.0.0-beta.89
|
|
309
|
+
|
|
3
310
|
## 4.0.0-beta.98
|
|
4
311
|
|
|
5
312
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -113,9 +113,23 @@ interface AmazonBedrockProviderSettings {
|
|
|
113
113
|
interface AmazonBedrockProvider extends ProviderV3 {
|
|
114
114
|
(modelId: BedrockChatModelId): LanguageModelV3;
|
|
115
115
|
languageModel(modelId: BedrockChatModelId): LanguageModelV3;
|
|
116
|
+
/**
|
|
117
|
+
* Creates a model for text embeddings.
|
|
118
|
+
*/
|
|
116
119
|
embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a model for text embeddings.
|
|
122
|
+
*/
|
|
117
123
|
embeddingModel(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
118
124
|
/**
|
|
125
|
+
* @deprecated Use `embedding` instead.
|
|
126
|
+
*/
|
|
127
|
+
textEmbedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated Use `embeddingModel` instead.
|
|
130
|
+
*/
|
|
131
|
+
textEmbeddingModel(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
132
|
+
/**
|
|
119
133
|
Creates a model for image generation.
|
|
120
134
|
*/
|
|
121
135
|
image(modelId: BedrockImageModelId): ImageModelV3;
|
package/dist/index.d.ts
CHANGED
|
@@ -113,9 +113,23 @@ interface AmazonBedrockProviderSettings {
|
|
|
113
113
|
interface AmazonBedrockProvider extends ProviderV3 {
|
|
114
114
|
(modelId: BedrockChatModelId): LanguageModelV3;
|
|
115
115
|
languageModel(modelId: BedrockChatModelId): LanguageModelV3;
|
|
116
|
+
/**
|
|
117
|
+
* Creates a model for text embeddings.
|
|
118
|
+
*/
|
|
116
119
|
embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a model for text embeddings.
|
|
122
|
+
*/
|
|
117
123
|
embeddingModel(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
118
124
|
/**
|
|
125
|
+
* @deprecated Use `embedding` instead.
|
|
126
|
+
*/
|
|
127
|
+
textEmbedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated Use `embeddingModel` instead.
|
|
130
|
+
*/
|
|
131
|
+
textEmbeddingModel(modelId: BedrockEmbeddingModelId): EmbeddingModelV3;
|
|
132
|
+
/**
|
|
119
133
|
Creates a model for image generation.
|
|
120
134
|
*/
|
|
121
135
|
image(modelId: BedrockImageModelId): ImageModelV3;
|