@ai-sdk/anthropic 4.0.18 → 4.0.19

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,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 01a596a: fix (provider/anthropic): use current-generation capability defaults for unrecognized Claude model IDs while retaining conservative defaults for legacy Claude and non-Claude models.
8
+
3
9
  ## 4.0.18
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3661,7 +3661,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
3661
3661
  topP = void 0;
3662
3662
  }
3663
3663
  }
3664
- const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
3664
+ const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
3665
3665
  const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
3666
3666
  const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
3667
3667
  const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
@@ -5507,6 +5507,24 @@ function getModelCapabilities(modelId) {
5507
5507
  supportsXhighEffort: false,
5508
5508
  isKnownModel: true
5509
5509
  };
5510
+ } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
5511
+ return {
5512
+ maxOutputTokens: 4096,
5513
+ supportsStructuredOutput: false,
5514
+ supportsAdaptiveThinking: false,
5515
+ rejectsSamplingParameters: false,
5516
+ supportsXhighEffort: false,
5517
+ isKnownModel: false
5518
+ };
5519
+ } else if (modelId.includes("claude-")) {
5520
+ return {
5521
+ maxOutputTokens: 128e3,
5522
+ supportsStructuredOutput: true,
5523
+ supportsAdaptiveThinking: true,
5524
+ rejectsSamplingParameters: true,
5525
+ supportsXhighEffort: true,
5526
+ isKnownModel: false
5527
+ };
5510
5528
  } else {
5511
5529
  return {
5512
5530
  maxOutputTokens: 4096,
@@ -6347,7 +6365,7 @@ var AnthropicSkills = class {
6347
6365
  };
6348
6366
 
6349
6367
  // src/version.ts
6350
- var VERSION = true ? "4.0.18" : "0.0.0-test";
6368
+ var VERSION = true ? "4.0.19" : "0.0.0-test";
6351
6369
 
6352
6370
  // src/anthropic-provider.ts
6353
6371
  var ANTHROPIC_API_URL = "https://api.anthropic.com";