@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 +9 -0
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +14 -10
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -10
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +33 -11
- package/package.json +3 -3
- package/src/anthropic-messages-options.ts +4 -5
- package/src/convert-to-anthropic-messages-prompt.ts +22 -8
package/dist/internal/index.js
CHANGED
|
@@ -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
|
-
*
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
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
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
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(
|