@tanstack/ai-anthropic 0.15.12 → 0.16.0
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/dist/esm/adapters/summarize.d.ts +2 -2
- package/dist/esm/adapters/summarize.js.map +1 -1
- package/dist/esm/adapters/text.js +90 -0
- package/dist/esm/adapters/text.js.map +1 -1
- package/dist/esm/model-meta.d.ts +50 -176
- package/dist/esm/model-meta.js +11 -34
- package/dist/esm/model-meta.js.map +1 -1
- package/dist/esm/text/text-provider-options.d.ts +65 -2
- package/dist/esm/text/text-provider-options.js.map +1 -1
- package/package.json +3 -3
- package/src/adapters/summarize.ts +2 -2
- package/src/adapters/text.ts +165 -0
- package/src/model-meta.ts +120 -388
- package/src/text/text-provider-options.ts +70 -2
package/dist/esm/model-meta.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnthropicContainerOptions, AnthropicContextManagementOptions, AnthropicMCPOptions, AnthropicSamplingOptions, AnthropicServiceTierOptions, AnthropicStopSequencesOptions, AnthropicThinkingOptions, AnthropicToolChoiceOptions } from './text/text-provider-options.js';
|
|
1
|
+
import { AnthropicAdaptiveOnlyThinkingOptions, AnthropicAdaptiveOrDisabledThinkingOptions, AnthropicAdaptiveThinkingOptions, AnthropicContainerOptions, AnthropicContextManagementOptions, AnthropicMCPOptions, AnthropicMaxTokensOptions, AnthropicOutputConfigOptions, AnthropicSamplingOptions, AnthropicServiceTierOptions, AnthropicStopSequencesOptions, AnthropicThinkingOptions, AnthropicToolChoiceOptions } from './text/text-provider-options.js';
|
|
2
2
|
declare const CLAUDE_OPUS_4_6: {
|
|
3
3
|
readonly name: "claude-opus-4-6";
|
|
4
4
|
readonly id: "claude-opus-4-6";
|
|
@@ -16,6 +16,7 @@ declare const CLAUDE_OPUS_4_6: {
|
|
|
16
16
|
readonly supports: {
|
|
17
17
|
readonly input: ["text", "image", "document"];
|
|
18
18
|
readonly extended_thinking: true;
|
|
19
|
+
readonly adaptive_thinking: true;
|
|
19
20
|
readonly priority_tier: true;
|
|
20
21
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
21
22
|
};
|
|
@@ -126,139 +127,15 @@ declare const CLAUDE_OPUS_4_1: {
|
|
|
126
127
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
127
128
|
};
|
|
128
129
|
};
|
|
129
|
-
declare const CLAUDE_SONNET_4: {
|
|
130
|
-
readonly name: "claude-sonnet-4";
|
|
131
|
-
readonly id: "claude-sonnet-4";
|
|
132
|
-
readonly context_window: 200000;
|
|
133
|
-
readonly max_output_tokens: 64000;
|
|
134
|
-
readonly knowledge_cutoff: "2025-05-14";
|
|
135
|
-
readonly pricing: {
|
|
136
|
-
readonly input: {
|
|
137
|
-
readonly normal: 3;
|
|
138
|
-
};
|
|
139
|
-
readonly output: {
|
|
140
|
-
readonly normal: 15;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
readonly supports: {
|
|
144
|
-
readonly input: ["text", "image", "document"];
|
|
145
|
-
readonly extended_thinking: true;
|
|
146
|
-
readonly priority_tier: true;
|
|
147
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
declare const CLAUDE_SONNET_3_7: {
|
|
151
|
-
readonly name: "claude-sonnet-3-7";
|
|
152
|
-
readonly id: "claude-3-7-sonnet";
|
|
153
|
-
readonly max_output_tokens: 64000;
|
|
154
|
-
readonly knowledge_cutoff: "2025-05-14";
|
|
155
|
-
readonly pricing: {
|
|
156
|
-
readonly input: {
|
|
157
|
-
readonly normal: 3;
|
|
158
|
-
};
|
|
159
|
-
readonly output: {
|
|
160
|
-
readonly normal: 15;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
readonly supports: {
|
|
164
|
-
readonly input: ["text", "image", "document"];
|
|
165
|
-
readonly extended_thinking: true;
|
|
166
|
-
readonly priority_tier: true;
|
|
167
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
declare const CLAUDE_OPUS_4: {
|
|
171
|
-
readonly name: "claude-opus-4";
|
|
172
|
-
readonly id: "claude-opus-4";
|
|
173
|
-
readonly context_window: 200000;
|
|
174
|
-
readonly max_output_tokens: 32000;
|
|
175
|
-
readonly knowledge_cutoff: "2025-05-14";
|
|
176
|
-
readonly pricing: {
|
|
177
|
-
readonly input: {
|
|
178
|
-
readonly normal: 15;
|
|
179
|
-
};
|
|
180
|
-
readonly output: {
|
|
181
|
-
readonly normal: 75;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
readonly supports: {
|
|
185
|
-
readonly input: ["text", "image", "document"];
|
|
186
|
-
readonly extended_thinking: true;
|
|
187
|
-
readonly priority_tier: true;
|
|
188
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
declare const CLAUDE_HAIKU_3_5: {
|
|
192
|
-
readonly name: "claude-haiku-3-5";
|
|
193
|
-
readonly id: "claude-3-5-haiku";
|
|
194
|
-
readonly context_window: 200000;
|
|
195
|
-
readonly max_output_tokens: 8000;
|
|
196
|
-
readonly knowledge_cutoff: "2025-10-22";
|
|
197
|
-
readonly pricing: {
|
|
198
|
-
readonly input: {
|
|
199
|
-
readonly normal: 0.8;
|
|
200
|
-
};
|
|
201
|
-
readonly output: {
|
|
202
|
-
readonly normal: 4;
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
readonly supports: {
|
|
206
|
-
readonly input: ["text", "image", "document"];
|
|
207
|
-
readonly extended_thinking: false;
|
|
208
|
-
readonly priority_tier: true;
|
|
209
|
-
readonly tools: ["web_search", "web_fetch"];
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
declare const CLAUDE_HAIKU_3: {
|
|
213
|
-
readonly name: "claude-haiku-3";
|
|
214
|
-
readonly id: "claude-3-haiku";
|
|
215
|
-
readonly context_window: 200000;
|
|
216
|
-
readonly max_output_tokens: 4000;
|
|
217
|
-
readonly knowledge_cutoff: "2024-03-07";
|
|
218
|
-
readonly pricing: {
|
|
219
|
-
readonly input: {
|
|
220
|
-
readonly normal: 0.25;
|
|
221
|
-
};
|
|
222
|
-
readonly output: {
|
|
223
|
-
readonly normal: 1.25;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
readonly supports: {
|
|
227
|
-
readonly input: ["text", "image", "document"];
|
|
228
|
-
readonly extended_thinking: false;
|
|
229
|
-
readonly priority_tier: false;
|
|
230
|
-
readonly tools: ["web_search"];
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
declare const CLAUDE_OPUS_4_6_FAST: {
|
|
234
|
-
readonly name: "claude-opus-4-6-fast";
|
|
235
|
-
readonly id: "claude-opus-4-6-fast";
|
|
236
|
-
readonly context_window: 1000000;
|
|
237
|
-
readonly max_output_tokens: 128000;
|
|
238
|
-
readonly supports: {
|
|
239
|
-
readonly input: ["text", "image"];
|
|
240
|
-
readonly extended_thinking: true;
|
|
241
|
-
readonly priority_tier: true;
|
|
242
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
243
|
-
};
|
|
244
|
-
readonly pricing: {
|
|
245
|
-
readonly input: {
|
|
246
|
-
readonly normal: 30;
|
|
247
|
-
readonly cached: 3;
|
|
248
|
-
};
|
|
249
|
-
readonly output: {
|
|
250
|
-
readonly normal: 150;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
130
|
declare const CLAUDE_OPUS_4_7: {
|
|
255
131
|
readonly name: "claude-opus-4-7";
|
|
256
132
|
readonly id: "claude-opus-4-7";
|
|
257
133
|
readonly context_window: 1000000;
|
|
258
134
|
readonly max_output_tokens: 128000;
|
|
259
135
|
readonly supports: {
|
|
260
|
-
readonly input: ["text", "image"];
|
|
261
|
-
readonly extended_thinking:
|
|
136
|
+
readonly input: ["text", "image", "document"];
|
|
137
|
+
readonly extended_thinking: false;
|
|
138
|
+
readonly adaptive_thinking: true;
|
|
262
139
|
readonly priority_tier: true;
|
|
263
140
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
264
141
|
};
|
|
@@ -272,70 +149,82 @@ declare const CLAUDE_OPUS_4_7: {
|
|
|
272
149
|
};
|
|
273
150
|
};
|
|
274
151
|
};
|
|
275
|
-
declare const
|
|
276
|
-
readonly name: "claude-opus-4-
|
|
277
|
-
readonly id: "claude-opus-4-
|
|
152
|
+
declare const CLAUDE_OPUS_4_8: {
|
|
153
|
+
readonly name: "claude-opus-4-8";
|
|
154
|
+
readonly id: "claude-opus-4-8";
|
|
278
155
|
readonly context_window: 1000000;
|
|
279
156
|
readonly max_output_tokens: 128000;
|
|
280
157
|
readonly supports: {
|
|
281
158
|
readonly input: ["text", "image", "document"];
|
|
282
|
-
readonly extended_thinking:
|
|
159
|
+
readonly extended_thinking: false;
|
|
160
|
+
readonly adaptive_thinking: true;
|
|
283
161
|
readonly priority_tier: true;
|
|
284
162
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
285
163
|
};
|
|
286
164
|
readonly pricing: {
|
|
287
165
|
readonly input: {
|
|
288
|
-
readonly normal:
|
|
289
|
-
readonly cached:
|
|
166
|
+
readonly normal: 5;
|
|
167
|
+
readonly cached: 0.5;
|
|
290
168
|
};
|
|
291
169
|
readonly output: {
|
|
292
|
-
readonly normal:
|
|
170
|
+
readonly normal: 25;
|
|
293
171
|
};
|
|
294
172
|
};
|
|
295
173
|
};
|
|
296
|
-
declare const
|
|
297
|
-
readonly name: "claude-
|
|
298
|
-
readonly id: "claude-
|
|
174
|
+
declare const CLAUDE_FABLE_5: {
|
|
175
|
+
readonly name: "claude-fable-5";
|
|
176
|
+
readonly id: "claude-fable-5";
|
|
299
177
|
readonly context_window: 1000000;
|
|
300
178
|
readonly max_output_tokens: 128000;
|
|
301
179
|
readonly supports: {
|
|
302
180
|
readonly input: ["text", "image", "document"];
|
|
303
|
-
readonly extended_thinking:
|
|
181
|
+
readonly extended_thinking: false;
|
|
182
|
+
readonly adaptive_thinking: true;
|
|
304
183
|
readonly priority_tier: true;
|
|
305
184
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
306
185
|
};
|
|
307
186
|
readonly pricing: {
|
|
308
187
|
readonly input: {
|
|
309
|
-
readonly normal:
|
|
310
|
-
readonly cached:
|
|
188
|
+
readonly normal: 10;
|
|
189
|
+
readonly cached: 1;
|
|
311
190
|
};
|
|
312
191
|
readonly output: {
|
|
313
|
-
readonly normal:
|
|
192
|
+
readonly normal: 50;
|
|
314
193
|
};
|
|
315
194
|
};
|
|
316
195
|
};
|
|
317
|
-
declare const
|
|
318
|
-
readonly name: "claude-
|
|
319
|
-
readonly id: "claude-
|
|
196
|
+
declare const CLAUDE_SONNET_5: {
|
|
197
|
+
readonly name: "claude-sonnet-5";
|
|
198
|
+
readonly id: "claude-sonnet-5";
|
|
320
199
|
readonly context_window: 1000000;
|
|
321
200
|
readonly max_output_tokens: 128000;
|
|
322
201
|
readonly supports: {
|
|
323
202
|
readonly input: ["text", "image", "document"];
|
|
324
|
-
readonly extended_thinking:
|
|
203
|
+
readonly extended_thinking: false;
|
|
204
|
+
readonly adaptive_thinking: true;
|
|
325
205
|
readonly priority_tier: true;
|
|
326
206
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
327
207
|
};
|
|
328
208
|
readonly pricing: {
|
|
329
209
|
readonly input: {
|
|
330
|
-
readonly normal:
|
|
331
|
-
readonly cached:
|
|
210
|
+
readonly normal: 3;
|
|
211
|
+
readonly cached: 0.3;
|
|
332
212
|
};
|
|
333
213
|
readonly output: {
|
|
334
|
-
readonly normal:
|
|
214
|
+
readonly normal: 15;
|
|
335
215
|
};
|
|
336
216
|
};
|
|
337
217
|
};
|
|
338
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Model ids accepted by the Anthropic text adapter.
|
|
220
|
+
*
|
|
221
|
+
* Every id here resolves against the first-party Anthropic API
|
|
222
|
+
* (`GET /v1/models/{id}`). Retired models (Claude 3.x, Sonnet 3.7,
|
|
223
|
+
* Opus 4 / Sonnet 4) and the `-fast` variant ids (fast mode is requested
|
|
224
|
+
* via the `speed` parameter, not a model id) were removed after Anthropic
|
|
225
|
+
* turned them off.
|
|
226
|
+
*/
|
|
227
|
+
export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-6", "claude-opus-4-5", "claude-sonnet-4-6", "claude-sonnet-4-5", "claude-haiku-4-5", "claude-opus-4-1", "claude-opus-4-7", "claude-opus-4-8", "claude-fable-5", "claude-sonnet-5"];
|
|
339
228
|
/**
|
|
340
229
|
* Anthropic models that support combining `tools` + JSON-Schema-constrained
|
|
341
230
|
* output in a single streaming Messages request (per issue #605). GA'd
|
|
@@ -346,22 +235,16 @@ export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-6", "claude-opus
|
|
|
346
235
|
export declare const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS: Set<string>;
|
|
347
236
|
export type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number];
|
|
348
237
|
export type AnthropicChatModelProviderOptionsByName = {
|
|
349
|
-
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions &
|
|
238
|
+
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
239
|
+
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
350
240
|
[CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
351
|
-
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
352
241
|
[CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
353
242
|
[CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
354
243
|
[CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
355
|
-
[
|
|
356
|
-
[
|
|
357
|
-
[
|
|
358
|
-
[
|
|
359
|
-
[CLAUDE_HAIKU_3.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicStopSequencesOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
360
|
-
[CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
361
|
-
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
362
|
-
[CLAUDE_OPUS_4_7_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
363
|
-
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
364
|
-
[CLAUDE_OPUS_4_8_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
244
|
+
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
245
|
+
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
246
|
+
[CLAUDE_FABLE_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOnlyThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
247
|
+
[CLAUDE_SONNET_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
365
248
|
};
|
|
366
249
|
export type AnthropicChatModelToolCapabilitiesByName = {
|
|
367
250
|
[CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools;
|
|
@@ -370,13 +253,10 @@ export type AnthropicChatModelToolCapabilitiesByName = {
|
|
|
370
253
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools;
|
|
371
254
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools;
|
|
372
255
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools;
|
|
373
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools;
|
|
374
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools;
|
|
375
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools;
|
|
376
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools;
|
|
377
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools;
|
|
378
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools;
|
|
379
256
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools;
|
|
257
|
+
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.tools;
|
|
258
|
+
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.tools;
|
|
259
|
+
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.tools;
|
|
380
260
|
};
|
|
381
261
|
/**
|
|
382
262
|
* Type-only map from chat model name to its supported input modalities.
|
|
@@ -396,15 +276,9 @@ export type AnthropicModelInputModalitiesByName = {
|
|
|
396
276
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input;
|
|
397
277
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input;
|
|
398
278
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input;
|
|
399
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input;
|
|
400
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input;
|
|
401
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input;
|
|
402
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input;
|
|
403
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input;
|
|
404
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input;
|
|
405
279
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input;
|
|
406
|
-
[CLAUDE_OPUS_4_7_FAST.id]: typeof CLAUDE_OPUS_4_7_FAST.supports.input;
|
|
407
280
|
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input;
|
|
408
|
-
[
|
|
281
|
+
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input;
|
|
282
|
+
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input;
|
|
409
283
|
};
|
|
410
284
|
export {};
|
package/dist/esm/model-meta.js
CHANGED
|
@@ -16,35 +16,17 @@ const CLAUDE_HAIKU_4_5 = {
|
|
|
16
16
|
const CLAUDE_OPUS_4_1 = {
|
|
17
17
|
id: "claude-opus-4-1"
|
|
18
18
|
};
|
|
19
|
-
const CLAUDE_SONNET_4 = {
|
|
20
|
-
id: "claude-sonnet-4"
|
|
21
|
-
};
|
|
22
|
-
const CLAUDE_SONNET_3_7 = {
|
|
23
|
-
id: "claude-3-7-sonnet"
|
|
24
|
-
};
|
|
25
|
-
const CLAUDE_OPUS_4 = {
|
|
26
|
-
id: "claude-opus-4"
|
|
27
|
-
};
|
|
28
|
-
const CLAUDE_HAIKU_3_5 = {
|
|
29
|
-
id: "claude-3-5-haiku"
|
|
30
|
-
};
|
|
31
|
-
const CLAUDE_HAIKU_3 = {
|
|
32
|
-
id: "claude-3-haiku"
|
|
33
|
-
};
|
|
34
|
-
const CLAUDE_OPUS_4_6_FAST = {
|
|
35
|
-
id: "claude-opus-4-6-fast"
|
|
36
|
-
};
|
|
37
19
|
const CLAUDE_OPUS_4_7 = {
|
|
38
20
|
id: "claude-opus-4-7"
|
|
39
21
|
};
|
|
40
|
-
const CLAUDE_OPUS_4_7_FAST = {
|
|
41
|
-
id: "claude-opus-4-7-fast"
|
|
42
|
-
};
|
|
43
22
|
const CLAUDE_OPUS_4_8 = {
|
|
44
|
-
id: "claude-opus-4
|
|
23
|
+
id: "claude-opus-4-8"
|
|
45
24
|
};
|
|
46
|
-
const
|
|
47
|
-
id: "claude-
|
|
25
|
+
const CLAUDE_FABLE_5 = {
|
|
26
|
+
id: "claude-fable-5"
|
|
27
|
+
};
|
|
28
|
+
const CLAUDE_SONNET_5 = {
|
|
29
|
+
id: "claude-sonnet-5"
|
|
48
30
|
};
|
|
49
31
|
const ANTHROPIC_MODELS = [
|
|
50
32
|
CLAUDE_OPUS_4_6.id,
|
|
@@ -53,23 +35,18 @@ const ANTHROPIC_MODELS = [
|
|
|
53
35
|
CLAUDE_SONNET_4_5.id,
|
|
54
36
|
CLAUDE_HAIKU_4_5.id,
|
|
55
37
|
CLAUDE_OPUS_4_1.id,
|
|
56
|
-
CLAUDE_SONNET_4.id,
|
|
57
|
-
CLAUDE_SONNET_3_7.id,
|
|
58
|
-
CLAUDE_OPUS_4.id,
|
|
59
|
-
CLAUDE_HAIKU_3_5.id,
|
|
60
|
-
CLAUDE_HAIKU_3.id,
|
|
61
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
62
38
|
CLAUDE_OPUS_4_7.id,
|
|
63
|
-
CLAUDE_OPUS_4_7_FAST.id,
|
|
64
39
|
CLAUDE_OPUS_4_8.id,
|
|
65
|
-
|
|
40
|
+
CLAUDE_FABLE_5.id,
|
|
41
|
+
CLAUDE_SONNET_5.id
|
|
66
42
|
];
|
|
67
43
|
const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = /* @__PURE__ */ new Set([
|
|
68
44
|
CLAUDE_OPUS_4_5.id,
|
|
69
45
|
CLAUDE_OPUS_4_6.id,
|
|
70
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
71
46
|
CLAUDE_OPUS_4_7.id,
|
|
72
|
-
|
|
47
|
+
CLAUDE_OPUS_4_8.id,
|
|
48
|
+
CLAUDE_FABLE_5.id,
|
|
49
|
+
CLAUDE_SONNET_5.id,
|
|
73
50
|
CLAUDE_SONNET_4_5.id,
|
|
74
51
|
CLAUDE_SONNET_4_6.id,
|
|
75
52
|
CLAUDE_HAIKU_4_5.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n AnthropicContainerOptions,\n AnthropicContextManagementOptions,\n AnthropicMCPOptions,\n AnthropicSamplingOptions,\n AnthropicServiceTierOptions,\n AnthropicStopSequencesOptions,\n AnthropicThinkingOptions,\n AnthropicToolChoiceOptions,\n} from './text/text-provider-options'\n\ninterface ModelMeta<\n TProviderOptions = unknown,\n TToolCapabilities = unknown,\n TMessageCapabilities = unknown,\n> {\n name: string\n id: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n extended_thinking?: boolean\n adaptive_thinking?: boolean\n priority_tier?: boolean\n tools?: Array<\n | 'web_search'\n | 'web_fetch'\n | 'code_execution'\n | 'computer_use'\n | 'bash'\n | 'text_editor'\n | 'memory'\n >\n }\n context_window?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n /**\n * Type-level description of which tool capabilities this model supports.\n */\n toolCapabilities?: TToolCapabilities\n /**\n * Type-level description of which message/input capabilities this model supports.\n */\n messageCapabilities?: TMessageCapabilities\n}\n\nconst CLAUDE_OPUS_4_6 = {\n name: 'claude-opus-4-6',\n id: 'claude-opus-4-6',\n context_window: 200_000,\n max_output_tokens: 128_000,\n knowledge_cutoff: '2025-05-01',\n pricing: {\n input: {\n normal: 5,\n },\n output: {\n normal: 25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_5 = {\n name: 'claude-opus-4-5',\n id: 'claude-opus-4-5',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-11-01',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_6 = {\n name: 'claude-sonnet-4-6',\n id: 'claude-sonnet-4-6',\n context_window: 1_000_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-01',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_5 = {\n name: 'claude-sonnet-4-5',\n id: 'claude-sonnet-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-09-29',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_4_5 = {\n name: 'claude-haiku-4-5',\n id: 'claude-haiku-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-10-01',\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 5,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_1 = {\n name: 'claude-opus-4-1',\n id: 'claude-opus-4-1',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-05',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4 = {\n name: 'claude-sonnet-4',\n id: 'claude-sonnet-4',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_3_7 = {\n name: 'claude-sonnet-3-7',\n id: 'claude-3-7-sonnet',\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4 = {\n name: 'claude-opus-4',\n id: 'claude-opus-4',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-05-14',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3_5 = {\n name: 'claude-haiku-3-5',\n id: 'claude-3-5-haiku',\n context_window: 200_000,\n max_output_tokens: 8_000,\n knowledge_cutoff: '2025-10-22',\n pricing: {\n input: {\n normal: 0.8,\n },\n output: {\n normal: 4,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: true,\n tools: ['web_search', 'web_fetch'],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_3 = {\n name: 'claude-haiku-3',\n id: 'claude-3-haiku',\n context_window: 200_000,\n max_output_tokens: 4_000,\n knowledge_cutoff: '2024-03-07',\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n priority_tier: false,\n tools: ['web_search'],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\n/* const ANTHROPIC_MODEL_META = {\n [CLAUDE_OPUS_4_5.name]: CLAUDE_OPUS_4_5,\n [CLAUDE_SONNET_4_5.name]: CLAUDE_SONNET_4_5,\n [CLAUDE_HAIKU_4_5.name]: CLAUDE_HAIKU_4_5,\n [CLAUDE_OPUS_4_1.name]: CLAUDE_OPUS_4_1,\n [CLAUDE_SONNET_4.name]: CLAUDE_SONNET_4,\n [CLAUDE_SONNET_3_7.name]: CLAUDE_SONNET_3_7,\n [CLAUDE_OPUS_4.name]: CLAUDE_OPUS_4,\n [CLAUDE_HAIKU_3_5.name]: CLAUDE_HAIKU_3_5,\n [CLAUDE_HAIKU_3.name]: CLAUDE_HAIKU_3,\n} as const */\n\n/* export type AnthropicModelProviderOptions<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n infer TProviderOptions,\n any,\n any\n >\n ? TProviderOptions\n : unknown */\n\n/* export type AnthropicModelToolCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n infer TToolCapabilities,\n any\n >\n ? TToolCapabilities\n : unknown\n */\n/* export type AnthropicModelMessageCapabilities<\n TModel extends keyof AnthropicModelMetaMap,\n> =\n AnthropicModelMetaMap[TModel] extends ModelMeta<\n any,\n any,\n infer TMessageCapabilities\n >\n ? TMessageCapabilities\n : unknown */\n\nconst CLAUDE_OPUS_4_6_FAST = {\n name: 'claude-opus-4-6-fast',\n id: 'claude-opus-4-6-fast',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 30,\n cached: 3,\n },\n output: {\n normal: 150,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_7 = {\n name: 'claude-opus-4-7',\n id: 'claude-opus-4-7',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_7_FAST = {\n name: 'claude-opus-4-7-fast',\n id: 'claude-opus-4-7-fast',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 30,\n cached: 3,\n },\n output: {\n normal: 150,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_8 = {\n name: 'claude-opus-4.8',\n id: 'claude-opus-4.8',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_8_FAST = {\n name: 'claude-opus-4.8-fast',\n id: 'claude-opus-4.8-fast',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 10,\n cached: 1,\n },\n output: {\n normal: 50,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nexport const ANTHROPIC_MODELS = [\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_HAIKU_4_5.id,\n CLAUDE_OPUS_4_1.id,\n CLAUDE_SONNET_4.id,\n CLAUDE_SONNET_3_7.id,\n CLAUDE_OPUS_4.id,\n CLAUDE_HAIKU_3_5.id,\n CLAUDE_HAIKU_3.id,\n\n CLAUDE_OPUS_4_6_FAST.id,\n\n CLAUDE_OPUS_4_7.id,\n\n CLAUDE_OPUS_4_7_FAST.id,\n\n CLAUDE_OPUS_4_8.id,\n CLAUDE_OPUS_4_8_FAST.id,\n] as const\n\n/**\n * Anthropic models that support combining `tools` + JSON-Schema-constrained\n * output in a single streaming Messages request (per issue #605). GA'd\n * 2026-01-29 for Claude 4.5+ via `output_format` on the beta messages\n * endpoint. Older Claude models still need the forced-tool-use workaround\n * in `structuredOutput`.\n */\nexport const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([\n CLAUDE_OPUS_4_5.id,\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_6_FAST.id,\n CLAUDE_OPUS_4_7.id,\n CLAUDE_OPUS_4_7_FAST.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_HAIKU_4_5.id,\n])\n\n// const ANTHROPIC_IMAGE_MODELS = [] as const\n// const ANTHROPIC_EMBEDDING_MODELS = [] as const\n// const ANTHROPIC_AUDIO_MODELS = [] as const\n// const ANTHROPIC_VIDEO_MODELS = [] as const\n\n/* type AnthropicModel = (typeof ANTHROPIC_MODELS)[number] */\nexport type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]\n// Manual type map for per-model provider options\n// Models are differentiated by extended_thinking and priority_tier support\nexport type AnthropicChatModelProviderOptionsByName = {\n // Models with both extended_thinking and priority_tier\n [CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_3_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with priority_tier but NO extended_thinking\n [CLAUDE_HAIKU_3_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Model with neither extended_thinking nor priority_tier\n [CLAUDE_HAIKU_3.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicStopSequencesOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_7_FAST.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_8_FAST.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n}\n\nexport type AnthropicChatModelToolCapabilitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.tools\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.tools\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools\n [CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools\n [CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools\n [CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools\n [CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools\n [CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools\n [CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * All Anthropic Claude models support text, image, and document (PDF) input.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://docs.anthropic.com/claude/docs/vision\n * @see https://docs.anthropic.com/claude/docs/pdf-support\n */\nexport type AnthropicModelInputModalitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.input\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.input\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.input\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input\n [CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input\n [CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input\n [CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input\n [CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input\n [CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input\n [CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input\n [CLAUDE_OPUS_4_7_FAST.id]: typeof CLAUDE_OPUS_4_7_FAST.supports.input\n [CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input\n [CLAUDE_OPUS_4_8_FAST.id]: typeof CLAUDE_OPUS_4_8_FAST.supports.input\n}\n"],"names":[],"mappings":"AA2DA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA2BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA0BN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAyBN;AAWA,MAAM,gBAAgB;AAAA,EAEpB,IAAI;AA0BN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AAkBN;AAWA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AAkBN;AAwDA,MAAM,uBAAuB;AAAA,EAE3B,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,uBAAuB;AAAA,EAE3B,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAWA,MAAM,uBAAuB;AAAA,EAE3B,IAAI;AA0BN;AAWO,MAAM,mBAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,eAAe;AAAA,EAEf,qBAAqB;AAAA,EAErB,gBAAgB;AAAA,EAEhB,qBAAqB;AAAA,EAErB,gBAAgB;AAAA,EAChB,qBAAqB;AACvB;AASO,MAAM,iEAAiD,IAAY;AAAA,EACxE,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n AnthropicAdaptiveOnlyThinkingOptions,\n AnthropicAdaptiveOrDisabledThinkingOptions,\n AnthropicAdaptiveThinkingOptions,\n AnthropicContainerOptions,\n AnthropicContextManagementOptions,\n AnthropicMCPOptions,\n AnthropicMaxTokensOptions,\n AnthropicOutputConfigOptions,\n AnthropicSamplingOptions,\n AnthropicServiceTierOptions,\n AnthropicStopSequencesOptions,\n AnthropicThinkingOptions,\n AnthropicToolChoiceOptions,\n} from './text/text-provider-options'\n\ninterface ModelMeta<\n TProviderOptions = unknown,\n TToolCapabilities = unknown,\n TMessageCapabilities = unknown,\n> {\n name: string\n id: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n extended_thinking?: boolean\n adaptive_thinking?: boolean\n priority_tier?: boolean\n tools?: Array<\n | 'web_search'\n | 'web_fetch'\n | 'code_execution'\n | 'computer_use'\n | 'bash'\n | 'text_editor'\n | 'memory'\n >\n }\n context_window?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n /**\n * Type-level description of which tool capabilities this model supports.\n */\n toolCapabilities?: TToolCapabilities\n /**\n * Type-level description of which message/input capabilities this model supports.\n */\n messageCapabilities?: TMessageCapabilities\n}\n\n// Claude Opus 4.6 accepts adaptive thinking alongside the deprecated\n// budget-based extended thinking, and still accepts sampling parameters.\nconst CLAUDE_OPUS_4_6 = {\n name: 'claude-opus-4-6',\n id: 'claude-opus-4-6',\n context_window: 200_000,\n max_output_tokens: 128_000,\n knowledge_cutoff: '2025-05-01',\n pricing: {\n input: {\n normal: 5,\n },\n output: {\n normal: 25,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_5 = {\n name: 'claude-opus-4-5',\n id: 'claude-opus-4-5',\n context_window: 200_000,\n max_output_tokens: 32_000,\n knowledge_cutoff: '2025-11-01',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\n// Claude Sonnet 4.6 accepts adaptive thinking alongside the deprecated\n// budget-based extended thinking, and still accepts sampling parameters.\nconst CLAUDE_SONNET_4_6 = {\n name: 'claude-sonnet-4-6',\n id: 'claude-sonnet-4-6',\n context_window: 1_000_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-01',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_SONNET_4_5 = {\n name: 'claude-sonnet-4-5',\n id: 'claude-sonnet-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-09-29',\n pricing: {\n input: {\n normal: 3,\n },\n output: {\n normal: 15,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_HAIKU_4_5 = {\n name: 'claude-haiku-4-5',\n id: 'claude-haiku-4-5',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-10-01',\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 5,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\nconst CLAUDE_OPUS_4_1 = {\n name: 'claude-opus-4-1',\n id: 'claude-opus-4-1',\n context_window: 200_000,\n max_output_tokens: 64_000,\n knowledge_cutoff: '2025-08-05',\n pricing: {\n input: {\n normal: 15,\n },\n output: {\n normal: 75,\n },\n },\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n>\n\n// Claude Opus 4.7 removed budget-based extended thinking and the sampling\n// parameters (`temperature`, `top_p`, `top_k`) — sending either returns a\n// 400. Use adaptive thinking with `output_config.effort` instead.\nconst CLAUDE_OPUS_4_7 = {\n name: 'claude-opus-4-7',\n id: 'claude-opus-4-7',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n>\n\n// Claude Opus 4.8 keeps the same request surface as Opus 4.7: adaptive\n// thinking only (budget_tokens 400s), no sampling parameters.\nconst CLAUDE_OPUS_4_8 = {\n name: 'claude-opus-4-8',\n id: 'claude-opus-4-8',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 5,\n cached: 0.5,\n },\n output: {\n normal: 25,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n>\n\n// Claude Fable 5: thinking is always on — the only accepted explicit\n// `thinking` config is `{type: 'adaptive'}` (disabled/budget_tokens 400),\n// and the sampling parameters (`temperature`, `top_p`, `top_k`) are\n// rejected. Its provider options therefore use the adaptive-only thinking\n// shape and `max_tokens` without the sampling knobs.\nconst CLAUDE_FABLE_5 = {\n name: 'claude-fable-5',\n id: 'claude-fable-5',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 10,\n cached: 1,\n },\n output: {\n normal: 50,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOnlyThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n>\n\n// Claude Sonnet 5: adaptive thinking is the default (omitting `thinking`\n// runs adaptive); `{type: 'disabled'}` opts out, but the manual\n// `{type: 'enabled', budget_tokens}` shape and non-default sampling\n// parameters (`temperature`, `top_p`, `top_k`) are rejected with a 400.\n// Pricing below is the sticker $3/$15 per MTok (an introductory $2/$10\n// applies through 2026-08-31).\nconst CLAUDE_SONNET_5 = {\n name: 'claude-sonnet-5',\n id: 'claude-sonnet-5',\n context_window: 1_000_000,\n max_output_tokens: 128_000,\n supports: {\n input: ['text', 'image', 'document'],\n extended_thinking: false,\n adaptive_thinking: true,\n priority_tier: true,\n tools: [\n 'web_search',\n 'web_fetch',\n 'code_execution',\n 'computer_use',\n 'bash',\n 'text_editor',\n 'memory',\n ],\n },\n pricing: {\n input: {\n normal: 3,\n cached: 0.3,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n>\n\n/**\n * Model ids accepted by the Anthropic text adapter.\n *\n * Every id here resolves against the first-party Anthropic API\n * (`GET /v1/models/{id}`). Retired models (Claude 3.x, Sonnet 3.7,\n * Opus 4 / Sonnet 4) and the `-fast` variant ids (fast mode is requested\n * via the `speed` parameter, not a model id) were removed after Anthropic\n * turned them off.\n */\nexport const ANTHROPIC_MODELS = [\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_HAIKU_4_5.id,\n CLAUDE_OPUS_4_1.id,\n\n CLAUDE_OPUS_4_7.id,\n CLAUDE_OPUS_4_8.id,\n\n CLAUDE_FABLE_5.id,\n CLAUDE_SONNET_5.id,\n] as const\n\n/**\n * Anthropic models that support combining `tools` + JSON-Schema-constrained\n * output in a single streaming Messages request (per issue #605). GA'd\n * 2026-01-29 for Claude 4.5+ via `output_format` on the beta messages\n * endpoint. Older Claude models still need the forced-tool-use workaround\n * in `structuredOutput`.\n */\nexport const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([\n CLAUDE_OPUS_4_5.id,\n CLAUDE_OPUS_4_6.id,\n CLAUDE_OPUS_4_7.id,\n CLAUDE_OPUS_4_8.id,\n CLAUDE_FABLE_5.id,\n CLAUDE_SONNET_5.id,\n CLAUDE_SONNET_4_5.id,\n CLAUDE_SONNET_4_6.id,\n CLAUDE_HAIKU_4_5.id,\n])\n\n// const ANTHROPIC_IMAGE_MODELS = [] as const\n// const ANTHROPIC_EMBEDDING_MODELS = [] as const\n// const ANTHROPIC_AUDIO_MODELS = [] as const\n// const ANTHROPIC_VIDEO_MODELS = [] as const\n\nexport type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]\n// Manual type map for per-model provider options\n// Models are differentiated by which thinking shapes and sampling\n// parameters the API accepts.\nexport type AnthropicChatModelProviderOptionsByName = {\n // 4.6 generation: adaptive thinking plus the deprecated budget-based\n // shape; sampling parameters still accepted.\n [CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Pre-4.6 models: budget-based extended thinking and sampling parameters.\n [CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n\n // Opus 4.7/4.8: adaptive thinking (or explicit disable), no\n // budget_tokens, no sampling parameters — see the constants above.\n [CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n [CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n\n // Claude Fable 5: thinking always on (adaptive-only config); sampling\n // parameters removed — see the CLAUDE_FABLE_5 constant above.\n [CLAUDE_FABLE_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOnlyThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n // Claude Sonnet 5: adaptive thinking by default, explicit disable\n // allowed; no budget_tokens, no sampling parameters — see the\n // CLAUDE_SONNET_5 constant above.\n [CLAUDE_SONNET_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicAdaptiveOrDisabledThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicMaxTokensOptions &\n AnthropicOutputConfigOptions\n}\n\nexport type AnthropicChatModelToolCapabilitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.tools\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.tools\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools\n [CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.tools\n [CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.tools\n [CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.tools\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * All Anthropic Claude models support text, image, and document (PDF) input.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://docs.anthropic.com/claude/docs/vision\n * @see https://docs.anthropic.com/claude/docs/pdf-support\n */\nexport type AnthropicModelInputModalitiesByName = {\n [CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.input\n [CLAUDE_OPUS_4_5.id]: typeof CLAUDE_OPUS_4_5.supports.input\n [CLAUDE_SONNET_4_6.id]: typeof CLAUDE_SONNET_4_6.supports.input\n [CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input\n [CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input\n [CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input\n [CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input\n [CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input\n [CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input\n [CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input\n}\n"],"names":[],"mappings":"AAkEA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA2BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAaA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA2BN;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AA0BN;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA0BN;AAcA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA2BN;AAcA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA2BN;AAiBA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AA2BN;AAkBA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AA2BN;AAqBO,MAAM,mBAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAEhB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAEhB,eAAe;AAAA,EACf,gBAAgB;AAClB;AASO,MAAM,iEAAiD,IAAY;AAAA,EACxE,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,CAAC;"}
|
|
@@ -131,6 +131,65 @@ export interface AnthropicAdaptiveThinkingOptions {
|
|
|
131
131
|
type: 'disabled';
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Thinking configuration for models where thinking is always on
|
|
136
|
+
* (e.g. Claude Fable 5).
|
|
137
|
+
*
|
|
138
|
+
* On these models the only accepted explicit configuration is
|
|
139
|
+
* `{type: 'adaptive'}` — both `{type: 'disabled'}` and
|
|
140
|
+
* `{type: 'enabled', budget_tokens}` are rejected with a 400. Omitting the
|
|
141
|
+
* `thinking` field entirely also runs adaptive thinking.
|
|
142
|
+
*/
|
|
143
|
+
export interface AnthropicAdaptiveOnlyThinkingOptions {
|
|
144
|
+
thinking?: {
|
|
145
|
+
type: 'adaptive';
|
|
146
|
+
/**
|
|
147
|
+
* Controls what (if any) thinking content is streamed back.
|
|
148
|
+
*
|
|
149
|
+
* - `'summarized'`: stream summarized thinking via `thinking_delta`
|
|
150
|
+
* events (the user-visible reasoning text).
|
|
151
|
+
* - `'omitted'` (default): stream the thinking block's
|
|
152
|
+
* `signature_delta` only (no reasoning text reaches the client).
|
|
153
|
+
*/
|
|
154
|
+
display?: 'summarized' | 'omitted';
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Thinking configuration for models that accept adaptive thinking or an
|
|
159
|
+
* explicit opt-out, but no manual token budget (e.g. Claude Sonnet 5,
|
|
160
|
+
* Claude Opus 4.7/4.8).
|
|
161
|
+
*
|
|
162
|
+
* `{type: 'enabled', budget_tokens}` is rejected with a 400 on these
|
|
163
|
+
* models. On Claude Sonnet 5, omitting the `thinking` field runs adaptive
|
|
164
|
+
* thinking by default; on Opus 4.7/4.8 it runs without thinking — set
|
|
165
|
+
* `{type: 'adaptive'}` explicitly there.
|
|
166
|
+
*/
|
|
167
|
+
export interface AnthropicAdaptiveOrDisabledThinkingOptions {
|
|
168
|
+
thinking?: {
|
|
169
|
+
type: 'adaptive';
|
|
170
|
+
/**
|
|
171
|
+
* Controls what (if any) thinking content is streamed back.
|
|
172
|
+
* Defaults to `'omitted'` — set `'summarized'` to receive the
|
|
173
|
+
* reasoning text.
|
|
174
|
+
*/
|
|
175
|
+
display?: 'summarized' | 'omitted';
|
|
176
|
+
} | {
|
|
177
|
+
type: 'disabled';
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* `max_tokens` on its own, for models that reject the sampling parameters
|
|
182
|
+
* (`temperature`, `top_p`, `top_k`) — e.g. Claude Fable 5 and Claude Opus
|
|
183
|
+
* 4.7/4.8 reject them outright, and Claude Sonnet 5 returns a 400 when a
|
|
184
|
+
* non-default sampling value is sent.
|
|
185
|
+
*/
|
|
186
|
+
export interface AnthropicMaxTokensOptions {
|
|
187
|
+
/**
|
|
188
|
+
* The maximum number of tokens to generate before stopping. This parameter only specifies the absolute maximum number of tokens to generate. Required by the API; the adapter defaults to 1024 when omitted.
|
|
189
|
+
* Range x >= 1.
|
|
190
|
+
*/
|
|
191
|
+
max_tokens?: number;
|
|
192
|
+
}
|
|
134
193
|
export interface AnthropicEffortOptions {
|
|
135
194
|
/**
|
|
136
195
|
* Controls the thinking depth for adaptive thinking mode (Opus 4.6+).
|
|
@@ -158,7 +217,11 @@ export interface AnthropicOutputConfigOptions {
|
|
|
158
217
|
* preserved when the engine adds `format`.
|
|
159
218
|
*/
|
|
160
219
|
output_config?: {
|
|
161
|
-
|
|
220
|
+
/**
|
|
221
|
+
* `'xhigh'` is accepted on Claude Opus 4.7+, Claude Sonnet 5, and
|
|
222
|
+
* Claude Fable 5; older models support `'low'`–`'max'` only.
|
|
223
|
+
*/
|
|
224
|
+
effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
162
225
|
};
|
|
163
226
|
}
|
|
164
227
|
export interface AnthropicToolChoiceOptions {
|
|
@@ -233,7 +296,7 @@ export interface InternalTextProviderOptions extends ExternalTextProviderOptions
|
|
|
233
296
|
* cast.
|
|
234
297
|
*/
|
|
235
298
|
output_config?: {
|
|
236
|
-
effort?: 'low' | 'medium' | 'high' | 'max' | null;
|
|
299
|
+
effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
237
300
|
format?: {
|
|
238
301
|
type: 'json_schema';
|
|
239
302
|
schema: Record<string, unknown>;
|