@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
|
@@ -2,7 +2,7 @@ import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateRes
|
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
|
-
type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | (string & {});
|
|
5
|
+
type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | (string & {});
|
|
6
6
|
|
|
7
7
|
type AnthropicMessagesConfig = {
|
|
8
8
|
provider: string;
|
|
@@ -70,7 +70,7 @@ declare const anthropicTools: {
|
|
|
70
70
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
71
71
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
72
72
|
*
|
|
73
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
73
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
74
74
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
75
75
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
76
76
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateRes
|
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
|
-
type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | (string & {});
|
|
5
|
+
type AnthropicMessagesModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | (string & {});
|
|
6
6
|
|
|
7
7
|
type AnthropicMessagesConfig = {
|
|
8
8
|
provider: string;
|
|
@@ -70,7 +70,7 @@ declare const anthropicTools: {
|
|
|
70
70
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
71
71
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
72
72
|
*
|
|
73
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
73
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
74
74
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
75
75
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
76
76
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
package/dist/internal/index.js
CHANGED
|
@@ -2202,19 +2202,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2202
2202
|
const type = block.type;
|
|
2203
2203
|
switch (type) {
|
|
2204
2204
|
case "system": {
|
|
2205
|
-
|
|
2206
|
-
throw new import_provider2.UnsupportedFunctionalityError({
|
|
2207
|
-
functionality: "Multiple system messages that are separated by user/assistant messages"
|
|
2208
|
-
});
|
|
2209
|
-
}
|
|
2210
|
-
system = block.messages.map(({ content, providerOptions }) => ({
|
|
2205
|
+
const content = block.messages.map(({ content: content2, providerOptions }) => ({
|
|
2211
2206
|
type: "text",
|
|
2212
|
-
text:
|
|
2207
|
+
text: content2,
|
|
2213
2208
|
cache_control: validator.getCacheControl(providerOptions, {
|
|
2214
2209
|
type: "system message",
|
|
2215
2210
|
canCache: true
|
|
2216
2211
|
})
|
|
2217
2212
|
}));
|
|
2213
|
+
if (system == null) {
|
|
2214
|
+
system = content;
|
|
2215
|
+
} else {
|
|
2216
|
+
messages.push({ role: "system", content });
|
|
2217
|
+
betas.add("mid-conversation-system-2026-04-07");
|
|
2218
|
+
}
|
|
2218
2219
|
break;
|
|
2219
2220
|
}
|
|
2220
2221
|
case "user": {
|
|
@@ -5076,7 +5077,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5076
5077
|
}
|
|
5077
5078
|
};
|
|
5078
5079
|
function getModelCapabilities(modelId) {
|
|
5079
|
-
if (modelId.includes("claude-opus-4-7")) {
|
|
5080
|
+
if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7")) {
|
|
5080
5081
|
return {
|
|
5081
5082
|
maxOutputTokens: 128e3,
|
|
5082
5083
|
supportsStructuredOutput: true,
|
|
@@ -5494,7 +5495,7 @@ var anthropicTools = {
|
|
|
5494
5495
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
5495
5496
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
5496
5497
|
*
|
|
5497
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
5498
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
5498
5499
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
5499
5500
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
5500
5501
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|