@ai-sdk/anthropic 3.0.129 → 3.0.131

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.
@@ -1982,7 +1982,7 @@ async function prepareTools({
1982
1982
  toolWarnings.push({
1983
1983
  type: "unsupported",
1984
1984
  feature: "toolChoice",
1985
- details: `toolChoice 'required' is not supported by this model because it rejects forced tool use. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
1985
+ details: `toolChoice 'required' is not supported with this model or thinking configuration. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
1986
1986
  });
1987
1987
  return {
1988
1988
  tools: anthropicTools2,
@@ -2015,7 +2015,7 @@ async function prepareTools({
2015
2015
  toolWarnings.push({
2016
2016
  type: "unsupported",
2017
2017
  feature: "toolChoice",
2018
- details: `toolChoice 'tool' is not supported by this model because it rejects forced tool use. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
2018
+ details: `toolChoice 'tool' is not supported with this model or thinking configuration. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
2019
2019
  });
2020
2020
  return {
2021
2021
  tools: anthropicTools2.filter(
@@ -4298,7 +4298,7 @@ var AnthropicMessagesLanguageModel = class {
4298
4298
  supportsStructuredOutput: false,
4299
4299
  supportsStrictTools,
4300
4300
  defaultEagerInputStreaming,
4301
- rejectsForcedToolUse
4301
+ rejectsForcedToolUse: rejectsForcedToolUse || thinkingType === "enabled"
4302
4302
  } : {
4303
4303
  tools: tools != null ? tools : [],
4304
4304
  toolChoice,
@@ -4307,7 +4307,7 @@ var AnthropicMessagesLanguageModel = class {
4307
4307
  supportsStructuredOutput,
4308
4308
  supportsStrictTools,
4309
4309
  defaultEagerInputStreaming,
4310
- rejectsForcedToolUse
4310
+ rejectsForcedToolUse: rejectsForcedToolUse || thinkingType === "enabled"
4311
4311
  }
4312
4312
  );
4313
4313
  const cacheWarnings = cacheControlValidator.getWarnings();