@ai-sdk/anthropic 3.0.122 → 3.0.123

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.
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from "@ai-sdk/provider-utils";
13
13
 
14
14
  // src/version.ts
15
- var VERSION = true ? "3.0.122" : "0.0.0-test";
15
+ var VERSION = true ? "3.0.123" : "0.0.0-test";
16
16
 
17
17
  // src/anthropic-messages-language-model.ts
18
18
  import {
@@ -887,11 +887,10 @@ var anthropicSystemMessageProviderOptions = z3.object({
887
887
  */
888
888
  clearAt: z3.literal("next_user_message").optional(),
889
889
  /**
890
- * Overrides the effort level for the turn following this
891
- * mid-conversation system message.
892
- *
893
- * Requires the `mid-conversation-output-config-2026-07-01` beta,
894
- * which is added automatically.
890
+ * Sets the model effort from the next user turn until a later message
891
+ * changes it. An effort-only system message with empty content can appear
892
+ * first. The required `mid-conversation-output-config-2026-07-01` beta is
893
+ * added automatically.
895
894
  */
896
895
  effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
897
896
  /**
@@ -2533,11 +2532,16 @@ async function convertToAnthropicMessagesPrompt({
2533
2532
  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."
2534
2533
  });
2535
2534
  }
2536
- if (hasMidConversationOptions) {
2537
- warnings.push({
2538
- type: "other",
2539
- 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."
2540
- });
2535
+ for (const message of systemMessages) {
2536
+ if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {
2537
+ messages.push(message);
2538
+ betas.add("mid-conversation-output-config-2026-07-01");
2539
+ } else if (message.clear_at != null || message.output_config != null) {
2540
+ warnings.push({
2541
+ type: "other",
2542
+ 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."
2543
+ });
2544
+ }
2541
2545
  }
2542
2546
  system = systemMessages.flatMap(
2543
2547
  (message) => message.content.filter(