@ai-sdk/anthropic 2.0.88 → 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/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "@ai-sdk/provider-utils";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "2.0.88" : "0.0.0-test";
14
+ var VERSION = true ? "2.0.90" : "0.0.0-test";
15
15
 
16
16
  // src/anthropic-messages-language-model.ts
17
17
  import {
@@ -2294,6 +2294,12 @@ var AnthropicMessagesLanguageModel = class {
2294
2294
  rejectsSamplingParameters,
2295
2295
  isKnownModel
2296
2296
  } = getModelCapabilities(this.modelId);
2297
+ if (!isKnownModel && maxOutputTokens == null) {
2298
+ warnings.push({
2299
+ type: "other",
2300
+ message: `The model "${this.modelId}" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`
2301
+ });
2302
+ }
2297
2303
  if (rejectsSamplingParameters) {
2298
2304
  if (temperature != null) {
2299
2305
  warnings.push({
@@ -2320,7 +2326,7 @@ var AnthropicMessagesLanguageModel = class {
2320
2326
  topP = void 0;
2321
2327
  }
2322
2328
  }
2323
- const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
2329
+ const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
2324
2330
  const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : "jsonTool";
2325
2331
  const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
2326
2332
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
@@ -3653,6 +3659,20 @@ function getModelCapabilities(modelId) {
3653
3659
  rejectsSamplingParameters: false,
3654
3660
  isKnownModel: true
3655
3661
  };
3662
+ } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
3663
+ return {
3664
+ maxOutputTokens: 4096,
3665
+ supportsStructuredOutput: false,
3666
+ rejectsSamplingParameters: false,
3667
+ isKnownModel: false
3668
+ };
3669
+ } else if (modelId.includes("claude-")) {
3670
+ return {
3671
+ maxOutputTokens: 128e3,
3672
+ supportsStructuredOutput: true,
3673
+ rejectsSamplingParameters: true,
3674
+ isKnownModel: false
3675
+ };
3656
3676
  } else {
3657
3677
  return {
3658
3678
  maxOutputTokens: 4096,