@ai-sdk/anthropic 2.0.89 → 2.0.90

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
+ ## 2.0.90
4
+
5
+ ### Patch Changes
6
+
7
+ - db28434: 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
  ## 2.0.89
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "2.0.89" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.90" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -2301,7 +2301,7 @@ var AnthropicMessagesLanguageModel = class {
2301
2301
  topP = void 0;
2302
2302
  }
2303
2303
  }
2304
- const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
2304
+ const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
2305
2305
  const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : "jsonTool";
2306
2306
  const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
2307
2307
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
@@ -3634,6 +3634,20 @@ function getModelCapabilities(modelId) {
3634
3634
  rejectsSamplingParameters: false,
3635
3635
  isKnownModel: true
3636
3636
  };
3637
+ } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
3638
+ return {
3639
+ maxOutputTokens: 4096,
3640
+ supportsStructuredOutput: false,
3641
+ rejectsSamplingParameters: false,
3642
+ isKnownModel: false
3643
+ };
3644
+ } else if (modelId.includes("claude-")) {
3645
+ return {
3646
+ maxOutputTokens: 128e3,
3647
+ supportsStructuredOutput: true,
3648
+ rejectsSamplingParameters: true,
3649
+ isKnownModel: false
3650
+ };
3637
3651
  } else {
3638
3652
  return {
3639
3653
  maxOutputTokens: 4096,