@ai-sdk/amazon-bedrock 5.0.0-beta.41 → 5.0.0-beta.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/amazon-bedrock",
3
- "version": "5.0.0-beta.41",
3
+ "version": "5.0.0-beta.43",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -38,16 +38,16 @@
38
38
  "@smithy/eventstream-codec": "^4.0.1",
39
39
  "@smithy/util-utf8": "^4.0.0",
40
40
  "aws4fetch": "^1.0.20",
41
- "@ai-sdk/anthropic": "4.0.0-beta.37",
42
- "@ai-sdk/provider": "4.0.0-beta.12",
43
- "@ai-sdk/provider-utils": "5.0.0-beta.26"
41
+ "@ai-sdk/anthropic": "4.0.0-beta.39",
42
+ "@ai-sdk/provider": "4.0.0-beta.13",
43
+ "@ai-sdk/provider-utils": "5.0.0-beta.28"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "20.17.24",
47
47
  "tsup": "^8.3.0",
48
48
  "typescript": "5.8.3",
49
49
  "zod": "3.25.76",
50
- "@ai-sdk/test-server": "2.0.0-beta.1",
50
+ "@ai-sdk/test-server": "2.0.0-beta.2",
51
51
  "@vercel/ai-tsconfig": "0.0.0"
52
52
  },
53
53
  "peerDependencies": {
@@ -57,12 +57,14 @@
57
57
  "node": ">=18"
58
58
  },
59
59
  "publishConfig": {
60
- "access": "public"
60
+ "access": "public",
61
+ "provenance": true
61
62
  },
62
63
  "homepage": "https://ai-sdk.dev/docs",
63
64
  "repository": {
64
65
  "type": "git",
65
- "url": "git+https://github.com/vercel/ai.git"
66
+ "url": "https://github.com/vercel/ai",
67
+ "directory": "packages/amazon-bedrock"
66
68
  },
67
69
  "bugs": {
68
70
  "url": "https://github.com/vercel/ai/issues"
@@ -14,7 +14,7 @@ import {
14
14
  } from '@ai-sdk/provider-utils';
15
15
  import {
16
16
  anthropicTools,
17
- AnthropicMessagesLanguageModel,
17
+ AnthropicLanguageModel,
18
18
  } from '@ai-sdk/anthropic/internal';
19
19
  import {
20
20
  BedrockCredentials,
@@ -249,7 +249,7 @@ export function createBedrockAnthropic(
249
249
  };
250
250
 
251
251
  const createChatModel = (modelId: BedrockAnthropicModelId) =>
252
- new AnthropicMessagesLanguageModel(modelId, {
252
+ new AnthropicLanguageModel(modelId, {
253
253
  provider: 'bedrock.anthropic.messages',
254
254
  baseURL: getBaseURL(),
255
255
  headers: getHeaders,
@@ -1209,7 +1209,7 @@ function resolveBedrockReasoningConfig({
1209
1209
  isAnthropicModel: boolean;
1210
1210
  modelId: string;
1211
1211
  }): AmazonBedrockLanguageModelOptions {
1212
- if (!isCustomReasoning(reasoning) || bedrockOptions.reasoningConfig != null) {
1212
+ if (!isCustomReasoning(reasoning)) {
1213
1213
  return bedrockOptions;
1214
1214
  }
1215
1215
 
@@ -1229,6 +1229,7 @@ function resolveBedrockReasoningConfig({
1229
1229
  result.reasoningConfig = {
1230
1230
  type: 'adaptive',
1231
1231
  maxReasoningEffort: effort,
1232
+ ...bedrockOptions.reasoningConfig,
1232
1233
  };
1233
1234
  } else {
1234
1235
  const budgetTokens = mapReasoningToProviderBudget({
@@ -1241,6 +1242,7 @@ function resolveBedrockReasoningConfig({
1241
1242
  result.reasoningConfig = {
1242
1243
  type: 'enabled',
1243
1244
  budgetTokens,
1245
+ ...bedrockOptions.reasoningConfig,
1244
1246
  };
1245
1247
  }
1246
1248
  }
@@ -1250,7 +1252,21 @@ function resolveBedrockReasoningConfig({
1250
1252
  effortMap: bedrockReasoningEffortMap,
1251
1253
  warnings,
1252
1254
  });
1253
- result.reasoningConfig = { maxReasoningEffort: effort };
1255
+ result.reasoningConfig = {
1256
+ maxReasoningEffort: effort,
1257
+ ...bedrockOptions.reasoningConfig,
1258
+ };
1259
+ }
1260
+
1261
+ /*
1262
+ * Mirror anthropic-messages-language-model.ts: when the merged type ends up
1263
+ * 'disabled' (user override combined with a non-none reasoning), strip
1264
+ * derived effort/budget so downstream does not emit output_config.effort
1265
+ * alongside disabled thinking.
1266
+ */
1267
+ if (result.reasoningConfig?.type === 'disabled') {
1268
+ delete result.reasoningConfig.maxReasoningEffort;
1269
+ delete result.reasoningConfig.budgetTokens;
1254
1270
  }
1255
1271
 
1256
1272
  return result;
@@ -213,7 +213,7 @@ export async function convertToBedrockChatMessages(
213
213
  break;
214
214
  case 'execution-denied':
215
215
  toolResultContent = [
216
- { text: output.reason ?? 'Tool execution denied.' },
216
+ { text: output.reason ?? 'Tool call execution denied.' },
217
217
  ];
218
218
  break;
219
219
  case 'json':