@ai-sdk/anthropic 2.0.45 → 2.0.47
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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -3
- 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 +22 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +22 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 2.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3a7a427: 'fix(anthropic): Opus 4.5 `maxOutputTokens` bump `32000` -> `64000`'
|
|
8
|
+
|
|
9
|
+
## 2.0.46
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 54a0480: Opus 4.5 and `effort` provider option
|
|
14
|
+
|
|
3
15
|
## 2.0.45
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -42,7 +42,7 @@ interface AnthropicMessageMetadata {
|
|
|
42
42
|
} | null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type AnthropicMessagesModelId = 'claude-haiku-
|
|
45
|
+
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' | (string & {});
|
|
46
46
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
47
47
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
thinking: z.ZodOptional<z.ZodObject<{
|
|
@@ -62,6 +62,11 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
62
62
|
version: z.ZodOptional<z.ZodString>;
|
|
63
63
|
}, z.core.$strip>>>;
|
|
64
64
|
}, z.core.$strip>>;
|
|
65
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
low: "low";
|
|
67
|
+
medium: "medium";
|
|
68
|
+
high: "high";
|
|
69
|
+
}>>;
|
|
65
70
|
}, z.core.$strip>;
|
|
66
71
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
67
72
|
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface AnthropicMessageMetadata {
|
|
|
42
42
|
} | null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type AnthropicMessagesModelId = 'claude-haiku-
|
|
45
|
+
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' | (string & {});
|
|
46
46
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
47
47
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
thinking: z.ZodOptional<z.ZodObject<{
|
|
@@ -62,6 +62,11 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
62
62
|
version: z.ZodOptional<z.ZodString>;
|
|
63
63
|
}, z.core.$strip>>>;
|
|
64
64
|
}, z.core.$strip>>;
|
|
65
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
low: "low";
|
|
67
|
+
medium: "medium";
|
|
68
|
+
high: "high";
|
|
69
|
+
}>>;
|
|
65
70
|
}, z.core.$strip>;
|
|
66
71
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
67
72
|
|
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.47" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -583,7 +583,11 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
583
583
|
version: import_v43.z.string().optional()
|
|
584
584
|
})
|
|
585
585
|
).optional()
|
|
586
|
-
}).optional()
|
|
586
|
+
}).optional(),
|
|
587
|
+
/**
|
|
588
|
+
* @default 'high'
|
|
589
|
+
*/
|
|
590
|
+
effort: import_v43.z.enum(["low", "medium", "high"]).optional()
|
|
587
591
|
});
|
|
588
592
|
|
|
589
593
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1850,6 +1854,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1850
1854
|
...isThinking && {
|
|
1851
1855
|
thinking: { type: "enabled", budget_tokens: thinkingBudget }
|
|
1852
1856
|
},
|
|
1857
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
1858
|
+
output_config: { effort: anthropicOptions.effort }
|
|
1859
|
+
},
|
|
1853
1860
|
// container with agent skills:
|
|
1854
1861
|
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
|
|
1855
1862
|
container: {
|
|
@@ -1920,6 +1927,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1920
1927
|
});
|
|
1921
1928
|
}
|
|
1922
1929
|
}
|
|
1930
|
+
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
1931
|
+
betas.add("effort-2025-11-24");
|
|
1932
|
+
}
|
|
1923
1933
|
const {
|
|
1924
1934
|
tools: anthropicTools2,
|
|
1925
1935
|
toolChoice: anthropicToolChoice,
|
|
@@ -2723,7 +2733,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2723
2733
|
}
|
|
2724
2734
|
};
|
|
2725
2735
|
function getMaxOutputTokensForModel(modelId) {
|
|
2726
|
-
if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-
|
|
2736
|
+
if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5")) {
|
|
2737
|
+
return {
|
|
2738
|
+
maxOutputTokens: 64e3,
|
|
2739
|
+
knownModel: true
|
|
2740
|
+
};
|
|
2741
|
+
} else if (modelId.includes("claude-opus-4-1")) {
|
|
2742
|
+
return {
|
|
2743
|
+
maxOutputTokens: 32e3,
|
|
2744
|
+
knownModel: true
|
|
2745
|
+
};
|
|
2746
|
+
} else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet") || modelId.includes("claude-haiku-4-5")) {
|
|
2727
2747
|
return { maxOutputTokens: 64e3, knownModel: true };
|
|
2728
2748
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
2729
2749
|
return { maxOutputTokens: 32e3, knownModel: true };
|