@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/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -169,7 +169,7 @@ interface AnthropicMessageMetadata {
|
|
|
169
169
|
} | null;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
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 & {});
|
|
172
|
+
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 & {});
|
|
173
173
|
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
174
174
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
175
175
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -305,7 +305,7 @@ declare const anthropicTools: {
|
|
|
305
305
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
306
306
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
307
307
|
*
|
|
308
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
308
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
309
309
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
310
310
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
311
311
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
package/dist/index.d.ts
CHANGED
|
@@ -169,7 +169,7 @@ interface AnthropicMessageMetadata {
|
|
|
169
169
|
} | null;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
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 & {});
|
|
172
|
+
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 & {});
|
|
173
173
|
declare const anthropicLanguageModelOptions: z.ZodObject<{
|
|
174
174
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
175
175
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -305,7 +305,7 @@ declare const anthropicTools: {
|
|
|
305
305
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
306
306
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
307
307
|
*
|
|
308
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
308
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
309
309
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
310
310
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
311
311
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
32
32
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
33
33
|
|
|
34
34
|
// src/version.ts
|
|
35
|
-
var VERSION = true ? "3.0.
|
|
35
|
+
var VERSION = true ? "3.0.81" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/anthropic-messages-language-model.ts
|
|
38
38
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -2210,19 +2210,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2210
2210
|
const type = block.type;
|
|
2211
2211
|
switch (type) {
|
|
2212
2212
|
case "system": {
|
|
2213
|
-
|
|
2214
|
-
throw new import_provider2.UnsupportedFunctionalityError({
|
|
2215
|
-
functionality: "Multiple system messages that are separated by user/assistant messages"
|
|
2216
|
-
});
|
|
2217
|
-
}
|
|
2218
|
-
system = block.messages.map(({ content, providerOptions }) => ({
|
|
2213
|
+
const content = block.messages.map(({ content: content2, providerOptions }) => ({
|
|
2219
2214
|
type: "text",
|
|
2220
|
-
text:
|
|
2215
|
+
text: content2,
|
|
2221
2216
|
cache_control: validator.getCacheControl(providerOptions, {
|
|
2222
2217
|
type: "system message",
|
|
2223
2218
|
canCache: true
|
|
2224
2219
|
})
|
|
2225
2220
|
}));
|
|
2221
|
+
if (system == null) {
|
|
2222
|
+
system = content;
|
|
2223
|
+
} else {
|
|
2224
|
+
messages.push({ role: "system", content });
|
|
2225
|
+
betas.add("mid-conversation-system-2026-04-07");
|
|
2226
|
+
}
|
|
2226
2227
|
break;
|
|
2227
2228
|
}
|
|
2228
2229
|
case "user": {
|
|
@@ -5084,7 +5085,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5084
5085
|
}
|
|
5085
5086
|
};
|
|
5086
5087
|
function getModelCapabilities(modelId) {
|
|
5087
|
-
if (modelId.includes("claude-opus-4-7")) {
|
|
5088
|
+
if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7")) {
|
|
5088
5089
|
return {
|
|
5089
5090
|
maxOutputTokens: 128e3,
|
|
5090
5091
|
supportsStructuredOutput: true,
|
|
@@ -5502,7 +5503,7 @@ var anthropicTools = {
|
|
|
5502
5503
|
* Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
|
|
5503
5504
|
* Opus 4.7. The advisor must be at least as capable as the executor.
|
|
5504
5505
|
*
|
|
5505
|
-
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-
|
|
5506
|
+
* @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
|
|
5506
5507
|
* @param maxUses - Maximum advisor calls per request (per-request cap).
|
|
5507
5508
|
* @param caching - Enables prompt caching for the advisor's transcript
|
|
5508
5509
|
* across calls within a conversation. Worthwhile from ~3 advisor calls
|