@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/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.
|
|
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
|
-
*
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
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
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
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(
|