@ai-sdk/anthropic 3.0.98 → 3.0.99

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.
@@ -1034,4 +1034,13 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
1034
1034
  betas: Set<string>;
1035
1035
  }>;
1036
1036
 
1037
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools };
1037
+ /**
1038
+ * Removes JSON Schema keywords that Anthropic rejects in
1039
+ * `output_config.format.schema`.
1040
+ *
1041
+ * The full original schema is still used by AI SDK result validation. This
1042
+ * only relaxes the schema sent to Anthropic's constrained decoder.
1043
+ */
1044
+ declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
1045
+
1046
+ export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools, sanitizeJsonSchema };
@@ -1034,4 +1034,13 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
1034
1034
  betas: Set<string>;
1035
1035
  }>;
1036
1036
 
1037
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools };
1037
+ /**
1038
+ * Removes JSON Schema keywords that Anthropic rejects in
1039
+ * `output_config.format.schema`.
1040
+ *
1041
+ * The full original schema is still used by AI SDK result validation. This
1042
+ * only relaxes the schema sent to Anthropic's constrained decoder.
1043
+ */
1044
+ declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
1045
+
1046
+ 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
 
@@ -3425,6 +3426,13 @@ var AnthropicMessagesLanguageModel = class {
3425
3426
  description: "Respond with a JSON object.",
3426
3427
  inputSchema: responseFormat.schema
3427
3428
  } : void 0;
3429
+ if (jsonResponseTool != null && (anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse) === false) {
3430
+ warnings.push({
3431
+ type: "unsupported",
3432
+ feature: "providerOptions.anthropic.disableParallelToolUse",
3433
+ details: "`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call."
3434
+ });
3435
+ }
3428
3436
  const contextManagement = anthropicOptions == null ? void 0 : anthropicOptions.contextManagement;
3429
3437
  const cacheControlValidator = new CacheControlValidator();
3430
3438
  const toolNameMapping = (0, import_provider_utils15.createToolNameMapping)({
@@ -5815,6 +5823,7 @@ var anthropicTools = {
5815
5823
  0 && (module.exports = {
5816
5824
  AnthropicMessagesLanguageModel,
5817
5825
  anthropicTools,
5818
- prepareTools
5826
+ prepareTools,
5827
+ sanitizeJsonSchema
5819
5828
  });
5820
5829
  //# sourceMappingURL=index.js.map