@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.
- package/CHANGELOG.md +16 -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.mjs
CHANGED
|
@@ -871,11 +871,10 @@ var anthropicSystemMessageProviderOptions = z3.object({
|
|
|
871
871
|
*/
|
|
872
872
|
clearAt: z3.literal("next_user_message").optional(),
|
|
873
873
|
/**
|
|
874
|
-
*
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
*
|
|
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
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
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(
|