@ai-sdk/anthropic 2.0.63 → 2.0.65
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 +12 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +5 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +5 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 2.0.65
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fe42fd3: feat(provider/anthropic): add support for new Claude Sonnet 4.6 model
|
|
8
|
+
|
|
9
|
+
## 2.0.64
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9d5c1b1: fix(provider/anthropic): minor follow up to support no-op speed standard
|
|
14
|
+
|
|
3
15
|
## 2.0.63
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -126,7 +126,7 @@ interface AnthropicMessageMetadata {
|
|
|
126
126
|
} | null;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | '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-opus-4-6' | (string & {});
|
|
129
|
+
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | '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' | (string & {});
|
|
130
130
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
131
131
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
132
132
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -161,7 +161,10 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
161
161
|
high: "high";
|
|
162
162
|
max: "max";
|
|
163
163
|
}>>;
|
|
164
|
-
speed: z.ZodOptional<z.
|
|
164
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
165
|
+
fast: "fast";
|
|
166
|
+
standard: "standard";
|
|
167
|
+
}>>;
|
|
165
168
|
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
166
169
|
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
167
170
|
type: z.ZodLiteral<"clear_tool_uses_20250919">;
|
package/dist/index.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ interface AnthropicMessageMetadata {
|
|
|
126
126
|
} | null;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | '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-opus-4-6' | (string & {});
|
|
129
|
+
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | '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' | (string & {});
|
|
130
130
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
131
131
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
132
132
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -161,7 +161,10 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
161
161
|
high: "high";
|
|
162
162
|
max: "max";
|
|
163
163
|
}>>;
|
|
164
|
-
speed: z.ZodOptional<z.
|
|
164
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
165
|
+
fast: "fast";
|
|
166
|
+
standard: "standard";
|
|
167
|
+
}>>;
|
|
165
168
|
contextManagement: z.ZodOptional<z.ZodObject<{
|
|
166
169
|
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
167
170
|
type: z.ZodLiteral<"clear_tool_uses_20250919">;
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
31
31
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
32
32
|
|
|
33
33
|
// src/version.ts
|
|
34
|
-
var VERSION = true ? "2.0.
|
|
34
|
+
var VERSION = true ? "2.0.65" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -648,11 +648,11 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
648
648
|
*/
|
|
649
649
|
thinking: import_v43.z.discriminatedUnion("type", [
|
|
650
650
|
import_v43.z.object({
|
|
651
|
-
/** for Opus 4.6 and newer models */
|
|
651
|
+
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
652
652
|
type: import_v43.z.literal("adaptive")
|
|
653
653
|
}),
|
|
654
654
|
import_v43.z.object({
|
|
655
|
-
/** for models before Opus 4.6 */
|
|
655
|
+
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
656
656
|
type: import_v43.z.literal("enabled"),
|
|
657
657
|
budgetTokens: import_v43.z.number().optional()
|
|
658
658
|
}),
|
|
@@ -696,7 +696,7 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
696
696
|
* Enable fast mode for faster inference (2.5x faster output token speeds).
|
|
697
697
|
* Only supported with claude-opus-4-6.
|
|
698
698
|
*/
|
|
699
|
-
speed: import_v43.z.
|
|
699
|
+
speed: import_v43.z.enum(["fast", "standard"]).optional(),
|
|
700
700
|
/**
|
|
701
701
|
* Context management configuration for automatic context window management.
|
|
702
702
|
* Enables features like automatic compaction and clearing of tool uses/thinking blocks.
|
|
@@ -2174,7 +2174,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2174
2174
|
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
2175
2175
|
betas.add("effort-2025-11-24");
|
|
2176
2176
|
}
|
|
2177
|
-
if (anthropicOptions == null ? void 0 : anthropicOptions.speed) {
|
|
2177
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
|
|
2178
2178
|
betas.add("fast-mode-2026-02-01");
|
|
2179
2179
|
}
|
|
2180
2180
|
if (useStructuredOutput) {
|
|
@@ -3174,7 +3174,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3174
3174
|
}
|
|
3175
3175
|
};
|
|
3176
3176
|
function getModelCapabilities(modelId) {
|
|
3177
|
-
if (modelId.includes("claude-opus-4-6")) {
|
|
3177
|
+
if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
3178
3178
|
return {
|
|
3179
3179
|
maxOutputTokens: 128e3,
|
|
3180
3180
|
supportsStructuredOutput: true,
|