@ai-sdk/anthropic 3.0.122 → 3.0.124

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.
@@ -881,11 +881,10 @@ var anthropicSystemMessageProviderOptions = import_v43.z.object({
881
881
  */
882
882
  clearAt: import_v43.z.literal("next_user_message").optional(),
883
883
  /**
884
- * Overrides the effort level for the turn following this
885
- * mid-conversation system message.
886
- *
887
- * Requires the `mid-conversation-output-config-2026-07-01` beta,
888
- * which is added automatically.
884
+ * Sets the model effort from the next user turn until a later message
885
+ * changes it. An effort-only system message with empty content can appear
886
+ * first. The required `mid-conversation-output-config-2026-07-01` beta is
887
+ * added automatically.
889
888
  */
890
889
  effort: import_v43.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
891
890
  /**
@@ -2471,11 +2470,16 @@ async function convertToAnthropicMessagesPrompt({
2471
2470
  message: "tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored."
2472
2471
  });
2473
2472
  }
2474
- if (hasMidConversationOptions) {
2475
- warnings.push({
2476
- type: "other",
2477
- message: "clearAt and effort on the initial system message are not supported by Anthropic. Configure these options on a mid-conversation system message instead. The options have been ignored."
2478
- });
2473
+ for (const message of systemMessages) {
2474
+ if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {
2475
+ messages.push(message);
2476
+ betas.add("mid-conversation-output-config-2026-07-01");
2477
+ } else if (message.clear_at != null || message.output_config != null) {
2478
+ warnings.push({
2479
+ type: "other",
2480
+ message: "clearAt and effort on this initial system message are not supported by Anthropic. Use a separate effort-only system message with empty content to set effort. These options have been ignored."
2481
+ });
2482
+ }
2479
2483
  }
2480
2484
  system = systemMessages.flatMap(
2481
2485
  (message) => message.content.filter(