@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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.123
4
+
5
+ ### Patch Changes
6
+
7
+ - f04da68: Preserve effort updates on empty system messages at the beginning of a conversation, including consecutive updates.
8
+ - Updated dependencies [3983fea]
9
+ - @ai-sdk/provider@3.0.18
10
+ - @ai-sdk/provider-utils@4.0.55
11
+
3
12
  ## 3.0.122
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils27 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.122" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.123" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -887,11 +887,10 @@ var anthropicSystemMessageProviderOptions = import_v43.z.object({
887
887
  */
888
888
  clearAt: import_v43.z.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: import_v43.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
897
896
  /**
@@ -2477,11 +2476,16 @@ async function convertToAnthropicMessagesPrompt({
2477
2476
  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."
2478
2477
  });
2479
2478
  }
2480
- if (hasMidConversationOptions) {
2481
- warnings.push({
2482
- type: "other",
2483
- 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."
2484
- });
2479
+ for (const message of systemMessages) {
2480
+ if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {
2481
+ messages.push(message);
2482
+ betas.add("mid-conversation-output-config-2026-07-01");
2483
+ } else if (message.clear_at != null || message.output_config != null) {
2484
+ warnings.push({
2485
+ type: "other",
2486
+ 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."
2487
+ });
2488
+ }
2485
2489
  }
2486
2490
  system = systemMessages.flatMap(
2487
2491
  (message) => message.content.filter(