@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.
@@ -2279,6 +2279,12 @@ var AnthropicMessagesLanguageModel = class {
2279
2279
  rejectsSamplingParameters,
2280
2280
  isKnownModel
2281
2281
  } = getModelCapabilities(this.modelId);
2282
+ if (!isKnownModel && maxOutputTokens == null) {
2283
+ warnings.push({
2284
+ type: "other",
2285
+ message: `The model "${this.modelId}" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`
2286
+ });
2287
+ }
2282
2288
  if (rejectsSamplingParameters) {
2283
2289
  if (temperature != null) {
2284
2290
  warnings.push({
@@ -2305,7 +2311,7 @@ var AnthropicMessagesLanguageModel = class {
2305
2311
  topP = void 0;
2306
2312
  }
2307
2313
  }
2308
- const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
2314
+ const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
2309
2315
  const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : "jsonTool";
2310
2316
  const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
2311
2317
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
@@ -3638,6 +3644,20 @@ function getModelCapabilities(modelId) {
3638
3644
  rejectsSamplingParameters: false,
3639
3645
  isKnownModel: true
3640
3646
  };
3647
+ } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
3648
+ return {
3649
+ maxOutputTokens: 4096,
3650
+ supportsStructuredOutput: false,
3651
+ rejectsSamplingParameters: false,
3652
+ isKnownModel: false
3653
+ };
3654
+ } else if (modelId.includes("claude-")) {
3655
+ return {
3656
+ maxOutputTokens: 128e3,
3657
+ supportsStructuredOutput: true,
3658
+ rejectsSamplingParameters: true,
3659
+ isKnownModel: false
3660
+ };
3641
3661
  } else {
3642
3662
  return {
3643
3663
  maxOutputTokens: 4096,
@@ -4181,6 +4201,7 @@ var anthropicTools = {
4181
4201
  export {
4182
4202
  AnthropicMessagesLanguageModel,
4183
4203
  anthropicTools,
4184
- prepareTools
4204
+ prepareTools,
4205
+ sanitizeJsonSchema
4185
4206
  };
4186
4207
  //# sourceMappingURL=index.mjs.map