@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "4.0.18",
3
+ "version": "4.0.19",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -339,7 +339,7 @@ export class AnthropicLanguageModel implements LanguageModelV4 {
339
339
  }
340
340
  }
341
341
 
342
- const isAnthropicModel = isKnownModel || this.modelId.startsWith('claude-');
342
+ const isAnthropicModel = isKnownModel || this.modelId.includes('claude-');
343
343
 
344
344
  const supportsStructuredOutput =
345
345
  (this.config.supportsNativeStructuredOutput ?? true) &&
@@ -2727,6 +2727,29 @@ export function getModelCapabilities(modelId: string): {
2727
2727
  supportsXhighEffort: false,
2728
2728
  isKnownModel: true,
2729
2729
  };
2730
+ } else if (
2731
+ /claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)
2732
+ ) {
2733
+ return {
2734
+ maxOutputTokens: 4096,
2735
+ supportsStructuredOutput: false,
2736
+ supportsAdaptiveThinking: false,
2737
+ rejectsSamplingParameters: false,
2738
+ supportsXhighEffort: false,
2739
+ isKnownModel: false,
2740
+ };
2741
+ } else if (modelId.includes('claude-')) {
2742
+ // Known and legacy Claude families are handled above, so any remaining
2743
+ // Claude ID is assumed to be newer than the known list. Keep it unknown so
2744
+ // callers still receive the maxOutputTokens compatibility warning.
2745
+ return {
2746
+ maxOutputTokens: 128000,
2747
+ supportsStructuredOutput: true,
2748
+ supportsAdaptiveThinking: true,
2749
+ rejectsSamplingParameters: true,
2750
+ supportsXhighEffort: true,
2751
+ isKnownModel: false,
2752
+ };
2730
2753
  } else {
2731
2754
  return {
2732
2755
  maxOutputTokens: 4096,