@ai-sdk/anthropic 2.0.105 → 2.0.107
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 +20 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +105 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -38
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +6 -1
- package/dist/internal/index.d.ts +6 -1
- package/dist/internal/index.js +104 -37
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +104 -37
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { LanguageModelV2, JSONSchema7, SharedV2ProviderMetadata, LanguageModelV2
|
|
|
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-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' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
|
|
5
|
+
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' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | (string & {});
|
|
6
6
|
|
|
7
7
|
type AnthropicMessagesConfig = {
|
|
8
8
|
provider: string;
|
|
@@ -52,6 +52,11 @@ declare function getModelCapabilities(modelId: string): {
|
|
|
52
52
|
* Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
|
|
53
53
|
*/
|
|
54
54
|
rejectsForcedToolUse: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Supports `thinking.type` `between_tools`, the lowest thinking setting on
|
|
57
|
+
* models that reject disabled thinking.
|
|
58
|
+
*/
|
|
59
|
+
supportsBetweenToolsThinking: boolean;
|
|
55
60
|
isKnownModel: boolean;
|
|
56
61
|
};
|
|
57
62
|
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV2, JSONSchema7, SharedV2ProviderMetadata, LanguageModelV2
|
|
|
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-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' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
|
|
5
|
+
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' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | (string & {});
|
|
6
6
|
|
|
7
7
|
type AnthropicMessagesConfig = {
|
|
8
8
|
provider: string;
|
|
@@ -52,6 +52,11 @@ declare function getModelCapabilities(modelId: string): {
|
|
|
52
52
|
* Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
|
|
53
53
|
*/
|
|
54
54
|
rejectsForcedToolUse: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Supports `thinking.type` `between_tools`, the lowest thinking setting on
|
|
57
|
+
* models that reject disabled thinking.
|
|
58
|
+
*/
|
|
59
|
+
supportsBetweenToolsThinking: boolean;
|
|
55
60
|
isKnownModel: boolean;
|
|
56
61
|
};
|
|
57
62
|
|
package/dist/internal/index.js
CHANGED
|
@@ -673,9 +673,10 @@ var anthropicSystemMessageProviderOptions = import_v43.z.object({
|
|
|
673
673
|
*/
|
|
674
674
|
clearAt: import_v43.z.literal("next_user_message").optional(),
|
|
675
675
|
/**
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
676
|
+
* Sets the model effort from the next user turn until a later message
|
|
677
|
+
* changes it. An effort-only system message with empty content can appear
|
|
678
|
+
* first. The required `mid-conversation-output-config-2026-07-01` beta is
|
|
679
|
+
* added automatically.
|
|
679
680
|
*/
|
|
680
681
|
effort: import_v43.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
681
682
|
/**
|
|
@@ -725,7 +726,7 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
725
726
|
*
|
|
726
727
|
* - `outputFormat`: Use the `output_format` parameter to specify the structured output format.
|
|
727
728
|
* - `jsonTool`: Use a special JSON response tool to specify the structured output format (default for most models).
|
|
728
|
-
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Opus 5.5 and Fable 5.1).
|
|
729
|
+
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Sonnet 5.5, Opus 5.5, and Fable 5.1).
|
|
729
730
|
*/
|
|
730
731
|
structuredOutputMode: import_v43.z.enum(["outputFormat", "jsonTool", "auto"]).optional(),
|
|
731
732
|
/**
|
|
@@ -738,6 +739,9 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
738
739
|
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
739
740
|
* provider drops the unsupported setting, emits a warning, and sends an
|
|
740
741
|
* adaptive thinking request. Use `effort` to control how much they think.
|
|
742
|
+
*
|
|
743
|
+
* `claude-sonnet-5-5` supports `between_tools`, its lowest thinking setting,
|
|
744
|
+
* and the provider uses it in place of `disabled` for that model.
|
|
741
745
|
*/
|
|
742
746
|
thinking: import_v43.z.union([
|
|
743
747
|
import_v43.z.object({
|
|
@@ -769,6 +773,14 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
769
773
|
import_v43.z.object({
|
|
770
774
|
type: import_v43.z.literal("disabled")
|
|
771
775
|
}),
|
|
776
|
+
import_v43.z.object({
|
|
777
|
+
/**
|
|
778
|
+
* for `claude-sonnet-5-5`: no upfront thinking, but progress notes
|
|
779
|
+
* between tool calls are returned as summarized thinking blocks.
|
|
780
|
+
* Only supported at `low`, `medium`, and `high` effort.
|
|
781
|
+
*/
|
|
782
|
+
type: import_v43.z.literal("between_tools")
|
|
783
|
+
}),
|
|
772
784
|
import_v43.z.object({
|
|
773
785
|
/**
|
|
774
786
|
* Configure prefix mismatch handling without changing the model's
|
|
@@ -1639,7 +1651,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1639
1651
|
cacheControlValidator,
|
|
1640
1652
|
toolsetNames = {}
|
|
1641
1653
|
}) {
|
|
1642
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
1654
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1643
1655
|
const betas = /* @__PURE__ */ new Set();
|
|
1644
1656
|
const blocks = groupIntoBlocks(prompt);
|
|
1645
1657
|
const validator = cacheControlValidator || new CacheControlValidator();
|
|
@@ -1671,10 +1683,9 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1671
1683
|
const type = block.type;
|
|
1672
1684
|
switch (type) {
|
|
1673
1685
|
case "system": {
|
|
1674
|
-
const
|
|
1686
|
+
const systemMessages = [];
|
|
1675
1687
|
let toolChangeCount = 0;
|
|
1676
|
-
let
|
|
1677
|
-
let effort = void 0;
|
|
1688
|
+
let hasMidConversationOptions = false;
|
|
1678
1689
|
for (const { content: text, providerOptions } of block.messages) {
|
|
1679
1690
|
const systemMessageOptions = await (0, import_provider_utils10.parseProviderOptions)({
|
|
1680
1691
|
provider: "anthropic",
|
|
@@ -1682,8 +1693,9 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1682
1693
|
schema: anthropicSystemMessageProviderOptions
|
|
1683
1694
|
});
|
|
1684
1695
|
const toolChanges = (_a = systemMessageOptions == null ? void 0 : systemMessageOptions.toolChanges) != null ? _a : [];
|
|
1685
|
-
clearAt =
|
|
1686
|
-
effort =
|
|
1696
|
+
const clearAt = systemMessageOptions == null ? void 0 : systemMessageOptions.clearAt;
|
|
1697
|
+
const effort = systemMessageOptions == null ? void 0 : systemMessageOptions.effort;
|
|
1698
|
+
const content = [];
|
|
1687
1699
|
if (text !== "" || toolChanges.length === 0 && (systemMessageOptions == null ? void 0 : systemMessageOptions.clearAt) == null && (systemMessageOptions == null ? void 0 : systemMessageOptions.effort) == null) {
|
|
1688
1700
|
content.push({
|
|
1689
1701
|
type: "text",
|
|
@@ -1704,33 +1716,47 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1704
1716
|
}
|
|
1705
1717
|
});
|
|
1706
1718
|
}
|
|
1719
|
+
hasMidConversationOptions || (hasMidConversationOptions = clearAt != null || effort != null);
|
|
1720
|
+
systemMessages.push({
|
|
1721
|
+
role: "system",
|
|
1722
|
+
content,
|
|
1723
|
+
...clearAt != null && { clear_at: clearAt },
|
|
1724
|
+
...effort != null && { output_config: { effort } }
|
|
1725
|
+
});
|
|
1707
1726
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
if (hasMidConversationOptions) {
|
|
1727
|
+
if (i === 0 || system == null && toolChangeCount === 0 && !hasMidConversationOptions) {
|
|
1728
|
+
if (toolChangeCount > 0) {
|
|
1711
1729
|
warnings.push({
|
|
1712
1730
|
type: "other",
|
|
1713
|
-
message: "
|
|
1731
|
+
message: "tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored."
|
|
1714
1732
|
});
|
|
1715
1733
|
}
|
|
1716
|
-
|
|
1717
|
-
(
|
|
1734
|
+
for (const message of systemMessages) {
|
|
1735
|
+
if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {
|
|
1736
|
+
messages.push(message);
|
|
1737
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
1738
|
+
} else if (message.clear_at != null || message.output_config != null) {
|
|
1739
|
+
warnings.push({
|
|
1740
|
+
type: "other",
|
|
1741
|
+
message: "clearAt and effort on this initial system message are not supported by Anthropic. Use a separate effort-only system message with empty content to set effort. These options have been ignored."
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
system = systemMessages.flatMap(
|
|
1746
|
+
(message) => message.content.filter(
|
|
1747
|
+
(part) => part.type === "text"
|
|
1748
|
+
)
|
|
1718
1749
|
);
|
|
1719
1750
|
} else {
|
|
1720
|
-
messages.push(
|
|
1721
|
-
role: "system",
|
|
1722
|
-
content,
|
|
1723
|
-
...clearAt != null && { clear_at: clearAt },
|
|
1724
|
-
...effort != null && { output_config: { effort } }
|
|
1725
|
-
});
|
|
1751
|
+
messages.push(...systemMessages);
|
|
1726
1752
|
betas.add("mid-conversation-system-2026-04-07");
|
|
1727
1753
|
if (toolChangeCount > 0) {
|
|
1728
1754
|
betas.add("mid-conversation-tool-changes-2026-07-01");
|
|
1729
1755
|
}
|
|
1730
|
-
if (
|
|
1756
|
+
if (systemMessages.some((message) => message.clear_at != null)) {
|
|
1731
1757
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
1732
1758
|
}
|
|
1733
|
-
if (
|
|
1759
|
+
if (systemMessages.some((message) => message.output_config != null)) {
|
|
1734
1760
|
betas.add("mid-conversation-output-config-2026-07-01");
|
|
1735
1761
|
}
|
|
1736
1762
|
}
|
|
@@ -1745,10 +1771,10 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1745
1771
|
for (let j = 0; j < content.length; j++) {
|
|
1746
1772
|
const part = content[j];
|
|
1747
1773
|
const isLastPart = j === content.length - 1;
|
|
1748
|
-
const cacheControl = (
|
|
1774
|
+
const cacheControl = (_b = validator.getCacheControl(part.providerOptions, {
|
|
1749
1775
|
type: "user message part",
|
|
1750
1776
|
canCache: true
|
|
1751
|
-
})) != null ?
|
|
1777
|
+
})) != null ? _b : isLastPart ? validator.getCacheControl(message.providerOptions, {
|
|
1752
1778
|
type: "user message",
|
|
1753
1779
|
canCache: true
|
|
1754
1780
|
}) : void 0;
|
|
@@ -1793,7 +1819,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1793
1819
|
media_type: "application/pdf",
|
|
1794
1820
|
data: (0, import_provider_utils10.convertToBase64)(part.data)
|
|
1795
1821
|
},
|
|
1796
|
-
title: (
|
|
1822
|
+
title: (_c = metadata.title) != null ? _c : part.filename,
|
|
1797
1823
|
...metadata.context && { context: metadata.context },
|
|
1798
1824
|
...enableCitations && {
|
|
1799
1825
|
citations: { enabled: true }
|
|
@@ -1817,7 +1843,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1817
1843
|
media_type: "text/plain",
|
|
1818
1844
|
data: convertToString(part.data)
|
|
1819
1845
|
},
|
|
1820
|
-
title: (
|
|
1846
|
+
title: (_d = metadata.title) != null ? _d : part.filename,
|
|
1821
1847
|
...metadata.context && { context: metadata.context },
|
|
1822
1848
|
...enableCitations && {
|
|
1823
1849
|
citations: { enabled: true }
|
|
@@ -1839,10 +1865,10 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1839
1865
|
for (let i2 = 0; i2 < content.length; i2++) {
|
|
1840
1866
|
const part = content[i2];
|
|
1841
1867
|
const isLastPart = i2 === content.length - 1;
|
|
1842
|
-
const cacheControl = (
|
|
1868
|
+
const cacheControl = (_e = validator.getCacheControl(part.providerOptions, {
|
|
1843
1869
|
type: "tool result part",
|
|
1844
1870
|
canCache: true
|
|
1845
|
-
})) != null ?
|
|
1871
|
+
})) != null ? _e : isLastPart ? validator.getCacheControl(message.providerOptions, {
|
|
1846
1872
|
type: "tool result message",
|
|
1847
1873
|
canCache: true
|
|
1848
1874
|
}) : void 0;
|
|
@@ -1930,16 +1956,16 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1930
1956
|
for (let k = 0; k < content.length; k++) {
|
|
1931
1957
|
const part = content[k];
|
|
1932
1958
|
const isLastContentPart = k === content.length - 1;
|
|
1933
|
-
const cacheControl = (
|
|
1959
|
+
const cacheControl = (_f = validator.getCacheControl(part.providerOptions, {
|
|
1934
1960
|
type: "assistant message part",
|
|
1935
1961
|
canCache: true
|
|
1936
|
-
})) != null ?
|
|
1962
|
+
})) != null ? _f : isLastContentPart ? validator.getCacheControl(message.providerOptions, {
|
|
1937
1963
|
type: "assistant message",
|
|
1938
1964
|
canCache: true
|
|
1939
1965
|
}) : void 0;
|
|
1940
1966
|
switch (part.type) {
|
|
1941
1967
|
case "text": {
|
|
1942
|
-
const textMetadata = (
|
|
1968
|
+
const textMetadata = (_g = part.providerOptions) == null ? void 0 : _g.anthropic;
|
|
1943
1969
|
if ((textMetadata == null ? void 0 : textMetadata.type) === "compaction") {
|
|
1944
1970
|
anthropicContent.push({
|
|
1945
1971
|
type: "compaction",
|
|
@@ -2619,6 +2645,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2619
2645
|
rejectsThinkingDisabledAboveHighEffort,
|
|
2620
2646
|
rejectsThinkingDisabled,
|
|
2621
2647
|
rejectsForcedToolUse,
|
|
2648
|
+
supportsBetweenToolsThinking,
|
|
2622
2649
|
isKnownModel
|
|
2623
2650
|
} = getModelCapabilities(this.modelId);
|
|
2624
2651
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -2654,7 +2681,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2654
2681
|
}
|
|
2655
2682
|
}
|
|
2656
2683
|
const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
|
|
2657
|
-
const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : this.modelId.includes("claude-fable-5-1") || this.modelId.includes("claude-opus-5-5") ? "auto" : "jsonTool";
|
|
2684
|
+
const structureOutputMode = (_a = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _a : this.modelId.includes("claude-fable-5-1") || this.modelId.includes("claude-opus-5-5") || this.modelId.includes("claude-sonnet-5-5") ? "auto" : "jsonTool";
|
|
2658
2685
|
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
2659
2686
|
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
2660
2687
|
warnings.push({
|
|
@@ -2689,7 +2716,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2689
2716
|
});
|
|
2690
2717
|
if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
|
|
2691
2718
|
const thinking = anthropicOptions.thinking;
|
|
2692
|
-
if ("type" in thinking && thinking.type === "disabled") {
|
|
2719
|
+
if ("type" in thinking && thinking.type === "disabled" && supportsBetweenToolsThinking) {
|
|
2720
|
+
warnings.push({
|
|
2721
|
+
type: "unsupported-setting",
|
|
2722
|
+
setting: "providerOptions.anthropic.thinking",
|
|
2723
|
+
details: `thinking cannot be disabled for ${this.modelId}. Using 'between_tools' thinking, the lowest thinking setting, instead.`
|
|
2724
|
+
});
|
|
2725
|
+
anthropicOptions.thinking = { type: "between_tools" };
|
|
2726
|
+
} else if ("type" in thinking && thinking.type === "disabled") {
|
|
2693
2727
|
warnings.push({
|
|
2694
2728
|
type: "unsupported-setting",
|
|
2695
2729
|
setting: "providerOptions.anthropic.thinking",
|
|
@@ -2720,7 +2754,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2720
2754
|
});
|
|
2721
2755
|
anthropicOptions.effort = "high";
|
|
2722
2756
|
}
|
|
2723
|
-
|
|
2757
|
+
if (thinkingType === "between_tools" && anthropicOptions != null && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
2758
|
+
warnings.push({
|
|
2759
|
+
type: "unsupported-setting",
|
|
2760
|
+
setting: "providerOptions.anthropic.effort",
|
|
2761
|
+
details: `effort '${anthropicOptions.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`
|
|
2762
|
+
});
|
|
2763
|
+
anthropicOptions.effort = "high";
|
|
2764
|
+
}
|
|
2765
|
+
const isThinking = thinkingType === "enabled" || thinkingType === "adaptive" || thinkingType === "between_tools";
|
|
2724
2766
|
let thinkingBudget = thinkingOptions != null && "budgetTokens" in thinkingOptions ? thinkingOptions.budgetTokens : void 0;
|
|
2725
2767
|
const thinkingDisplay = thinkingOptions != null && "display" in thinkingOptions ? thinkingOptions.display : void 0;
|
|
2726
2768
|
const thinkingBlockBinding = thinkingOptions != null && "blockBinding" in thinkingOptions ? thinkingOptions.blockBinding : void 0;
|
|
@@ -4085,7 +4127,18 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4085
4127
|
}
|
|
4086
4128
|
};
|
|
4087
4129
|
function getModelCapabilities(modelId) {
|
|
4088
|
-
if (modelId.includes("claude-
|
|
4130
|
+
if (modelId.includes("claude-sonnet-5-5")) {
|
|
4131
|
+
return {
|
|
4132
|
+
maxOutputTokens: 128e3,
|
|
4133
|
+
supportsStructuredOutput: true,
|
|
4134
|
+
rejectsSamplingParameters: true,
|
|
4135
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4136
|
+
rejectsThinkingDisabled: true,
|
|
4137
|
+
rejectsForcedToolUse: true,
|
|
4138
|
+
supportsBetweenToolsThinking: true,
|
|
4139
|
+
isKnownModel: true
|
|
4140
|
+
};
|
|
4141
|
+
} else if (modelId.includes("claude-opus-5-5")) {
|
|
4089
4142
|
return {
|
|
4090
4143
|
maxOutputTokens: 128e3,
|
|
4091
4144
|
supportsStructuredOutput: true,
|
|
@@ -4093,6 +4146,7 @@ function getModelCapabilities(modelId) {
|
|
|
4093
4146
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4094
4147
|
rejectsThinkingDisabled: true,
|
|
4095
4148
|
rejectsForcedToolUse: true,
|
|
4149
|
+
supportsBetweenToolsThinking: false,
|
|
4096
4150
|
isKnownModel: true
|
|
4097
4151
|
};
|
|
4098
4152
|
} else if (modelId.includes("claude-opus-5")) {
|
|
@@ -4103,6 +4157,7 @@ function getModelCapabilities(modelId) {
|
|
|
4103
4157
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4104
4158
|
rejectsThinkingDisabled: false,
|
|
4105
4159
|
rejectsForcedToolUse: false,
|
|
4160
|
+
supportsBetweenToolsThinking: false,
|
|
4106
4161
|
isKnownModel: true
|
|
4107
4162
|
};
|
|
4108
4163
|
} else if (modelId.includes("claude-fable-5-1")) {
|
|
@@ -4113,6 +4168,7 @@ function getModelCapabilities(modelId) {
|
|
|
4113
4168
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4114
4169
|
rejectsThinkingDisabled: true,
|
|
4115
4170
|
rejectsForcedToolUse: true,
|
|
4171
|
+
supportsBetweenToolsThinking: false,
|
|
4116
4172
|
isKnownModel: true
|
|
4117
4173
|
};
|
|
4118
4174
|
} else if (modelId.includes("claude-fable-5")) {
|
|
@@ -4123,6 +4179,7 @@ function getModelCapabilities(modelId) {
|
|
|
4123
4179
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4124
4180
|
rejectsThinkingDisabled: true,
|
|
4125
4181
|
rejectsForcedToolUse: false,
|
|
4182
|
+
supportsBetweenToolsThinking: false,
|
|
4126
4183
|
isKnownModel: true
|
|
4127
4184
|
};
|
|
4128
4185
|
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
@@ -4133,6 +4190,7 @@ function getModelCapabilities(modelId) {
|
|
|
4133
4190
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4134
4191
|
rejectsThinkingDisabled: false,
|
|
4135
4192
|
rejectsForcedToolUse: false,
|
|
4193
|
+
supportsBetweenToolsThinking: false,
|
|
4136
4194
|
isKnownModel: true
|
|
4137
4195
|
};
|
|
4138
4196
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -4143,6 +4201,7 @@ function getModelCapabilities(modelId) {
|
|
|
4143
4201
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4144
4202
|
rejectsThinkingDisabled: false,
|
|
4145
4203
|
rejectsForcedToolUse: false,
|
|
4204
|
+
supportsBetweenToolsThinking: false,
|
|
4146
4205
|
isKnownModel: true
|
|
4147
4206
|
};
|
|
4148
4207
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -4153,6 +4212,7 @@ function getModelCapabilities(modelId) {
|
|
|
4153
4212
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4154
4213
|
rejectsThinkingDisabled: false,
|
|
4155
4214
|
rejectsForcedToolUse: false,
|
|
4215
|
+
supportsBetweenToolsThinking: false,
|
|
4156
4216
|
isKnownModel: true
|
|
4157
4217
|
};
|
|
4158
4218
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -4163,6 +4223,7 @@ function getModelCapabilities(modelId) {
|
|
|
4163
4223
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4164
4224
|
rejectsThinkingDisabled: false,
|
|
4165
4225
|
rejectsForcedToolUse: false,
|
|
4226
|
+
supportsBetweenToolsThinking: false,
|
|
4166
4227
|
isKnownModel: true
|
|
4167
4228
|
};
|
|
4168
4229
|
} else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet")) {
|
|
@@ -4173,6 +4234,7 @@ function getModelCapabilities(modelId) {
|
|
|
4173
4234
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4174
4235
|
rejectsThinkingDisabled: false,
|
|
4175
4236
|
rejectsForcedToolUse: false,
|
|
4237
|
+
supportsBetweenToolsThinking: false,
|
|
4176
4238
|
isKnownModel: true
|
|
4177
4239
|
};
|
|
4178
4240
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
@@ -4183,6 +4245,7 @@ function getModelCapabilities(modelId) {
|
|
|
4183
4245
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4184
4246
|
rejectsThinkingDisabled: false,
|
|
4185
4247
|
rejectsForcedToolUse: false,
|
|
4248
|
+
supportsBetweenToolsThinking: false,
|
|
4186
4249
|
isKnownModel: true
|
|
4187
4250
|
};
|
|
4188
4251
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -4193,6 +4256,7 @@ function getModelCapabilities(modelId) {
|
|
|
4193
4256
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4194
4257
|
rejectsThinkingDisabled: false,
|
|
4195
4258
|
rejectsForcedToolUse: false,
|
|
4259
|
+
supportsBetweenToolsThinking: false,
|
|
4196
4260
|
isKnownModel: true
|
|
4197
4261
|
};
|
|
4198
4262
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -4203,6 +4267,7 @@ function getModelCapabilities(modelId) {
|
|
|
4203
4267
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4204
4268
|
rejectsThinkingDisabled: false,
|
|
4205
4269
|
rejectsForcedToolUse: false,
|
|
4270
|
+
supportsBetweenToolsThinking: false,
|
|
4206
4271
|
isKnownModel: false
|
|
4207
4272
|
};
|
|
4208
4273
|
} else if (modelId.includes("claude-")) {
|
|
@@ -4213,6 +4278,7 @@ function getModelCapabilities(modelId) {
|
|
|
4213
4278
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4214
4279
|
rejectsThinkingDisabled: false,
|
|
4215
4280
|
rejectsForcedToolUse: false,
|
|
4281
|
+
supportsBetweenToolsThinking: false,
|
|
4216
4282
|
isKnownModel: false
|
|
4217
4283
|
};
|
|
4218
4284
|
} else {
|
|
@@ -4223,6 +4289,7 @@ function getModelCapabilities(modelId) {
|
|
|
4223
4289
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4224
4290
|
rejectsThinkingDisabled: false,
|
|
4225
4291
|
rejectsForcedToolUse: false,
|
|
4292
|
+
supportsBetweenToolsThinking: false,
|
|
4226
4293
|
isKnownModel: false
|
|
4227
4294
|
};
|
|
4228
4295
|
}
|