@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/src/model-meta.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AnthropicAdaptiveOnlyThinkingOptions,
|
|
3
|
+
AnthropicAdaptiveOrDisabledThinkingOptions,
|
|
4
|
+
AnthropicAdaptiveThinkingOptions,
|
|
2
5
|
AnthropicContainerOptions,
|
|
3
6
|
AnthropicContextManagementOptions,
|
|
4
7
|
AnthropicMCPOptions,
|
|
8
|
+
AnthropicMaxTokensOptions,
|
|
9
|
+
AnthropicOutputConfigOptions,
|
|
5
10
|
AnthropicSamplingOptions,
|
|
6
11
|
AnthropicServiceTierOptions,
|
|
7
12
|
AnthropicStopSequencesOptions,
|
|
@@ -57,6 +62,8 @@ interface ModelMeta<
|
|
|
57
62
|
messageCapabilities?: TMessageCapabilities
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
// Claude Opus 4.6 accepts adaptive thinking alongside the deprecated
|
|
66
|
+
// budget-based extended thinking, and still accepts sampling parameters.
|
|
60
67
|
const CLAUDE_OPUS_4_6 = {
|
|
61
68
|
name: 'claude-opus-4-6',
|
|
62
69
|
id: 'claude-opus-4-6',
|
|
@@ -74,6 +81,7 @@ const CLAUDE_OPUS_4_6 = {
|
|
|
74
81
|
supports: {
|
|
75
82
|
input: ['text', 'image', 'document'],
|
|
76
83
|
extended_thinking: true,
|
|
84
|
+
adaptive_thinking: true,
|
|
77
85
|
priority_tier: true,
|
|
78
86
|
tools: [
|
|
79
87
|
'web_search',
|
|
@@ -91,7 +99,7 @@ const CLAUDE_OPUS_4_6 = {
|
|
|
91
99
|
AnthropicMCPOptions &
|
|
92
100
|
AnthropicServiceTierOptions &
|
|
93
101
|
AnthropicStopSequencesOptions &
|
|
94
|
-
|
|
102
|
+
AnthropicAdaptiveThinkingOptions &
|
|
95
103
|
AnthropicToolChoiceOptions &
|
|
96
104
|
AnthropicSamplingOptions
|
|
97
105
|
>
|
|
@@ -135,6 +143,8 @@ const CLAUDE_OPUS_4_5 = {
|
|
|
135
143
|
AnthropicSamplingOptions
|
|
136
144
|
>
|
|
137
145
|
|
|
146
|
+
// Claude Sonnet 4.6 accepts adaptive thinking alongside the deprecated
|
|
147
|
+
// budget-based extended thinking, and still accepts sampling parameters.
|
|
138
148
|
const CLAUDE_SONNET_4_6 = {
|
|
139
149
|
name: 'claude-sonnet-4-6',
|
|
140
150
|
id: 'claude-sonnet-4-6',
|
|
@@ -170,7 +180,7 @@ const CLAUDE_SONNET_4_6 = {
|
|
|
170
180
|
AnthropicMCPOptions &
|
|
171
181
|
AnthropicServiceTierOptions &
|
|
172
182
|
AnthropicStopSequencesOptions &
|
|
173
|
-
|
|
183
|
+
AnthropicAdaptiveThinkingOptions &
|
|
174
184
|
AnthropicToolChoiceOptions &
|
|
175
185
|
AnthropicSamplingOptions
|
|
176
186
|
>
|
|
@@ -292,276 +302,18 @@ const CLAUDE_OPUS_4_1 = {
|
|
|
292
302
|
AnthropicSamplingOptions
|
|
293
303
|
>
|
|
294
304
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
context_window: 200_000,
|
|
299
|
-
max_output_tokens: 64_000,
|
|
300
|
-
knowledge_cutoff: '2025-05-14',
|
|
301
|
-
pricing: {
|
|
302
|
-
input: {
|
|
303
|
-
normal: 3,
|
|
304
|
-
},
|
|
305
|
-
output: {
|
|
306
|
-
normal: 15,
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
supports: {
|
|
310
|
-
input: ['text', 'image', 'document'],
|
|
311
|
-
extended_thinking: true,
|
|
312
|
-
priority_tier: true,
|
|
313
|
-
tools: [
|
|
314
|
-
'web_search',
|
|
315
|
-
'web_fetch',
|
|
316
|
-
'code_execution',
|
|
317
|
-
'computer_use',
|
|
318
|
-
'bash',
|
|
319
|
-
'text_editor',
|
|
320
|
-
'memory',
|
|
321
|
-
],
|
|
322
|
-
},
|
|
323
|
-
} as const satisfies ModelMeta<
|
|
324
|
-
AnthropicContainerOptions &
|
|
325
|
-
AnthropicContextManagementOptions &
|
|
326
|
-
AnthropicMCPOptions &
|
|
327
|
-
AnthropicServiceTierOptions &
|
|
328
|
-
AnthropicStopSequencesOptions &
|
|
329
|
-
AnthropicThinkingOptions &
|
|
330
|
-
AnthropicToolChoiceOptions &
|
|
331
|
-
AnthropicSamplingOptions
|
|
332
|
-
>
|
|
333
|
-
|
|
334
|
-
const CLAUDE_SONNET_3_7 = {
|
|
335
|
-
name: 'claude-sonnet-3-7',
|
|
336
|
-
id: 'claude-3-7-sonnet',
|
|
337
|
-
max_output_tokens: 64_000,
|
|
338
|
-
knowledge_cutoff: '2025-05-14',
|
|
339
|
-
pricing: {
|
|
340
|
-
input: {
|
|
341
|
-
normal: 3,
|
|
342
|
-
},
|
|
343
|
-
output: {
|
|
344
|
-
normal: 15,
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
supports: {
|
|
348
|
-
input: ['text', 'image', 'document'],
|
|
349
|
-
extended_thinking: true,
|
|
350
|
-
priority_tier: true,
|
|
351
|
-
tools: [
|
|
352
|
-
'web_search',
|
|
353
|
-
'web_fetch',
|
|
354
|
-
'code_execution',
|
|
355
|
-
'computer_use',
|
|
356
|
-
'bash',
|
|
357
|
-
'text_editor',
|
|
358
|
-
'memory',
|
|
359
|
-
],
|
|
360
|
-
},
|
|
361
|
-
} as const satisfies ModelMeta<
|
|
362
|
-
AnthropicContainerOptions &
|
|
363
|
-
AnthropicContextManagementOptions &
|
|
364
|
-
AnthropicMCPOptions &
|
|
365
|
-
AnthropicServiceTierOptions &
|
|
366
|
-
AnthropicStopSequencesOptions &
|
|
367
|
-
AnthropicThinkingOptions &
|
|
368
|
-
AnthropicToolChoiceOptions &
|
|
369
|
-
AnthropicSamplingOptions
|
|
370
|
-
>
|
|
371
|
-
|
|
372
|
-
const CLAUDE_OPUS_4 = {
|
|
373
|
-
name: 'claude-opus-4',
|
|
374
|
-
id: 'claude-opus-4',
|
|
375
|
-
context_window: 200_000,
|
|
376
|
-
max_output_tokens: 32_000,
|
|
377
|
-
knowledge_cutoff: '2025-05-14',
|
|
378
|
-
pricing: {
|
|
379
|
-
input: {
|
|
380
|
-
normal: 15,
|
|
381
|
-
},
|
|
382
|
-
output: {
|
|
383
|
-
normal: 75,
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
supports: {
|
|
387
|
-
input: ['text', 'image', 'document'],
|
|
388
|
-
extended_thinking: true,
|
|
389
|
-
priority_tier: true,
|
|
390
|
-
tools: [
|
|
391
|
-
'web_search',
|
|
392
|
-
'web_fetch',
|
|
393
|
-
'code_execution',
|
|
394
|
-
'computer_use',
|
|
395
|
-
'bash',
|
|
396
|
-
'text_editor',
|
|
397
|
-
'memory',
|
|
398
|
-
],
|
|
399
|
-
},
|
|
400
|
-
} as const satisfies ModelMeta<
|
|
401
|
-
AnthropicContainerOptions &
|
|
402
|
-
AnthropicContextManagementOptions &
|
|
403
|
-
AnthropicMCPOptions &
|
|
404
|
-
AnthropicServiceTierOptions &
|
|
405
|
-
AnthropicStopSequencesOptions &
|
|
406
|
-
AnthropicThinkingOptions &
|
|
407
|
-
AnthropicToolChoiceOptions &
|
|
408
|
-
AnthropicSamplingOptions
|
|
409
|
-
>
|
|
410
|
-
|
|
411
|
-
const CLAUDE_HAIKU_3_5 = {
|
|
412
|
-
name: 'claude-haiku-3-5',
|
|
413
|
-
id: 'claude-3-5-haiku',
|
|
414
|
-
context_window: 200_000,
|
|
415
|
-
max_output_tokens: 8_000,
|
|
416
|
-
knowledge_cutoff: '2025-10-22',
|
|
417
|
-
pricing: {
|
|
418
|
-
input: {
|
|
419
|
-
normal: 0.8,
|
|
420
|
-
},
|
|
421
|
-
output: {
|
|
422
|
-
normal: 4,
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
supports: {
|
|
426
|
-
input: ['text', 'image', 'document'],
|
|
427
|
-
extended_thinking: false,
|
|
428
|
-
priority_tier: true,
|
|
429
|
-
tools: ['web_search', 'web_fetch'],
|
|
430
|
-
},
|
|
431
|
-
} as const satisfies ModelMeta<
|
|
432
|
-
AnthropicContainerOptions &
|
|
433
|
-
AnthropicContextManagementOptions &
|
|
434
|
-
AnthropicMCPOptions &
|
|
435
|
-
AnthropicServiceTierOptions &
|
|
436
|
-
AnthropicStopSequencesOptions &
|
|
437
|
-
AnthropicThinkingOptions &
|
|
438
|
-
AnthropicToolChoiceOptions &
|
|
439
|
-
AnthropicSamplingOptions
|
|
440
|
-
>
|
|
441
|
-
|
|
442
|
-
const CLAUDE_HAIKU_3 = {
|
|
443
|
-
name: 'claude-haiku-3',
|
|
444
|
-
id: 'claude-3-haiku',
|
|
445
|
-
context_window: 200_000,
|
|
446
|
-
max_output_tokens: 4_000,
|
|
447
|
-
knowledge_cutoff: '2024-03-07',
|
|
448
|
-
pricing: {
|
|
449
|
-
input: {
|
|
450
|
-
normal: 0.25,
|
|
451
|
-
},
|
|
452
|
-
output: {
|
|
453
|
-
normal: 1.25,
|
|
454
|
-
},
|
|
455
|
-
},
|
|
456
|
-
supports: {
|
|
457
|
-
input: ['text', 'image', 'document'],
|
|
458
|
-
extended_thinking: false,
|
|
459
|
-
priority_tier: false,
|
|
460
|
-
tools: ['web_search'],
|
|
461
|
-
},
|
|
462
|
-
} as const satisfies ModelMeta<
|
|
463
|
-
AnthropicContainerOptions &
|
|
464
|
-
AnthropicContextManagementOptions &
|
|
465
|
-
AnthropicMCPOptions &
|
|
466
|
-
AnthropicServiceTierOptions &
|
|
467
|
-
AnthropicStopSequencesOptions &
|
|
468
|
-
AnthropicThinkingOptions &
|
|
469
|
-
AnthropicToolChoiceOptions &
|
|
470
|
-
AnthropicSamplingOptions
|
|
471
|
-
>
|
|
472
|
-
|
|
473
|
-
/* const ANTHROPIC_MODEL_META = {
|
|
474
|
-
[CLAUDE_OPUS_4_5.name]: CLAUDE_OPUS_4_5,
|
|
475
|
-
[CLAUDE_SONNET_4_5.name]: CLAUDE_SONNET_4_5,
|
|
476
|
-
[CLAUDE_HAIKU_4_5.name]: CLAUDE_HAIKU_4_5,
|
|
477
|
-
[CLAUDE_OPUS_4_1.name]: CLAUDE_OPUS_4_1,
|
|
478
|
-
[CLAUDE_SONNET_4.name]: CLAUDE_SONNET_4,
|
|
479
|
-
[CLAUDE_SONNET_3_7.name]: CLAUDE_SONNET_3_7,
|
|
480
|
-
[CLAUDE_OPUS_4.name]: CLAUDE_OPUS_4,
|
|
481
|
-
[CLAUDE_HAIKU_3_5.name]: CLAUDE_HAIKU_3_5,
|
|
482
|
-
[CLAUDE_HAIKU_3.name]: CLAUDE_HAIKU_3,
|
|
483
|
-
} as const */
|
|
484
|
-
|
|
485
|
-
/* export type AnthropicModelProviderOptions<
|
|
486
|
-
TModel extends keyof AnthropicModelMetaMap,
|
|
487
|
-
> =
|
|
488
|
-
AnthropicModelMetaMap[TModel] extends ModelMeta<
|
|
489
|
-
infer TProviderOptions,
|
|
490
|
-
any,
|
|
491
|
-
any
|
|
492
|
-
>
|
|
493
|
-
? TProviderOptions
|
|
494
|
-
: unknown */
|
|
495
|
-
|
|
496
|
-
/* export type AnthropicModelToolCapabilities<
|
|
497
|
-
TModel extends keyof AnthropicModelMetaMap,
|
|
498
|
-
> =
|
|
499
|
-
AnthropicModelMetaMap[TModel] extends ModelMeta<
|
|
500
|
-
any,
|
|
501
|
-
infer TToolCapabilities,
|
|
502
|
-
any
|
|
503
|
-
>
|
|
504
|
-
? TToolCapabilities
|
|
505
|
-
: unknown
|
|
506
|
-
*/
|
|
507
|
-
/* export type AnthropicModelMessageCapabilities<
|
|
508
|
-
TModel extends keyof AnthropicModelMetaMap,
|
|
509
|
-
> =
|
|
510
|
-
AnthropicModelMetaMap[TModel] extends ModelMeta<
|
|
511
|
-
any,
|
|
512
|
-
any,
|
|
513
|
-
infer TMessageCapabilities
|
|
514
|
-
>
|
|
515
|
-
? TMessageCapabilities
|
|
516
|
-
: unknown */
|
|
517
|
-
|
|
518
|
-
const CLAUDE_OPUS_4_6_FAST = {
|
|
519
|
-
name: 'claude-opus-4-6-fast',
|
|
520
|
-
id: 'claude-opus-4-6-fast',
|
|
521
|
-
context_window: 1_000_000,
|
|
522
|
-
max_output_tokens: 128_000,
|
|
523
|
-
supports: {
|
|
524
|
-
input: ['text', 'image'],
|
|
525
|
-
extended_thinking: true,
|
|
526
|
-
priority_tier: true,
|
|
527
|
-
tools: [
|
|
528
|
-
'web_search',
|
|
529
|
-
'web_fetch',
|
|
530
|
-
'code_execution',
|
|
531
|
-
'computer_use',
|
|
532
|
-
'bash',
|
|
533
|
-
'text_editor',
|
|
534
|
-
'memory',
|
|
535
|
-
],
|
|
536
|
-
},
|
|
537
|
-
pricing: {
|
|
538
|
-
input: {
|
|
539
|
-
normal: 30,
|
|
540
|
-
cached: 3,
|
|
541
|
-
},
|
|
542
|
-
output: {
|
|
543
|
-
normal: 150,
|
|
544
|
-
},
|
|
545
|
-
},
|
|
546
|
-
} as const satisfies ModelMeta<
|
|
547
|
-
AnthropicContainerOptions &
|
|
548
|
-
AnthropicContextManagementOptions &
|
|
549
|
-
AnthropicMCPOptions &
|
|
550
|
-
AnthropicServiceTierOptions &
|
|
551
|
-
AnthropicStopSequencesOptions &
|
|
552
|
-
AnthropicThinkingOptions &
|
|
553
|
-
AnthropicToolChoiceOptions &
|
|
554
|
-
AnthropicSamplingOptions
|
|
555
|
-
>
|
|
556
|
-
|
|
305
|
+
// Claude Opus 4.7 removed budget-based extended thinking and the sampling
|
|
306
|
+
// parameters (`temperature`, `top_p`, `top_k`) — sending either returns a
|
|
307
|
+
// 400. Use adaptive thinking with `output_config.effort` instead.
|
|
557
308
|
const CLAUDE_OPUS_4_7 = {
|
|
558
309
|
name: 'claude-opus-4-7',
|
|
559
310
|
id: 'claude-opus-4-7',
|
|
560
311
|
context_window: 1_000_000,
|
|
561
312
|
max_output_tokens: 128_000,
|
|
562
313
|
supports: {
|
|
563
|
-
input: ['text', 'image'],
|
|
564
|
-
extended_thinking:
|
|
314
|
+
input: ['text', 'image', 'document'],
|
|
315
|
+
extended_thinking: false,
|
|
316
|
+
adaptive_thinking: true,
|
|
565
317
|
priority_tier: true,
|
|
566
318
|
tools: [
|
|
567
319
|
'web_search',
|
|
@@ -588,19 +340,23 @@ const CLAUDE_OPUS_4_7 = {
|
|
|
588
340
|
AnthropicMCPOptions &
|
|
589
341
|
AnthropicServiceTierOptions &
|
|
590
342
|
AnthropicStopSequencesOptions &
|
|
591
|
-
|
|
343
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
592
344
|
AnthropicToolChoiceOptions &
|
|
593
|
-
|
|
345
|
+
AnthropicMaxTokensOptions &
|
|
346
|
+
AnthropicOutputConfigOptions
|
|
594
347
|
>
|
|
595
348
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
349
|
+
// Claude Opus 4.8 keeps the same request surface as Opus 4.7: adaptive
|
|
350
|
+
// thinking only (budget_tokens 400s), no sampling parameters.
|
|
351
|
+
const CLAUDE_OPUS_4_8 = {
|
|
352
|
+
name: 'claude-opus-4-8',
|
|
353
|
+
id: 'claude-opus-4-8',
|
|
599
354
|
context_window: 1_000_000,
|
|
600
355
|
max_output_tokens: 128_000,
|
|
601
356
|
supports: {
|
|
602
357
|
input: ['text', 'image', 'document'],
|
|
603
|
-
extended_thinking:
|
|
358
|
+
extended_thinking: false,
|
|
359
|
+
adaptive_thinking: true,
|
|
604
360
|
priority_tier: true,
|
|
605
361
|
tools: [
|
|
606
362
|
'web_search',
|
|
@@ -614,11 +370,11 @@ const CLAUDE_OPUS_4_7_FAST = {
|
|
|
614
370
|
},
|
|
615
371
|
pricing: {
|
|
616
372
|
input: {
|
|
617
|
-
normal:
|
|
618
|
-
cached:
|
|
373
|
+
normal: 5,
|
|
374
|
+
cached: 0.5,
|
|
619
375
|
},
|
|
620
376
|
output: {
|
|
621
|
-
normal:
|
|
377
|
+
normal: 25,
|
|
622
378
|
},
|
|
623
379
|
},
|
|
624
380
|
} as const satisfies ModelMeta<
|
|
@@ -627,19 +383,26 @@ const CLAUDE_OPUS_4_7_FAST = {
|
|
|
627
383
|
AnthropicMCPOptions &
|
|
628
384
|
AnthropicServiceTierOptions &
|
|
629
385
|
AnthropicStopSequencesOptions &
|
|
630
|
-
|
|
386
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
631
387
|
AnthropicToolChoiceOptions &
|
|
632
|
-
|
|
388
|
+
AnthropicMaxTokensOptions &
|
|
389
|
+
AnthropicOutputConfigOptions
|
|
633
390
|
>
|
|
634
391
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
392
|
+
// Claude Fable 5: thinking is always on — the only accepted explicit
|
|
393
|
+
// `thinking` config is `{type: 'adaptive'}` (disabled/budget_tokens 400),
|
|
394
|
+
// and the sampling parameters (`temperature`, `top_p`, `top_k`) are
|
|
395
|
+
// rejected. Its provider options therefore use the adaptive-only thinking
|
|
396
|
+
// shape and `max_tokens` without the sampling knobs.
|
|
397
|
+
const CLAUDE_FABLE_5 = {
|
|
398
|
+
name: 'claude-fable-5',
|
|
399
|
+
id: 'claude-fable-5',
|
|
638
400
|
context_window: 1_000_000,
|
|
639
401
|
max_output_tokens: 128_000,
|
|
640
402
|
supports: {
|
|
641
403
|
input: ['text', 'image', 'document'],
|
|
642
|
-
extended_thinking:
|
|
404
|
+
extended_thinking: false,
|
|
405
|
+
adaptive_thinking: true,
|
|
643
406
|
priority_tier: true,
|
|
644
407
|
tools: [
|
|
645
408
|
'web_search',
|
|
@@ -653,11 +416,11 @@ const CLAUDE_OPUS_4_8 = {
|
|
|
653
416
|
},
|
|
654
417
|
pricing: {
|
|
655
418
|
input: {
|
|
656
|
-
normal:
|
|
657
|
-
cached:
|
|
419
|
+
normal: 10,
|
|
420
|
+
cached: 1,
|
|
658
421
|
},
|
|
659
422
|
output: {
|
|
660
|
-
normal:
|
|
423
|
+
normal: 50,
|
|
661
424
|
},
|
|
662
425
|
},
|
|
663
426
|
} as const satisfies ModelMeta<
|
|
@@ -666,19 +429,27 @@ const CLAUDE_OPUS_4_8 = {
|
|
|
666
429
|
AnthropicMCPOptions &
|
|
667
430
|
AnthropicServiceTierOptions &
|
|
668
431
|
AnthropicStopSequencesOptions &
|
|
669
|
-
|
|
432
|
+
AnthropicAdaptiveOnlyThinkingOptions &
|
|
670
433
|
AnthropicToolChoiceOptions &
|
|
671
|
-
|
|
434
|
+
AnthropicMaxTokensOptions &
|
|
435
|
+
AnthropicOutputConfigOptions
|
|
672
436
|
>
|
|
673
437
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
438
|
+
// Claude Sonnet 5: adaptive thinking is the default (omitting `thinking`
|
|
439
|
+
// runs adaptive); `{type: 'disabled'}` opts out, but the manual
|
|
440
|
+
// `{type: 'enabled', budget_tokens}` shape and non-default sampling
|
|
441
|
+
// parameters (`temperature`, `top_p`, `top_k`) are rejected with a 400.
|
|
442
|
+
// Pricing below is the sticker $3/$15 per MTok (an introductory $2/$10
|
|
443
|
+
// applies through 2026-08-31).
|
|
444
|
+
const CLAUDE_SONNET_5 = {
|
|
445
|
+
name: 'claude-sonnet-5',
|
|
446
|
+
id: 'claude-sonnet-5',
|
|
677
447
|
context_window: 1_000_000,
|
|
678
448
|
max_output_tokens: 128_000,
|
|
679
449
|
supports: {
|
|
680
450
|
input: ['text', 'image', 'document'],
|
|
681
|
-
extended_thinking:
|
|
451
|
+
extended_thinking: false,
|
|
452
|
+
adaptive_thinking: true,
|
|
682
453
|
priority_tier: true,
|
|
683
454
|
tools: [
|
|
684
455
|
'web_search',
|
|
@@ -692,11 +463,11 @@ const CLAUDE_OPUS_4_8_FAST = {
|
|
|
692
463
|
},
|
|
693
464
|
pricing: {
|
|
694
465
|
input: {
|
|
695
|
-
normal:
|
|
696
|
-
cached:
|
|
466
|
+
normal: 3,
|
|
467
|
+
cached: 0.3,
|
|
697
468
|
},
|
|
698
469
|
output: {
|
|
699
|
-
normal:
|
|
470
|
+
normal: 15,
|
|
700
471
|
},
|
|
701
472
|
},
|
|
702
473
|
} as const satisfies ModelMeta<
|
|
@@ -705,11 +476,21 @@ const CLAUDE_OPUS_4_8_FAST = {
|
|
|
705
476
|
AnthropicMCPOptions &
|
|
706
477
|
AnthropicServiceTierOptions &
|
|
707
478
|
AnthropicStopSequencesOptions &
|
|
708
|
-
|
|
479
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
709
480
|
AnthropicToolChoiceOptions &
|
|
710
|
-
|
|
481
|
+
AnthropicMaxTokensOptions &
|
|
482
|
+
AnthropicOutputConfigOptions
|
|
711
483
|
>
|
|
712
484
|
|
|
485
|
+
/**
|
|
486
|
+
* Model ids accepted by the Anthropic text adapter.
|
|
487
|
+
*
|
|
488
|
+
* Every id here resolves against the first-party Anthropic API
|
|
489
|
+
* (`GET /v1/models/{id}`). Retired models (Claude 3.x, Sonnet 3.7,
|
|
490
|
+
* Opus 4 / Sonnet 4) and the `-fast` variant ids (fast mode is requested
|
|
491
|
+
* via the `speed` parameter, not a model id) were removed after Anthropic
|
|
492
|
+
* turned them off.
|
|
493
|
+
*/
|
|
713
494
|
export const ANTHROPIC_MODELS = [
|
|
714
495
|
CLAUDE_OPUS_4_6.id,
|
|
715
496
|
CLAUDE_OPUS_4_5.id,
|
|
@@ -717,20 +498,12 @@ export const ANTHROPIC_MODELS = [
|
|
|
717
498
|
CLAUDE_SONNET_4_5.id,
|
|
718
499
|
CLAUDE_HAIKU_4_5.id,
|
|
719
500
|
CLAUDE_OPUS_4_1.id,
|
|
720
|
-
CLAUDE_SONNET_4.id,
|
|
721
|
-
CLAUDE_SONNET_3_7.id,
|
|
722
|
-
CLAUDE_OPUS_4.id,
|
|
723
|
-
CLAUDE_HAIKU_3_5.id,
|
|
724
|
-
CLAUDE_HAIKU_3.id,
|
|
725
|
-
|
|
726
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
727
501
|
|
|
728
502
|
CLAUDE_OPUS_4_7.id,
|
|
729
|
-
|
|
730
|
-
CLAUDE_OPUS_4_7_FAST.id,
|
|
731
|
-
|
|
732
503
|
CLAUDE_OPUS_4_8.id,
|
|
733
|
-
|
|
504
|
+
|
|
505
|
+
CLAUDE_FABLE_5.id,
|
|
506
|
+
CLAUDE_SONNET_5.id,
|
|
734
507
|
] as const
|
|
735
508
|
|
|
736
509
|
/**
|
|
@@ -743,9 +516,10 @@ export const ANTHROPIC_MODELS = [
|
|
|
743
516
|
export const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
744
517
|
CLAUDE_OPUS_4_5.id,
|
|
745
518
|
CLAUDE_OPUS_4_6.id,
|
|
746
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
747
519
|
CLAUDE_OPUS_4_7.id,
|
|
748
|
-
|
|
520
|
+
CLAUDE_OPUS_4_8.id,
|
|
521
|
+
CLAUDE_FABLE_5.id,
|
|
522
|
+
CLAUDE_SONNET_5.id,
|
|
749
523
|
CLAUDE_SONNET_4_5.id,
|
|
750
524
|
CLAUDE_SONNET_4_6.id,
|
|
751
525
|
CLAUDE_HAIKU_4_5.id,
|
|
@@ -756,29 +530,32 @@ export const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
|
756
530
|
// const ANTHROPIC_AUDIO_MODELS = [] as const
|
|
757
531
|
// const ANTHROPIC_VIDEO_MODELS = [] as const
|
|
758
532
|
|
|
759
|
-
/* type AnthropicModel = (typeof ANTHROPIC_MODELS)[number] */
|
|
760
533
|
export type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]
|
|
761
534
|
// Manual type map for per-model provider options
|
|
762
|
-
// Models are differentiated by
|
|
535
|
+
// Models are differentiated by which thinking shapes and sampling
|
|
536
|
+
// parameters the API accepts.
|
|
763
537
|
export type AnthropicChatModelProviderOptionsByName = {
|
|
764
|
-
//
|
|
538
|
+
// 4.6 generation: adaptive thinking plus the deprecated budget-based
|
|
539
|
+
// shape; sampling parameters still accepted.
|
|
765
540
|
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &
|
|
766
541
|
AnthropicContextManagementOptions &
|
|
767
542
|
AnthropicMCPOptions &
|
|
768
543
|
AnthropicServiceTierOptions &
|
|
769
544
|
AnthropicStopSequencesOptions &
|
|
770
|
-
|
|
545
|
+
AnthropicAdaptiveThinkingOptions &
|
|
771
546
|
AnthropicToolChoiceOptions &
|
|
772
547
|
AnthropicSamplingOptions
|
|
773
|
-
[
|
|
548
|
+
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &
|
|
774
549
|
AnthropicContextManagementOptions &
|
|
775
550
|
AnthropicMCPOptions &
|
|
776
551
|
AnthropicServiceTierOptions &
|
|
777
552
|
AnthropicStopSequencesOptions &
|
|
778
|
-
|
|
553
|
+
AnthropicAdaptiveThinkingOptions &
|
|
779
554
|
AnthropicToolChoiceOptions &
|
|
780
555
|
AnthropicSamplingOptions
|
|
781
|
-
|
|
556
|
+
|
|
557
|
+
// Pre-4.6 models: budget-based extended thinking and sampling parameters.
|
|
558
|
+
[CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &
|
|
782
559
|
AnthropicContextManagementOptions &
|
|
783
560
|
AnthropicMCPOptions &
|
|
784
561
|
AnthropicServiceTierOptions &
|
|
@@ -810,87 +587,51 @@ export type AnthropicChatModelProviderOptionsByName = {
|
|
|
810
587
|
AnthropicThinkingOptions &
|
|
811
588
|
AnthropicToolChoiceOptions &
|
|
812
589
|
AnthropicSamplingOptions
|
|
813
|
-
[CLAUDE_SONNET_4.id]: AnthropicContainerOptions &
|
|
814
|
-
AnthropicContextManagementOptions &
|
|
815
|
-
AnthropicMCPOptions &
|
|
816
|
-
AnthropicServiceTierOptions &
|
|
817
|
-
AnthropicStopSequencesOptions &
|
|
818
|
-
AnthropicThinkingOptions &
|
|
819
|
-
AnthropicToolChoiceOptions &
|
|
820
|
-
AnthropicSamplingOptions
|
|
821
|
-
[CLAUDE_SONNET_3_7.id]: AnthropicContainerOptions &
|
|
822
|
-
AnthropicContextManagementOptions &
|
|
823
|
-
AnthropicMCPOptions &
|
|
824
|
-
AnthropicServiceTierOptions &
|
|
825
|
-
AnthropicStopSequencesOptions &
|
|
826
|
-
AnthropicThinkingOptions &
|
|
827
|
-
AnthropicToolChoiceOptions &
|
|
828
|
-
AnthropicSamplingOptions
|
|
829
|
-
[CLAUDE_OPUS_4.id]: AnthropicContainerOptions &
|
|
830
|
-
AnthropicContextManagementOptions &
|
|
831
|
-
AnthropicMCPOptions &
|
|
832
|
-
AnthropicServiceTierOptions &
|
|
833
|
-
AnthropicStopSequencesOptions &
|
|
834
|
-
AnthropicThinkingOptions &
|
|
835
|
-
AnthropicToolChoiceOptions &
|
|
836
|
-
AnthropicSamplingOptions
|
|
837
|
-
|
|
838
|
-
// Model with priority_tier but NO extended_thinking
|
|
839
|
-
[CLAUDE_HAIKU_3_5.id]: AnthropicContainerOptions &
|
|
840
|
-
AnthropicContextManagementOptions &
|
|
841
|
-
AnthropicMCPOptions &
|
|
842
|
-
AnthropicServiceTierOptions &
|
|
843
|
-
AnthropicStopSequencesOptions &
|
|
844
|
-
AnthropicToolChoiceOptions &
|
|
845
|
-
AnthropicSamplingOptions
|
|
846
590
|
|
|
847
|
-
//
|
|
848
|
-
|
|
849
|
-
AnthropicContextManagementOptions &
|
|
850
|
-
AnthropicMCPOptions &
|
|
851
|
-
AnthropicStopSequencesOptions &
|
|
852
|
-
AnthropicToolChoiceOptions &
|
|
853
|
-
AnthropicSamplingOptions
|
|
854
|
-
[CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions &
|
|
855
|
-
AnthropicContextManagementOptions &
|
|
856
|
-
AnthropicMCPOptions &
|
|
857
|
-
AnthropicServiceTierOptions &
|
|
858
|
-
AnthropicStopSequencesOptions &
|
|
859
|
-
AnthropicThinkingOptions &
|
|
860
|
-
AnthropicToolChoiceOptions &
|
|
861
|
-
AnthropicSamplingOptions
|
|
591
|
+
// Opus 4.7/4.8: adaptive thinking (or explicit disable), no
|
|
592
|
+
// budget_tokens, no sampling parameters — see the constants above.
|
|
862
593
|
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &
|
|
863
594
|
AnthropicContextManagementOptions &
|
|
864
595
|
AnthropicMCPOptions &
|
|
865
596
|
AnthropicServiceTierOptions &
|
|
866
597
|
AnthropicStopSequencesOptions &
|
|
867
|
-
|
|
598
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
868
599
|
AnthropicToolChoiceOptions &
|
|
869
|
-
|
|
870
|
-
|
|
600
|
+
AnthropicMaxTokensOptions &
|
|
601
|
+
AnthropicOutputConfigOptions
|
|
602
|
+
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions &
|
|
871
603
|
AnthropicContextManagementOptions &
|
|
872
604
|
AnthropicMCPOptions &
|
|
873
605
|
AnthropicServiceTierOptions &
|
|
874
606
|
AnthropicStopSequencesOptions &
|
|
875
|
-
|
|
607
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
876
608
|
AnthropicToolChoiceOptions &
|
|
877
|
-
|
|
878
|
-
|
|
609
|
+
AnthropicMaxTokensOptions &
|
|
610
|
+
AnthropicOutputConfigOptions
|
|
611
|
+
|
|
612
|
+
// Claude Fable 5: thinking always on (adaptive-only config); sampling
|
|
613
|
+
// parameters removed — see the CLAUDE_FABLE_5 constant above.
|
|
614
|
+
[CLAUDE_FABLE_5.id]: AnthropicContainerOptions &
|
|
879
615
|
AnthropicContextManagementOptions &
|
|
880
616
|
AnthropicMCPOptions &
|
|
881
617
|
AnthropicServiceTierOptions &
|
|
882
618
|
AnthropicStopSequencesOptions &
|
|
883
|
-
|
|
619
|
+
AnthropicAdaptiveOnlyThinkingOptions &
|
|
884
620
|
AnthropicToolChoiceOptions &
|
|
885
|
-
|
|
886
|
-
|
|
621
|
+
AnthropicMaxTokensOptions &
|
|
622
|
+
AnthropicOutputConfigOptions
|
|
623
|
+
// Claude Sonnet 5: adaptive thinking by default, explicit disable
|
|
624
|
+
// allowed; no budget_tokens, no sampling parameters — see the
|
|
625
|
+
// CLAUDE_SONNET_5 constant above.
|
|
626
|
+
[CLAUDE_SONNET_5.id]: AnthropicContainerOptions &
|
|
887
627
|
AnthropicContextManagementOptions &
|
|
888
628
|
AnthropicMCPOptions &
|
|
889
629
|
AnthropicServiceTierOptions &
|
|
890
630
|
AnthropicStopSequencesOptions &
|
|
891
|
-
|
|
631
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
892
632
|
AnthropicToolChoiceOptions &
|
|
893
|
-
|
|
633
|
+
AnthropicMaxTokensOptions &
|
|
634
|
+
AnthropicOutputConfigOptions
|
|
894
635
|
}
|
|
895
636
|
|
|
896
637
|
export type AnthropicChatModelToolCapabilitiesByName = {
|
|
@@ -900,13 +641,10 @@ export type AnthropicChatModelToolCapabilitiesByName = {
|
|
|
900
641
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools
|
|
901
642
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools
|
|
902
643
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools
|
|
903
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools
|
|
904
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools
|
|
905
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools
|
|
906
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools
|
|
907
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools
|
|
908
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools
|
|
909
644
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools
|
|
645
|
+
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.tools
|
|
646
|
+
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.tools
|
|
647
|
+
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.tools
|
|
910
648
|
}
|
|
911
649
|
|
|
912
650
|
/**
|
|
@@ -927,14 +665,8 @@ export type AnthropicModelInputModalitiesByName = {
|
|
|
927
665
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input
|
|
928
666
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input
|
|
929
667
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input
|
|
930
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input
|
|
931
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input
|
|
932
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input
|
|
933
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input
|
|
934
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input
|
|
935
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input
|
|
936
668
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input
|
|
937
|
-
[CLAUDE_OPUS_4_7_FAST.id]: typeof CLAUDE_OPUS_4_7_FAST.supports.input
|
|
938
669
|
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input
|
|
939
|
-
[
|
|
670
|
+
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input
|
|
671
|
+
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input
|
|
940
672
|
}
|