@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.
@@ -871,11 +871,10 @@ var anthropicSystemMessageProviderOptions = z3.object({
871
871
  */
872
872
  clearAt: z3.literal("next_user_message").optional(),
873
873
  /**
874
- * Overrides the effort level for the turn following this
875
- * mid-conversation system message.
876
- *
877
- * Requires the `mid-conversation-output-config-2026-07-01` beta,
878
- * which is added automatically.
874
+ * Sets the model effort from the next user turn until a later message
875
+ * changes it. An effort-only system message with empty content can appear
876
+ * first. The required `mid-conversation-output-config-2026-07-01` beta is
877
+ * added automatically.
879
878
  */
880
879
  effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
881
880
  /**
@@ -2517,11 +2516,16 @@ async function convertToAnthropicMessagesPrompt({
2517
2516
  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."
2518
2517
  });
2519
2518
  }
2520
- if (hasMidConversationOptions) {
2521
- warnings.push({
2522
- type: "other",
2523
- 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."
2524
- });
2519
+ for (const message of systemMessages) {
2520
+ if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {
2521
+ messages.push(message);
2522
+ betas.add("mid-conversation-output-config-2026-07-01");
2523
+ } else if (message.clear_at != null || message.output_config != null) {
2524
+ warnings.push({
2525
+ type: "other",
2526
+ 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."
2527
+ });
2528
+ }
2525
2529
  }
2526
2530
  system = systemMessages.flatMap(
2527
2531
  (message) => message.content.filter(