@ai-sdk/anthropic 2.0.88 → 2.0.89

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.
@@ -707,4 +707,13 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
707
707
  betas: Set<string>;
708
708
  }>;
709
709
 
710
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools };
710
+ /**
711
+ * Removes JSON Schema keywords that Anthropic rejects in
712
+ * `output_config.format.schema`.
713
+ *
714
+ * The full original schema is still used by AI SDK result validation. This
715
+ * only relaxes the schema sent to Anthropic's constrained decoder.
716
+ */
717
+ declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
718
+
719
+ export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools, sanitizeJsonSchema };
@@ -707,4 +707,13 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
707
707
  betas: Set<string>;
708
708
  }>;
709
709
 
710
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools };
710
+ /**
711
+ * Removes JSON Schema keywords that Anthropic rejects in
712
+ * `output_config.format.schema`.
713
+ *
714
+ * The full original schema is still used by AI SDK result validation. This
715
+ * only relaxes the schema sent to Anthropic's constrained decoder.
716
+ */
717
+ declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
718
+
719
+ export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools, sanitizeJsonSchema };
@@ -22,7 +22,8 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AnthropicMessagesLanguageModel: () => AnthropicMessagesLanguageModel,
24
24
  anthropicTools: () => anthropicTools,
25
- prepareTools: () => prepareTools
25
+ prepareTools: () => prepareTools,
26
+ sanitizeJsonSchema: () => sanitizeJsonSchema
26
27
  });
27
28
  module.exports = __toCommonJS(index_exports);
28
29
 
@@ -2262,6 +2263,12 @@ var AnthropicMessagesLanguageModel = class {
2262
2263
  rejectsSamplingParameters,
2263
2264
  isKnownModel
2264
2265
  } = getModelCapabilities(this.modelId);
2266
+ if (!isKnownModel && maxOutputTokens == null) {
2267
+ warnings.push({
2268
+ type: "other",
2269
+ message: `The model "${this.modelId}" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`
2270
+ });
2271
+ }
2265
2272
  if (rejectsSamplingParameters) {
2266
2273
  if (temperature != null) {
2267
2274
  warnings.push({
@@ -4129,6 +4136,7 @@ var anthropicTools = {
4129
4136
  0 && (module.exports = {
4130
4137
  AnthropicMessagesLanguageModel,
4131
4138
  anthropicTools,
4132
- prepareTools
4139
+ prepareTools,
4140
+ sanitizeJsonSchema
4133
4141
  });
4134
4142
  //# sourceMappingURL=index.js.map