@ai-sdk/anthropic 4.0.92 → 4.0.93
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 +11 -0
- package/dist/index.js +326 -218
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +17 -35
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +326 -218
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +11 -7
- package/package.json +3 -3
- package/src/anthropic-language-model.ts +3 -280
- package/src/anthropic-model-catalog.ts +406 -0
package/dist/internal/index.d.ts
CHANGED
|
@@ -844,6 +844,22 @@ declare class CacheControlValidator {
|
|
|
844
844
|
/** Return undefined to use the default file conversion. */
|
|
845
845
|
type AnthropicMediaPartConverter = (part: LanguageModelV4FilePart) => PromiseLike<Omit<AnthropicImageContent | AnthropicVideoContent, 'cache_control'> | undefined>;
|
|
846
846
|
//#endregion
|
|
847
|
+
//#region src/anthropic-model-catalog.d.ts
|
|
848
|
+
/** Compatibility projection for the provider's existing request preparation. */
|
|
849
|
+
declare function getAnthropicModelCapabilities(modelId: string): {
|
|
850
|
+
maxOutputTokens: number;
|
|
851
|
+
supportsStructuredOutput: boolean;
|
|
852
|
+
supportsAdaptiveThinking: boolean;
|
|
853
|
+
rejectsSamplingParameters: boolean;
|
|
854
|
+
supportsXhighEffort: boolean;
|
|
855
|
+
rejectsThinkingDisabledAboveHighEffort: boolean;
|
|
856
|
+
rejectsThinkingDisabled: boolean;
|
|
857
|
+
rejectsBudgetThinking: boolean;
|
|
858
|
+
rejectsForcedToolUse: boolean;
|
|
859
|
+
supportsBetweenToolsThinking: boolean;
|
|
860
|
+
isKnownModel: boolean;
|
|
861
|
+
};
|
|
862
|
+
//#endregion
|
|
847
863
|
//#region src/anthropic-language-model.d.ts
|
|
848
864
|
type AnthropicLanguageModelConfig = {
|
|
849
865
|
provider: string;
|
|
@@ -1019,40 +1035,6 @@ export declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
1019
1035
|
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
1020
1036
|
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
1021
1037
|
}
|
|
1022
|
-
/**
|
|
1023
|
-
* Returns the capabilities of a Claude model that are used for defaults and feature selection.
|
|
1024
|
-
*
|
|
1025
|
-
* @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
|
|
1026
|
-
* @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
1027
|
-
*/
|
|
1028
|
-
export declare function getModelCapabilities(modelId: string): {
|
|
1029
|
-
maxOutputTokens: number;
|
|
1030
|
-
supportsStructuredOutput: boolean;
|
|
1031
|
-
supportsAdaptiveThinking: boolean;
|
|
1032
|
-
rejectsSamplingParameters: boolean;
|
|
1033
|
-
supportsXhighEffort: boolean;
|
|
1034
|
-
rejectsThinkingDisabledAboveHighEffort: boolean;
|
|
1035
|
-
/**
|
|
1036
|
-
* Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
|
|
1037
|
-
* are rejected with a 400.
|
|
1038
|
-
*/
|
|
1039
|
-
rejectsThinkingDisabled: boolean;
|
|
1040
|
-
/**
|
|
1041
|
-
* Budget-based thinking (`thinking.type` `enabled` with `budget_tokens`) is
|
|
1042
|
-
* rejected with a 400. Only adaptive thinking is supported.
|
|
1043
|
-
*/
|
|
1044
|
-
rejectsBudgetThinking: boolean;
|
|
1045
|
-
/**
|
|
1046
|
-
* Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
|
|
1047
|
-
*/
|
|
1048
|
-
rejectsForcedToolUse: boolean;
|
|
1049
|
-
/**
|
|
1050
|
-
* Supports `thinking.type` `between_tools`, the lowest thinking setting on
|
|
1051
|
-
* models that reject disabled thinking.
|
|
1052
|
-
*/
|
|
1053
|
-
supportsBetweenToolsThinking: boolean;
|
|
1054
|
-
isKnownModel: boolean;
|
|
1055
|
-
};
|
|
1056
1038
|
//#endregion
|
|
1057
1039
|
//#region src/tool/computer-toolset_20260801.d.ts
|
|
1058
1040
|
/**
|
|
@@ -2163,5 +2145,5 @@ export declare class AnthropicSkills implements SkillsV4 {
|
|
|
2163
2145
|
uploadSkill(params: Parameters<SkillsV4['uploadSkill']>[0]): Promise<Awaited<ReturnType<SkillsV4['uploadSkill']>>>;
|
|
2164
2146
|
}
|
|
2165
2147
|
//#endregion
|
|
2166
|
-
export { AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId };
|
|
2148
|
+
export { AnthropicLanguageModel as AnthropicMessagesLanguageModel, type AnthropicModelId as AnthropicMessagesModelId, type AnthropicModelId, getAnthropicModelCapabilities as getModelCapabilities };
|
|
2167
2149
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$__anthropic_api0.AnthropicToolChoice","_$__anthropic_api0.AnthropicTextContent","_$__anthropic_api0.AnthropicMessage","SandboxSession","SandboxSession","_$__tool_computer_toolset_202608010.ComputerToolset_20260801Member"],"sources":["../../src/anthropic-files.ts","../../src/anthropic-api.ts","../../src/anthropic-language-model-options.ts","../../src/get-cache-control.ts","../../src/convert-to-anthropic-prompt.ts","../../src/anthropic-language-model.ts","../../src/tool/computer-toolset_20260801.ts","../../src/tool/bash_20241022.ts","../../src/tool/bash_20250124.ts","../../src/anthropic-tools.ts","../../src/anthropic-prepare-tools.ts","../../src/sanitize-json-schema.ts","../../src/skills/anthropic-skills.ts"],"mappings":";;;;UAiCU;EACR;EACA;EACA,SAAS,WAAW;EACpB,QAAQ;;qBAGG,0BAA0B;mBAOR;WANpB;MAEL;EAIyB,YAAA,QAAQ;EAE/B,aACJ,MACA,WACA,UACA,aACA,WACC,+BAA+B,QAAQ;;;;KC1ChC,mBACR,uBACA,4BACA;KAEQ;EACV;EACA;;UAGe;EACf;EACA,SAAS,MAAM,uBAAuB;EACtC;EACA;IACE;;;;;;;;;;UAWa;EACf;EACA;IAAQ;IAAwB;;EAChC;;UAGe;EACf;EACA,SAAS,MACL,uBACA,wBACA,wBACA,2BACA,kCACA;;UAIW;EACf;EACA,SAAS,MACL,uBACA,2BACA,mCACA,2BACA,2BACA,gCACA,0CACA,qCACA,sCACA,uCACA,8CACA,oDACA,oCACA,6BACA,gCACA;;cAIO,sCAA8B,EAAA;;;;;;;;GAKvC,EAAA,KAAA;KAKQ,2BAA2B,YACrC,kBAAkB;EAElB;;UAGe;EACf;EACA;EACA;EACA,gBAAgB;;UAGD;EACf;EACA;EACA,YAAY;EACZ,eAAe;;UAGA;EACf;EACA;EACA;EAGA;;UAGe;EACf;EACA;EAGA;;KAGG;EAEC;EACA;EACA;;EAGA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;;UAGW;EACf;EACA,QAAQ;EACR,eAAe;;;UAIA;EACf;EACA,QAAQ;EACR,eAAe;;UAGA;EACf;EACA,QAAQ;EACR;EACA;EACA;IAAc;;EACd,eAAe;;UAGA;EACf;EACA;EACA;;;;;;KAOU;EAEN;EACA;;EAGA;EACA;;EAGA;;UAGW;EACf;EACA;EACA;EACA;;;;;EAKA,SAAS;;;;;EAKT;EACA,eAAe;;UAGA;EACf;EACA;EACA;EAaA;EACA,SAAS;EACT,eAAe;;KAKZ,6BAA6B,KAChC;EAGA;;KAGG,8BAA8B,KACjC;EAGA;;KAGG,iCAAiC,KACpC;EAGA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;;;EAIA;EACA,kBAEI,MACI,6BACA,8BACA,iCACA;EAER;EACA,eAAe;;UAGA;EACf;EACA;EACA,SACI;IACE;IACA;IACA;IACA;IACA;;IAGA;IACA;;EAEN,SAAS;EACT,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA,iBAAiB;MACf;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;;IAGA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA;MACE;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;;IAGA;IACA;IACA;;IAGA;;;;;;IAMA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;MACE;MACA;MACA;QAAc;;MACd;QACM;QAAgB;QAA+B;;QAC/C;QAAc;QAA0B;;;;IAIhD;IACA;;EAEN,SAAS;EACT,eAAe;;UAEA;EACf;EACA;EACA;EACA;EACA;EACA,eAAe;;UAGA;EACf;EACA;EACA;EACA,kBAEI;IACE;IACA;IACA,YAAY;;EAElB,eAAe;;KAGL;EAEN;EACA;EACA,cAAc;EACd,eAAe;EACf;EACA;;;;;EAKA;;;;;;;;EAQA,kBAAkB;;EAKlB;EACA;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA,eAAe;;EAGf;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;;;;;;EAOf;EACA,UAAU;IAAiB;IAAmB;;EAC9C,eAAe;;EAGf;EACA;EAIA,eAAe;;EAGf;EACA;EACA;EACA,eAAe;;EAGf;EACA;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;IAAc;;EACd;EACA;EACA;EACA,eAAe;;EAGf;EAIA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;EAEF;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;IACE;IACA;;;KAMI;EACN;EAAsB;;EACtB;;EACA;EAAc;EAAc;;cAgNrB,0DAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgwBxB,WAAW,aACpB,mBAAmB;EAClB;;;;KC3iDQ;;;cCuBC;mBAIkB;UAHrB;UACA;EAEqB,YAAA;EAE7B,gBACE,kBAAkB,sCAClB;IAAW;IAAc;MACxB;EAkCH,eAAe;;;;;KCSL,+BACV,MAAM,4BACH,YACD,KAAK,wBAAwB
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__anthropic_api0.AnthropicToolChoice","_$__anthropic_api0.AnthropicTextContent","_$__anthropic_api0.AnthropicMessage","SandboxSession","SandboxSession","_$__tool_computer_toolset_202608010.ComputerToolset_20260801Member"],"sources":["../../src/anthropic-files.ts","../../src/anthropic-api.ts","../../src/anthropic-language-model-options.ts","../../src/get-cache-control.ts","../../src/convert-to-anthropic-prompt.ts","../../src/anthropic-model-catalog.ts","../../src/anthropic-language-model.ts","../../src/tool/computer-toolset_20260801.ts","../../src/tool/bash_20241022.ts","../../src/tool/bash_20250124.ts","../../src/anthropic-tools.ts","../../src/anthropic-prepare-tools.ts","../../src/sanitize-json-schema.ts","../../src/skills/anthropic-skills.ts"],"mappings":";;;;UAiCU;EACR;EACA;EACA,SAAS,WAAW;EACpB,QAAQ;;qBAGG,0BAA0B;mBAOR;WANpB;MAEL;EAIyB,YAAA,QAAQ;EAE/B,aACJ,MACA,WACA,UACA,aACA,WACC,+BAA+B,QAAQ;;;;KC1ChC,mBACR,uBACA,4BACA;KAEQ;EACV;EACA;;UAGe;EACf;EACA,SAAS,MAAM,uBAAuB;EACtC;EACA;IACE;;;;;;;;;;UAWa;EACf;EACA;IAAQ;IAAwB;;EAChC;;UAGe;EACf;EACA,SAAS,MACL,uBACA,wBACA,wBACA,2BACA,kCACA;;UAIW;EACf;EACA,SAAS,MACL,uBACA,2BACA,mCACA,2BACA,2BACA,gCACA,0CACA,qCACA,sCACA,uCACA,8CACA,oDACA,oCACA,6BACA,gCACA;;cAIO,sCAA8B,EAAA;;;;;;;;GAKvC,EAAA,KAAA;KAKQ,2BAA2B,YACrC,kBAAkB;EAElB;;UAGe;EACf;EACA;EACA;EACA,gBAAgB;;UAGD;EACf;EACA;EACA,YAAY;EACZ,eAAe;;UAGA;EACf;EACA;EACA;EAGA;;UAGe;EACf;EACA;EAGA;;KAGG;EAEC;EACA;EACA;;EAGA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;;UAGW;EACf;EACA,QAAQ;EACR,eAAe;;;UAIA;EACf;EACA,QAAQ;EACR,eAAe;;UAGA;EACf;EACA,QAAQ;EACR;EACA;EACA;IAAc;;EACd,eAAe;;UAGA;EACf;EACA;EACA;;;;;;KAOU;EAEN;EACA;;EAGA;EACA;;EAGA;;UAGW;EACf;EACA;EACA;EACA;;;;;EAKA,SAAS;;;;;EAKT;EACA,eAAe;;UAGA;EACf;EACA;EACA;EAaA;EACA,SAAS;EACT,eAAe;;KAKZ,6BAA6B,KAChC;EAGA;;KAGG,8BAA8B,KACjC;EAGA;;KAGG,iCAAiC,KACpC;EAGA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;;;EAIA;EACA,kBAEI,MACI,6BACA,8BACA,iCACA;EAER;EACA,eAAe;;UAGA;EACf;EACA;EACA,SACI;IACE;IACA;IACA;IACA;IACA;;IAGA;IACA;;EAEN,SAAS;EACT,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA,iBAAiB;MACf;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;;IAGA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA;MACE;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;;IAGA;IACA;IACA;;IAGA;;;;;;IAMA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;MACE;MACA;MACA;QAAc;;MACd;QACM;QAAgB;QAA+B;;QAC/C;QAAc;QAA0B;;;;IAIhD;IACA;;EAEN,SAAS;EACT,eAAe;;UAEA;EACf;EACA;EACA;EACA;EACA;EACA,eAAe;;UAGA;EACf;EACA;EACA;EACA,kBAEI;IACE;IACA;IACA,YAAY;;EAElB,eAAe;;KAGL;EAEN;EACA;EACA,cAAc;EACd,eAAe;EACf;EACA;;;;;EAKA;;;;;;;;EAQA,kBAAkB;;EAKlB;EACA;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA,eAAe;;EAGf;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;;;;;;EAOf;EACA,UAAU;IAAiB;IAAmB;;EAC9C,eAAe;;EAGf;EACA;EAIA,eAAe;;EAGf;EACA;EACA;EACA,eAAe;;EAGf;EACA;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;IAAc;;EACd;EACA;EACA;EACA,eAAe;;EAGf;EAIA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;EAEF;EACA,eAAe;;EAGf;EACA;;EAGA;EACA;;EAGA;E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;;;;;;;;;;;;;;MAJlB;MACF;MACJ;MAEwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAHxB;MACA;MAEa;MACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCnBC,eACpB,OACA,YACA,wBACA,uBACA,0BACA,qBACA,4BACA;EAEA,OAAO;EACP,YAAY;EACZ;EACA,wBAAwB;;;;EAKxB;;;;EAKA;;;;;EAMA;;;;;;EAOA;IACE;EACF,OAAO,MAAM;EACb,YAAY;EACZ,cAAc;EACd,OAAO;;;;;;;;;;;wBC3BO,mBAAmB,QAAQ,cAAc;;;UCtB/C;EACR;EACA;EACA,SAAS,WAAW;EACpB,QAAQ;;qBAGG,2BAA2B;mBAOT;WANpB;MAEL;EAIyB,YAAA,QAAQ;UAEvB;UAMA;EA0BR,YACJ,QAAQ,WAAW,8BAClB,QAAQ,QAAQ,WAAW"}
|
package/dist/internal/index.js
CHANGED
|
@@ -63,6 +63,330 @@ var AnthropicFiles = class {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
//#endregion
|
|
66
|
+
//#region src/anthropic-model-catalog.ts
|
|
67
|
+
/**
|
|
68
|
+
* Options accepted under `providerOptions.anthropic`. The `satisfies` check
|
|
69
|
+
* keeps this list in sync with the option schema.
|
|
70
|
+
*/
|
|
71
|
+
const anthropicProviderOptions = { language: {
|
|
72
|
+
sendReasoning: { description: "Whether to send reasoning to the model." },
|
|
73
|
+
structuredOutputMode: { description: "How structured outputs are generated." },
|
|
74
|
+
thinking: { description: "Extended thinking configuration." },
|
|
75
|
+
disableParallelToolUse: { description: "Use at most one tool per response." },
|
|
76
|
+
cacheControl: { description: "Prompt cache control settings." },
|
|
77
|
+
metadata: { description: "Request metadata, such as a user ID." },
|
|
78
|
+
mcpServers: { description: "MCP servers to use in the request." },
|
|
79
|
+
container: { description: "Container and Agent Skills configuration." },
|
|
80
|
+
toolStreaming: { description: "Fine-grained streaming of tool inputs and outputs." },
|
|
81
|
+
effort: { description: "Effort spent on thinking, text, and tool calls." },
|
|
82
|
+
taskBudget: { description: "Advisory token budget for an agentic task." },
|
|
83
|
+
speed: { description: "Fast mode for faster output token speeds." },
|
|
84
|
+
serviceTier: { description: "Service tier for the request." },
|
|
85
|
+
inferenceGeo: { description: "Where model inference runs." },
|
|
86
|
+
fallbacks: { description: "Server-side fallback models." },
|
|
87
|
+
anthropicBeta: { description: "Additional beta features to enable." },
|
|
88
|
+
safeguards: { description: "Server-side safeguards to run." },
|
|
89
|
+
compaction: { description: "On-demand conversation summary." },
|
|
90
|
+
contextManagement: { description: "Server-side context management." }
|
|
91
|
+
} };
|
|
92
|
+
const legacyClaude = defineRuntime({});
|
|
93
|
+
const currentClaude = defineRuntime({
|
|
94
|
+
maxOutputTokens: 128e3,
|
|
95
|
+
nativeStructuredOutput: true,
|
|
96
|
+
adaptiveThinking: true
|
|
97
|
+
});
|
|
98
|
+
const currentClaudeWithoutSampling = defineRuntime({
|
|
99
|
+
...currentClaude,
|
|
100
|
+
samplingParameters: false,
|
|
101
|
+
xhighEffort: true
|
|
102
|
+
});
|
|
103
|
+
function defineRuntime(overrides) {
|
|
104
|
+
return {
|
|
105
|
+
maxOutputTokens: 4096,
|
|
106
|
+
nativeStructuredOutput: false,
|
|
107
|
+
adaptiveThinking: false,
|
|
108
|
+
samplingParameters: true,
|
|
109
|
+
xhighEffort: false,
|
|
110
|
+
thinkingCanBeDisabledAboveHighEffort: true,
|
|
111
|
+
thinkingCanBeDisabled: true,
|
|
112
|
+
budgetThinking: true,
|
|
113
|
+
forcedToolUse: true,
|
|
114
|
+
betweenToolsThinking: false,
|
|
115
|
+
knownModel: true,
|
|
116
|
+
...overrides
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const runtimeRules = [
|
|
120
|
+
{
|
|
121
|
+
matches: (modelId) => modelId.includes("claude-sonnet-5-5"),
|
|
122
|
+
definition: defineRuntime({
|
|
123
|
+
...currentClaudeWithoutSampling,
|
|
124
|
+
thinkingCanBeDisabledAboveHighEffort: false,
|
|
125
|
+
thinkingCanBeDisabled: false,
|
|
126
|
+
budgetThinking: false,
|
|
127
|
+
forcedToolUse: false,
|
|
128
|
+
betweenToolsThinking: true
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
matches: (modelId) => modelId.includes("claude-opus-5-5"),
|
|
133
|
+
definition: defineRuntime({
|
|
134
|
+
...currentClaudeWithoutSampling,
|
|
135
|
+
thinkingCanBeDisabledAboveHighEffort: false,
|
|
136
|
+
thinkingCanBeDisabled: false,
|
|
137
|
+
budgetThinking: false,
|
|
138
|
+
forcedToolUse: false
|
|
139
|
+
})
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
matches: (modelId) => modelId.includes("claude-haiku-5-5"),
|
|
143
|
+
definition: defineRuntime({
|
|
144
|
+
...currentClaudeWithoutSampling,
|
|
145
|
+
thinkingCanBeDisabledAboveHighEffort: false,
|
|
146
|
+
budgetThinking: false
|
|
147
|
+
})
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
matches: (modelId) => modelId.includes("claude-opus-5"),
|
|
151
|
+
definition: defineRuntime({
|
|
152
|
+
...currentClaudeWithoutSampling,
|
|
153
|
+
thinkingCanBeDisabledAboveHighEffort: false
|
|
154
|
+
})
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
matches: (modelId) => modelId.includes("claude-fable-5-1"),
|
|
158
|
+
definition: defineRuntime({
|
|
159
|
+
...currentClaudeWithoutSampling,
|
|
160
|
+
thinkingCanBeDisabled: false,
|
|
161
|
+
budgetThinking: false,
|
|
162
|
+
forcedToolUse: false
|
|
163
|
+
})
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
matches: (modelId) => modelId.includes("claude-fable-5"),
|
|
167
|
+
definition: defineRuntime({
|
|
168
|
+
...currentClaudeWithoutSampling,
|
|
169
|
+
thinkingCanBeDisabled: false,
|
|
170
|
+
budgetThinking: false
|
|
171
|
+
})
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
matches: (modelId) => modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5"),
|
|
175
|
+
definition: currentClaudeWithoutSampling
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
matches: (modelId) => modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6"),
|
|
179
|
+
definition: currentClaude
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
matches: (modelId) => modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5"),
|
|
183
|
+
definition: defineRuntime({
|
|
184
|
+
maxOutputTokens: 64e3,
|
|
185
|
+
nativeStructuredOutput: true
|
|
186
|
+
})
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
matches: (modelId) => modelId.includes("claude-opus-4-1"),
|
|
190
|
+
definition: defineRuntime({
|
|
191
|
+
maxOutputTokens: 32e3,
|
|
192
|
+
nativeStructuredOutput: true
|
|
193
|
+
})
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
matches: (modelId) => /claude-sonnet-4(?:-|@)/.test(modelId),
|
|
197
|
+
definition: defineRuntime({ maxOutputTokens: 64e3 })
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
matches: (modelId) => /claude-opus-4(?:-|@)/.test(modelId),
|
|
201
|
+
definition: defineRuntime({ maxOutputTokens: 32e3 })
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
matches: (modelId) => modelId.includes("claude-3-haiku"),
|
|
205
|
+
definition: legacyClaude
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
matches: (modelId) => /claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId),
|
|
209
|
+
definition: defineRuntime({ knownModel: false })
|
|
210
|
+
}
|
|
211
|
+
];
|
|
212
|
+
const anthropicModelCatalog = Object.fromEntries(Object.entries({
|
|
213
|
+
"claude-opus-5-5": {
|
|
214
|
+
toolSearch: true,
|
|
215
|
+
compaction: true,
|
|
216
|
+
effort: true
|
|
217
|
+
},
|
|
218
|
+
"claude-opus-5": {
|
|
219
|
+
toolSearch: true,
|
|
220
|
+
compaction: true,
|
|
221
|
+
effort: true
|
|
222
|
+
},
|
|
223
|
+
"claude-sonnet-5-5": {
|
|
224
|
+
toolSearch: true,
|
|
225
|
+
compaction: true,
|
|
226
|
+
effort: true
|
|
227
|
+
},
|
|
228
|
+
"claude-sonnet-5": {
|
|
229
|
+
toolSearch: true,
|
|
230
|
+
compaction: true,
|
|
231
|
+
effort: true
|
|
232
|
+
},
|
|
233
|
+
"claude-haiku-5-5": {
|
|
234
|
+
toolSearch: true,
|
|
235
|
+
compaction: true,
|
|
236
|
+
effort: true
|
|
237
|
+
},
|
|
238
|
+
"claude-fable-5-1": {
|
|
239
|
+
toolSearch: true,
|
|
240
|
+
compaction: true,
|
|
241
|
+
effort: true
|
|
242
|
+
},
|
|
243
|
+
"claude-fable-5": {
|
|
244
|
+
toolSearch: true,
|
|
245
|
+
compaction: true,
|
|
246
|
+
effort: true
|
|
247
|
+
},
|
|
248
|
+
"claude-opus-4-8": {
|
|
249
|
+
toolSearch: true,
|
|
250
|
+
compaction: true,
|
|
251
|
+
effort: true
|
|
252
|
+
},
|
|
253
|
+
"claude-opus-4-7": {
|
|
254
|
+
toolSearch: true,
|
|
255
|
+
compaction: true,
|
|
256
|
+
effort: true
|
|
257
|
+
},
|
|
258
|
+
"claude-opus-4-6": {
|
|
259
|
+
toolSearch: true,
|
|
260
|
+
compaction: true,
|
|
261
|
+
effort: true
|
|
262
|
+
},
|
|
263
|
+
"claude-sonnet-4-6": {
|
|
264
|
+
toolSearch: true,
|
|
265
|
+
compaction: true,
|
|
266
|
+
effort: true
|
|
267
|
+
},
|
|
268
|
+
"claude-opus-4-5": {
|
|
269
|
+
toolSearch: true,
|
|
270
|
+
compaction: false,
|
|
271
|
+
effort: true
|
|
272
|
+
},
|
|
273
|
+
"claude-haiku-4-5": {
|
|
274
|
+
toolSearch: true,
|
|
275
|
+
compaction: false,
|
|
276
|
+
effort: false
|
|
277
|
+
},
|
|
278
|
+
"claude-sonnet-4-5": {
|
|
279
|
+
toolSearch: true,
|
|
280
|
+
compaction: false,
|
|
281
|
+
effort: false
|
|
282
|
+
},
|
|
283
|
+
"claude-opus-4-1": {
|
|
284
|
+
toolSearch: false,
|
|
285
|
+
compaction: false,
|
|
286
|
+
effort: false
|
|
287
|
+
},
|
|
288
|
+
"claude-opus-4-0": {
|
|
289
|
+
toolSearch: false,
|
|
290
|
+
compaction: false,
|
|
291
|
+
effort: false
|
|
292
|
+
},
|
|
293
|
+
"claude-sonnet-4-0": {
|
|
294
|
+
toolSearch: false,
|
|
295
|
+
compaction: false,
|
|
296
|
+
effort: false
|
|
297
|
+
}
|
|
298
|
+
}).map(([modelId, capabilities]) => [modelId, createAnthropicLanguageModelEntry(modelId, capabilities)]));
|
|
299
|
+
function getAnthropicLanguageModelEntry(modelId) {
|
|
300
|
+
return Object.prototype.hasOwnProperty.call(anthropicModelCatalog, modelId) ? anthropicModelCatalog[modelId] : createAnthropicLanguageModelEntry(modelId);
|
|
301
|
+
}
|
|
302
|
+
function createAnthropicLanguageModelEntry(modelId, documented) {
|
|
303
|
+
const runtime = resolveRuntimeDefinition(modelId);
|
|
304
|
+
const declared = documented != null;
|
|
305
|
+
const samplingSupport = runtime.samplingParameters ? true : { condition: "Only supported when thinking is disabled." };
|
|
306
|
+
const reasoningSupport = runtime.adaptiveThinking || runtime.budgetThinking;
|
|
307
|
+
return {
|
|
308
|
+
capabilities: { language: {
|
|
309
|
+
inputs: {
|
|
310
|
+
image: declared ? true : "unknown",
|
|
311
|
+
audio: declared ? false : "unknown"
|
|
312
|
+
},
|
|
313
|
+
objectGeneration: declared ? true : "unknown",
|
|
314
|
+
tools: {
|
|
315
|
+
usage: declared ? true : "unknown",
|
|
316
|
+
streaming: declared ? true : "unknown",
|
|
317
|
+
forcedChoice: runtime.forcedToolUse,
|
|
318
|
+
computerUse: declared ? true : "unknown",
|
|
319
|
+
webSearch: declared ? true : "unknown",
|
|
320
|
+
toolSearch: documented?.toolSearch ?? "unknown"
|
|
321
|
+
},
|
|
322
|
+
reasoning: {
|
|
323
|
+
support: reasoningSupport,
|
|
324
|
+
efforts: runtime.xhighEffort ? [
|
|
325
|
+
"low",
|
|
326
|
+
"medium",
|
|
327
|
+
"high",
|
|
328
|
+
"xhigh",
|
|
329
|
+
"max"
|
|
330
|
+
] : void 0,
|
|
331
|
+
adaptive: runtime.adaptiveThinking,
|
|
332
|
+
budget: runtime.budgetThinking,
|
|
333
|
+
canDisable: runtime.thinkingCanBeDisabled,
|
|
334
|
+
canDisableAboveHighEffort: runtime.thinkingCanBeDisabledAboveHighEffort,
|
|
335
|
+
supportsXhighEffort: runtime.xhighEffort,
|
|
336
|
+
betweenTools: runtime.betweenToolsThinking
|
|
337
|
+
},
|
|
338
|
+
sampling: {
|
|
339
|
+
temperature: samplingSupport,
|
|
340
|
+
topP: samplingSupport,
|
|
341
|
+
topK: samplingSupport,
|
|
342
|
+
logprobs: false
|
|
343
|
+
},
|
|
344
|
+
structuredOutput: { native: runtime.nativeStructuredOutput },
|
|
345
|
+
compaction: documented?.compaction ?? "unknown"
|
|
346
|
+
} },
|
|
347
|
+
providerOptions: { language: declareProviderOptions(anthropicProviderOptions.language, declared ? true : "unknown", {
|
|
348
|
+
thinking: reasoningSupport,
|
|
349
|
+
effort: documented?.effort ?? "unknown",
|
|
350
|
+
speed: declared ? modelId === "claude-opus-4-6" : "unknown",
|
|
351
|
+
taskBudget: modelId === "claude-opus-4-7" ? true : "unknown"
|
|
352
|
+
}) },
|
|
353
|
+
requestConfig: { language: {
|
|
354
|
+
maxOutputTokens: runtime.maxOutputTokens,
|
|
355
|
+
knownModel: runtime.knownModel
|
|
356
|
+
} }
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
/** Applies one default support value to every option, except the listed ones. */
|
|
360
|
+
function declareProviderOptions(definitions, support, exceptions) {
|
|
361
|
+
return Object.fromEntries(Object.keys(definitions).map((option) => [option, exceptions[option] ?? support]));
|
|
362
|
+
}
|
|
363
|
+
function resolveRuntimeDefinition(modelId) {
|
|
364
|
+
const rule = runtimeRules.find((rule) => rule.matches(modelId));
|
|
365
|
+
if (rule != null) return rule.definition;
|
|
366
|
+
return modelId.includes("claude-") ? defineRuntime({
|
|
367
|
+
...currentClaudeWithoutSampling,
|
|
368
|
+
thinkingCanBeDisabledAboveHighEffort: false,
|
|
369
|
+
knownModel: false
|
|
370
|
+
}) : defineRuntime({ knownModel: false });
|
|
371
|
+
}
|
|
372
|
+
/** Compatibility projection for the provider's existing request preparation. */
|
|
373
|
+
function getAnthropicModelCapabilities(modelId) {
|
|
374
|
+
const { capabilities: { language }, requestConfig: { language: requestConfig } } = getAnthropicLanguageModelEntry(modelId);
|
|
375
|
+
return {
|
|
376
|
+
maxOutputTokens: requestConfig.maxOutputTokens,
|
|
377
|
+
supportsStructuredOutput: language.structuredOutput.native,
|
|
378
|
+
supportsAdaptiveThinking: language.reasoning.adaptive,
|
|
379
|
+
rejectsSamplingParameters: language.sampling.temperature !== true,
|
|
380
|
+
supportsXhighEffort: language.reasoning.supportsXhighEffort,
|
|
381
|
+
rejectsThinkingDisabledAboveHighEffort: !language.reasoning.canDisableAboveHighEffort,
|
|
382
|
+
rejectsThinkingDisabled: !language.reasoning.canDisable,
|
|
383
|
+
rejectsBudgetThinking: !language.reasoning.budget,
|
|
384
|
+
rejectsForcedToolUse: !language.tools.forcedChoice,
|
|
385
|
+
supportsBetweenToolsThinking: language.reasoning.betweenTools,
|
|
386
|
+
isKnownModel: requestConfig.knownModel
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
66
390
|
//#region src/map-anthropic-citation.ts
|
|
67
391
|
function mapAnthropicCitation(citation, documents) {
|
|
68
392
|
if (citation.type === "web_search_result_location" || citation.type === "search_result_location") {
|
|
@@ -3615,7 +3939,7 @@ var AnthropicLanguageModel = class AnthropicLanguageModel {
|
|
|
3615
3939
|
}) : null;
|
|
3616
3940
|
const usedCustomProviderKey = customProviderOptions != null;
|
|
3617
3941
|
const anthropicOptions = Object.assign({}, canonicalOptions ?? {}, customProviderOptions ?? {});
|
|
3618
|
-
const { maxOutputTokens: maxOutputTokensForModel, supportsStructuredOutput: modelSupportsStructuredOutput, supportsAdaptiveThinking, rejectsSamplingParameters, supportsXhighEffort, rejectsThinkingDisabledAboveHighEffort, rejectsThinkingDisabled, rejectsBudgetThinking, rejectsForcedToolUse, supportsBetweenToolsThinking, isKnownModel } =
|
|
3942
|
+
const { maxOutputTokens: maxOutputTokensForModel, supportsStructuredOutput: modelSupportsStructuredOutput, supportsAdaptiveThinking, rejectsSamplingParameters, supportsXhighEffort, rejectsThinkingDisabledAboveHighEffort, rejectsThinkingDisabled, rejectsBudgetThinking, rejectsForcedToolUse, supportsBetweenToolsThinking, isKnownModel } = getAnthropicModelCapabilities(modelId);
|
|
3619
3943
|
if (!isKnownModel && maxOutputTokens == null) warnings.push({
|
|
3620
3944
|
type: "compatibility",
|
|
3621
3945
|
feature: "maxOutputTokens",
|
|
@@ -5305,222 +5629,6 @@ var AnthropicLanguageModel = class AnthropicLanguageModel {
|
|
|
5305
5629
|
};
|
|
5306
5630
|
}
|
|
5307
5631
|
};
|
|
5308
|
-
/**
|
|
5309
|
-
* Returns the capabilities of a Claude model that are used for defaults and feature selection.
|
|
5310
|
-
*
|
|
5311
|
-
* @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
|
|
5312
|
-
* @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
5313
|
-
*/
|
|
5314
|
-
function getModelCapabilities(modelId) {
|
|
5315
|
-
if (modelId.includes("claude-sonnet-5-5")) return {
|
|
5316
|
-
maxOutputTokens: 128e3,
|
|
5317
|
-
supportsStructuredOutput: true,
|
|
5318
|
-
supportsAdaptiveThinking: true,
|
|
5319
|
-
rejectsSamplingParameters: true,
|
|
5320
|
-
supportsXhighEffort: true,
|
|
5321
|
-
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5322
|
-
rejectsThinkingDisabled: true,
|
|
5323
|
-
rejectsBudgetThinking: true,
|
|
5324
|
-
rejectsForcedToolUse: true,
|
|
5325
|
-
supportsBetweenToolsThinking: true,
|
|
5326
|
-
isKnownModel: true
|
|
5327
|
-
};
|
|
5328
|
-
else if (modelId.includes("claude-opus-5-5")) return {
|
|
5329
|
-
maxOutputTokens: 128e3,
|
|
5330
|
-
supportsStructuredOutput: true,
|
|
5331
|
-
supportsAdaptiveThinking: true,
|
|
5332
|
-
rejectsSamplingParameters: true,
|
|
5333
|
-
supportsXhighEffort: true,
|
|
5334
|
-
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5335
|
-
rejectsThinkingDisabled: true,
|
|
5336
|
-
rejectsBudgetThinking: true,
|
|
5337
|
-
rejectsForcedToolUse: true,
|
|
5338
|
-
supportsBetweenToolsThinking: false,
|
|
5339
|
-
isKnownModel: true
|
|
5340
|
-
};
|
|
5341
|
-
else if (modelId.includes("claude-haiku-5-5")) return {
|
|
5342
|
-
maxOutputTokens: 128e3,
|
|
5343
|
-
supportsStructuredOutput: true,
|
|
5344
|
-
supportsAdaptiveThinking: true,
|
|
5345
|
-
rejectsSamplingParameters: true,
|
|
5346
|
-
supportsXhighEffort: true,
|
|
5347
|
-
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5348
|
-
rejectsThinkingDisabled: false,
|
|
5349
|
-
rejectsBudgetThinking: true,
|
|
5350
|
-
rejectsForcedToolUse: false,
|
|
5351
|
-
supportsBetweenToolsThinking: false,
|
|
5352
|
-
isKnownModel: true
|
|
5353
|
-
};
|
|
5354
|
-
else if (modelId.includes("claude-opus-5")) return {
|
|
5355
|
-
maxOutputTokens: 128e3,
|
|
5356
|
-
supportsStructuredOutput: true,
|
|
5357
|
-
supportsAdaptiveThinking: true,
|
|
5358
|
-
rejectsSamplingParameters: true,
|
|
5359
|
-
supportsXhighEffort: true,
|
|
5360
|
-
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5361
|
-
rejectsThinkingDisabled: false,
|
|
5362
|
-
rejectsBudgetThinking: false,
|
|
5363
|
-
rejectsForcedToolUse: false,
|
|
5364
|
-
supportsBetweenToolsThinking: false,
|
|
5365
|
-
isKnownModel: true
|
|
5366
|
-
};
|
|
5367
|
-
else if (modelId.includes("claude-fable-5-1")) return {
|
|
5368
|
-
maxOutputTokens: 128e3,
|
|
5369
|
-
supportsStructuredOutput: true,
|
|
5370
|
-
supportsAdaptiveThinking: true,
|
|
5371
|
-
rejectsSamplingParameters: true,
|
|
5372
|
-
supportsXhighEffort: true,
|
|
5373
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5374
|
-
rejectsThinkingDisabled: true,
|
|
5375
|
-
rejectsBudgetThinking: true,
|
|
5376
|
-
rejectsForcedToolUse: true,
|
|
5377
|
-
supportsBetweenToolsThinking: false,
|
|
5378
|
-
isKnownModel: true
|
|
5379
|
-
};
|
|
5380
|
-
else if (modelId.includes("claude-fable-5")) return {
|
|
5381
|
-
maxOutputTokens: 128e3,
|
|
5382
|
-
supportsStructuredOutput: true,
|
|
5383
|
-
supportsAdaptiveThinking: true,
|
|
5384
|
-
rejectsSamplingParameters: true,
|
|
5385
|
-
supportsXhighEffort: true,
|
|
5386
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5387
|
-
rejectsThinkingDisabled: true,
|
|
5388
|
-
rejectsBudgetThinking: true,
|
|
5389
|
-
rejectsForcedToolUse: false,
|
|
5390
|
-
supportsBetweenToolsThinking: false,
|
|
5391
|
-
isKnownModel: true
|
|
5392
|
-
};
|
|
5393
|
-
else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) return {
|
|
5394
|
-
maxOutputTokens: 128e3,
|
|
5395
|
-
supportsStructuredOutput: true,
|
|
5396
|
-
supportsAdaptiveThinking: true,
|
|
5397
|
-
rejectsSamplingParameters: true,
|
|
5398
|
-
supportsXhighEffort: true,
|
|
5399
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5400
|
-
rejectsThinkingDisabled: false,
|
|
5401
|
-
rejectsBudgetThinking: false,
|
|
5402
|
-
rejectsForcedToolUse: false,
|
|
5403
|
-
supportsBetweenToolsThinking: false,
|
|
5404
|
-
isKnownModel: true
|
|
5405
|
-
};
|
|
5406
|
-
else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) return {
|
|
5407
|
-
maxOutputTokens: 128e3,
|
|
5408
|
-
supportsStructuredOutput: true,
|
|
5409
|
-
supportsAdaptiveThinking: true,
|
|
5410
|
-
rejectsSamplingParameters: false,
|
|
5411
|
-
supportsXhighEffort: false,
|
|
5412
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5413
|
-
rejectsThinkingDisabled: false,
|
|
5414
|
-
rejectsBudgetThinking: false,
|
|
5415
|
-
rejectsForcedToolUse: false,
|
|
5416
|
-
supportsBetweenToolsThinking: false,
|
|
5417
|
-
isKnownModel: true
|
|
5418
|
-
};
|
|
5419
|
-
else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) return {
|
|
5420
|
-
maxOutputTokens: 64e3,
|
|
5421
|
-
supportsStructuredOutput: true,
|
|
5422
|
-
supportsAdaptiveThinking: false,
|
|
5423
|
-
rejectsSamplingParameters: false,
|
|
5424
|
-
supportsXhighEffort: false,
|
|
5425
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5426
|
-
rejectsThinkingDisabled: false,
|
|
5427
|
-
rejectsBudgetThinking: false,
|
|
5428
|
-
rejectsForcedToolUse: false,
|
|
5429
|
-
supportsBetweenToolsThinking: false,
|
|
5430
|
-
isKnownModel: true
|
|
5431
|
-
};
|
|
5432
|
-
else if (modelId.includes("claude-opus-4-1")) return {
|
|
5433
|
-
maxOutputTokens: 32e3,
|
|
5434
|
-
supportsStructuredOutput: true,
|
|
5435
|
-
supportsAdaptiveThinking: false,
|
|
5436
|
-
rejectsSamplingParameters: false,
|
|
5437
|
-
supportsXhighEffort: false,
|
|
5438
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5439
|
-
rejectsThinkingDisabled: false,
|
|
5440
|
-
rejectsBudgetThinking: false,
|
|
5441
|
-
rejectsForcedToolUse: false,
|
|
5442
|
-
supportsBetweenToolsThinking: false,
|
|
5443
|
-
isKnownModel: true
|
|
5444
|
-
};
|
|
5445
|
-
else if (/claude-sonnet-4(?:-|@)/.test(modelId)) return {
|
|
5446
|
-
maxOutputTokens: 64e3,
|
|
5447
|
-
supportsStructuredOutput: false,
|
|
5448
|
-
supportsAdaptiveThinking: false,
|
|
5449
|
-
rejectsSamplingParameters: false,
|
|
5450
|
-
supportsXhighEffort: false,
|
|
5451
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5452
|
-
rejectsThinkingDisabled: false,
|
|
5453
|
-
rejectsBudgetThinking: false,
|
|
5454
|
-
rejectsForcedToolUse: false,
|
|
5455
|
-
supportsBetweenToolsThinking: false,
|
|
5456
|
-
isKnownModel: true
|
|
5457
|
-
};
|
|
5458
|
-
else if (/claude-opus-4(?:-|@)/.test(modelId)) return {
|
|
5459
|
-
maxOutputTokens: 32e3,
|
|
5460
|
-
supportsStructuredOutput: false,
|
|
5461
|
-
supportsAdaptiveThinking: false,
|
|
5462
|
-
rejectsSamplingParameters: false,
|
|
5463
|
-
supportsXhighEffort: false,
|
|
5464
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5465
|
-
rejectsThinkingDisabled: false,
|
|
5466
|
-
rejectsBudgetThinking: false,
|
|
5467
|
-
rejectsForcedToolUse: false,
|
|
5468
|
-
supportsBetweenToolsThinking: false,
|
|
5469
|
-
isKnownModel: true
|
|
5470
|
-
};
|
|
5471
|
-
else if (modelId.includes("claude-3-haiku")) return {
|
|
5472
|
-
maxOutputTokens: 4096,
|
|
5473
|
-
supportsStructuredOutput: false,
|
|
5474
|
-
supportsAdaptiveThinking: false,
|
|
5475
|
-
rejectsSamplingParameters: false,
|
|
5476
|
-
supportsXhighEffort: false,
|
|
5477
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5478
|
-
rejectsThinkingDisabled: false,
|
|
5479
|
-
rejectsBudgetThinking: false,
|
|
5480
|
-
rejectsForcedToolUse: false,
|
|
5481
|
-
supportsBetweenToolsThinking: false,
|
|
5482
|
-
isKnownModel: true
|
|
5483
|
-
};
|
|
5484
|
-
else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) return {
|
|
5485
|
-
maxOutputTokens: 4096,
|
|
5486
|
-
supportsStructuredOutput: false,
|
|
5487
|
-
supportsAdaptiveThinking: false,
|
|
5488
|
-
rejectsSamplingParameters: false,
|
|
5489
|
-
supportsXhighEffort: false,
|
|
5490
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5491
|
-
rejectsThinkingDisabled: false,
|
|
5492
|
-
rejectsBudgetThinking: false,
|
|
5493
|
-
rejectsForcedToolUse: false,
|
|
5494
|
-
supportsBetweenToolsThinking: false,
|
|
5495
|
-
isKnownModel: false
|
|
5496
|
-
};
|
|
5497
|
-
else if (modelId.includes("claude-")) return {
|
|
5498
|
-
maxOutputTokens: 128e3,
|
|
5499
|
-
supportsStructuredOutput: true,
|
|
5500
|
-
supportsAdaptiveThinking: true,
|
|
5501
|
-
rejectsSamplingParameters: true,
|
|
5502
|
-
supportsXhighEffort: true,
|
|
5503
|
-
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5504
|
-
rejectsThinkingDisabled: false,
|
|
5505
|
-
rejectsBudgetThinking: false,
|
|
5506
|
-
rejectsForcedToolUse: false,
|
|
5507
|
-
supportsBetweenToolsThinking: false,
|
|
5508
|
-
isKnownModel: false
|
|
5509
|
-
};
|
|
5510
|
-
else return {
|
|
5511
|
-
maxOutputTokens: 4096,
|
|
5512
|
-
supportsStructuredOutput: false,
|
|
5513
|
-
supportsAdaptiveThinking: false,
|
|
5514
|
-
rejectsSamplingParameters: false,
|
|
5515
|
-
supportsXhighEffort: false,
|
|
5516
|
-
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5517
|
-
rejectsThinkingDisabled: false,
|
|
5518
|
-
rejectsBudgetThinking: false,
|
|
5519
|
-
rejectsForcedToolUse: false,
|
|
5520
|
-
supportsBetweenToolsThinking: false,
|
|
5521
|
-
isKnownModel: false
|
|
5522
|
-
};
|
|
5523
|
-
}
|
|
5524
5632
|
function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
5525
5633
|
if (!tools) return false;
|
|
5526
5634
|
let hasDynamicFilteringWebTool = false;
|
|
@@ -6293,6 +6401,6 @@ var AnthropicSkills = class {
|
|
|
6293
6401
|
}
|
|
6294
6402
|
};
|
|
6295
6403
|
//#endregion
|
|
6296
|
-
export { AnthropicFiles, AnthropicLanguageModel, AnthropicLanguageModel as AnthropicMessagesLanguageModel, AnthropicSkills, anthropicTools, getModelCapabilities, prepareTools, sanitizeJsonSchema };
|
|
6404
|
+
export { AnthropicFiles, AnthropicLanguageModel, AnthropicLanguageModel as AnthropicMessagesLanguageModel, AnthropicSkills, anthropicTools, getAnthropicModelCapabilities as getModelCapabilities, prepareTools, sanitizeJsonSchema };
|
|
6297
6405
|
|
|
6298
6406
|
//# sourceMappingURL=index.js.map
|