@ai-sdk/anthropic 3.0.80 → 3.0.81
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 +6 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -10
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -2
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +10 -9
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -9
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +5 -4
- package/package.json +1 -1
- package/src/anthropic-messages-api.ts +9 -1
- package/src/anthropic-messages-language-model.ts +4 -1
- package/src/anthropic-messages-options.ts +1 -0
- package/src/anthropic-tools.ts +1 -1
- package/src/convert-to-anthropic-messages-prompt.ts +9 -9
- package/src/tool/advisor_20260301.ts +1 -1
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.81" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -2259,19 +2259,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2259
2259
|
const type = block.type;
|
|
2260
2260
|
switch (type) {
|
|
2261
2261
|
case "system": {
|
|
2262
|
-
|
|
2263
|
-
throw new UnsupportedFunctionalityError2({
|
|
2264
|
-
functionality: "Multiple system messages that are separated by user/assistant messages"
|
|
2265
|
-
});
|
|
2266
|
-
}
|
|
2267
|
-
system = block.messages.map(({ content, providerOptions }) => ({
|
|
2262
|
+
const content = block.messages.map(({ content: content2, providerOptions }) => ({
|
|
2268
2263
|
type: "text",
|
|
2269
|
-
text:
|
|
2264
|
+
text: content2,
|
|
2270
2265
|
cache_control: validator.getCacheControl(providerOptions, {
|
|
2271
2266
|
type: "system message",
|
|
2272
2267
|
canCache: true
|
|
2273
2268
|
})
|
|
2274
2269
|
}));
|
|
2270
|
+
if (system == null) {
|
|
2271
|
+
system = content;
|
|
2272
|
+
} else {
|
|
2273
|
+
messages.push({ role: "system", content });
|
|
2274
|
+
betas.add("mid-conversation-system-2026-04-07");
|
|
2275
|
+
}
|
|
2275
2276
|
break;
|
|
2276
2277
|
}
|
|
2277
2278
|
case "user": {
|
|
@@ -5133,7 +5134,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5133
5134
|
}
|
|
5134
5135
|
};
|
|
5135
5136
|
function getModelCapabilities(modelId) {
|
|
5136
|
-
if (modelId.includes("claude-opus-4-7")) {
|
|
5137
|
+
if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7")) {
|
|
5137
5138
|
return {
|
|
5138
5139
|
maxOutputTokens: 128e3,
|
|
5139
5140
|
supportsStructuredOutput: true,
|
|
@@ -5591,7 +5592,7 @@ var anthropicTools = {
|
|
|
5591
5592
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
5592
5593
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
5593
5594
|
*
|
|
5594
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
5595
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
5595
5596
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
5596
5597
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
5597
5598
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|