@tanstack/ai-anthropic 0.15.13 → 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 +35 -207
- package/dist/esm/model-meta.js +4 -35
- 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 +99 -466
- 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,58 +340,23 @@ const CLAUDE_OPUS_4_7 = {
|
|
|
588
340
|
AnthropicMCPOptions &
|
|
589
341
|
AnthropicServiceTierOptions &
|
|
590
342
|
AnthropicStopSequencesOptions &
|
|
591
|
-
|
|
592
|
-
AnthropicToolChoiceOptions &
|
|
593
|
-
AnthropicSamplingOptions
|
|
594
|
-
>
|
|
595
|
-
|
|
596
|
-
const CLAUDE_OPUS_4_7_FAST = {
|
|
597
|
-
name: 'claude-opus-4-7-fast',
|
|
598
|
-
id: 'claude-opus-4-7-fast',
|
|
599
|
-
context_window: 1_000_000,
|
|
600
|
-
max_output_tokens: 128_000,
|
|
601
|
-
supports: {
|
|
602
|
-
input: ['text', 'image', 'document'],
|
|
603
|
-
extended_thinking: true,
|
|
604
|
-
priority_tier: true,
|
|
605
|
-
tools: [
|
|
606
|
-
'web_search',
|
|
607
|
-
'web_fetch',
|
|
608
|
-
'code_execution',
|
|
609
|
-
'computer_use',
|
|
610
|
-
'bash',
|
|
611
|
-
'text_editor',
|
|
612
|
-
'memory',
|
|
613
|
-
],
|
|
614
|
-
},
|
|
615
|
-
pricing: {
|
|
616
|
-
input: {
|
|
617
|
-
normal: 30,
|
|
618
|
-
cached: 3,
|
|
619
|
-
},
|
|
620
|
-
output: {
|
|
621
|
-
normal: 150,
|
|
622
|
-
},
|
|
623
|
-
},
|
|
624
|
-
} as const satisfies ModelMeta<
|
|
625
|
-
AnthropicContainerOptions &
|
|
626
|
-
AnthropicContextManagementOptions &
|
|
627
|
-
AnthropicMCPOptions &
|
|
628
|
-
AnthropicServiceTierOptions &
|
|
629
|
-
AnthropicStopSequencesOptions &
|
|
630
|
-
AnthropicThinkingOptions &
|
|
343
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
631
344
|
AnthropicToolChoiceOptions &
|
|
632
|
-
|
|
345
|
+
AnthropicMaxTokensOptions &
|
|
346
|
+
AnthropicOutputConfigOptions
|
|
633
347
|
>
|
|
634
348
|
|
|
349
|
+
// Claude Opus 4.8 keeps the same request surface as Opus 4.7: adaptive
|
|
350
|
+
// thinking only (budget_tokens 400s), no sampling parameters.
|
|
635
351
|
const CLAUDE_OPUS_4_8 = {
|
|
636
|
-
name: 'claude-opus-4
|
|
637
|
-
id: 'claude-opus-4
|
|
352
|
+
name: 'claude-opus-4-8',
|
|
353
|
+
id: 'claude-opus-4-8',
|
|
638
354
|
context_window: 1_000_000,
|
|
639
355
|
max_output_tokens: 128_000,
|
|
640
356
|
supports: {
|
|
641
357
|
input: ['text', 'image', 'document'],
|
|
642
|
-
extended_thinking:
|
|
358
|
+
extended_thinking: false,
|
|
359
|
+
adaptive_thinking: true,
|
|
643
360
|
priority_tier: true,
|
|
644
361
|
tools: [
|
|
645
362
|
'web_search',
|
|
@@ -666,50 +383,17 @@ const CLAUDE_OPUS_4_8 = {
|
|
|
666
383
|
AnthropicMCPOptions &
|
|
667
384
|
AnthropicServiceTierOptions &
|
|
668
385
|
AnthropicStopSequencesOptions &
|
|
669
|
-
|
|
386
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
670
387
|
AnthropicToolChoiceOptions &
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const CLAUDE_OPUS_4_8_FAST = {
|
|
675
|
-
name: 'claude-opus-4.8-fast',
|
|
676
|
-
id: 'claude-opus-4.8-fast',
|
|
677
|
-
context_window: 1_000_000,
|
|
678
|
-
max_output_tokens: 128_000,
|
|
679
|
-
supports: {
|
|
680
|
-
input: ['text', 'image', 'document'],
|
|
681
|
-
extended_thinking: true,
|
|
682
|
-
priority_tier: true,
|
|
683
|
-
tools: [
|
|
684
|
-
'web_search',
|
|
685
|
-
'web_fetch',
|
|
686
|
-
'code_execution',
|
|
687
|
-
'computer_use',
|
|
688
|
-
'bash',
|
|
689
|
-
'text_editor',
|
|
690
|
-
'memory',
|
|
691
|
-
],
|
|
692
|
-
},
|
|
693
|
-
pricing: {
|
|
694
|
-
input: {
|
|
695
|
-
normal: 10,
|
|
696
|
-
cached: 1,
|
|
697
|
-
},
|
|
698
|
-
output: {
|
|
699
|
-
normal: 50,
|
|
700
|
-
},
|
|
701
|
-
},
|
|
702
|
-
} as const satisfies ModelMeta<
|
|
703
|
-
AnthropicContainerOptions &
|
|
704
|
-
AnthropicContextManagementOptions &
|
|
705
|
-
AnthropicMCPOptions &
|
|
706
|
-
AnthropicServiceTierOptions &
|
|
707
|
-
AnthropicStopSequencesOptions &
|
|
708
|
-
AnthropicThinkingOptions &
|
|
709
|
-
AnthropicToolChoiceOptions &
|
|
710
|
-
AnthropicSamplingOptions
|
|
388
|
+
AnthropicMaxTokensOptions &
|
|
389
|
+
AnthropicOutputConfigOptions
|
|
711
390
|
>
|
|
712
391
|
|
|
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.
|
|
713
397
|
const CLAUDE_FABLE_5 = {
|
|
714
398
|
name: 'claude-fable-5',
|
|
715
399
|
id: 'claude-fable-5',
|
|
@@ -717,7 +401,8 @@ const CLAUDE_FABLE_5 = {
|
|
|
717
401
|
max_output_tokens: 128_000,
|
|
718
402
|
supports: {
|
|
719
403
|
input: ['text', 'image', 'document'],
|
|
720
|
-
extended_thinking:
|
|
404
|
+
extended_thinking: false,
|
|
405
|
+
adaptive_thinking: true,
|
|
721
406
|
priority_tier: true,
|
|
722
407
|
tools: [
|
|
723
408
|
'web_search',
|
|
@@ -744,11 +429,18 @@ const CLAUDE_FABLE_5 = {
|
|
|
744
429
|
AnthropicMCPOptions &
|
|
745
430
|
AnthropicServiceTierOptions &
|
|
746
431
|
AnthropicStopSequencesOptions &
|
|
747
|
-
|
|
432
|
+
AnthropicAdaptiveOnlyThinkingOptions &
|
|
748
433
|
AnthropicToolChoiceOptions &
|
|
749
|
-
|
|
434
|
+
AnthropicMaxTokensOptions &
|
|
435
|
+
AnthropicOutputConfigOptions
|
|
750
436
|
>
|
|
751
437
|
|
|
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).
|
|
752
444
|
const CLAUDE_SONNET_5 = {
|
|
753
445
|
name: 'claude-sonnet-5',
|
|
754
446
|
id: 'claude-sonnet-5',
|
|
@@ -756,7 +448,8 @@ const CLAUDE_SONNET_5 = {
|
|
|
756
448
|
max_output_tokens: 128_000,
|
|
757
449
|
supports: {
|
|
758
450
|
input: ['text', 'image', 'document'],
|
|
759
|
-
extended_thinking:
|
|
451
|
+
extended_thinking: false,
|
|
452
|
+
adaptive_thinking: true,
|
|
760
453
|
priority_tier: true,
|
|
761
454
|
tools: [
|
|
762
455
|
'web_search',
|
|
@@ -770,11 +463,11 @@ const CLAUDE_SONNET_5 = {
|
|
|
770
463
|
},
|
|
771
464
|
pricing: {
|
|
772
465
|
input: {
|
|
773
|
-
normal:
|
|
774
|
-
cached: 0.
|
|
466
|
+
normal: 3,
|
|
467
|
+
cached: 0.3,
|
|
775
468
|
},
|
|
776
469
|
output: {
|
|
777
|
-
normal:
|
|
470
|
+
normal: 15,
|
|
778
471
|
},
|
|
779
472
|
},
|
|
780
473
|
} as const satisfies ModelMeta<
|
|
@@ -783,11 +476,21 @@ const CLAUDE_SONNET_5 = {
|
|
|
783
476
|
AnthropicMCPOptions &
|
|
784
477
|
AnthropicServiceTierOptions &
|
|
785
478
|
AnthropicStopSequencesOptions &
|
|
786
|
-
|
|
479
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
787
480
|
AnthropicToolChoiceOptions &
|
|
788
|
-
|
|
481
|
+
AnthropicMaxTokensOptions &
|
|
482
|
+
AnthropicOutputConfigOptions
|
|
789
483
|
>
|
|
790
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
|
+
*/
|
|
791
494
|
export const ANTHROPIC_MODELS = [
|
|
792
495
|
CLAUDE_OPUS_4_6.id,
|
|
793
496
|
CLAUDE_OPUS_4_5.id,
|
|
@@ -795,20 +498,9 @@ export const ANTHROPIC_MODELS = [
|
|
|
795
498
|
CLAUDE_SONNET_4_5.id,
|
|
796
499
|
CLAUDE_HAIKU_4_5.id,
|
|
797
500
|
CLAUDE_OPUS_4_1.id,
|
|
798
|
-
CLAUDE_SONNET_4.id,
|
|
799
|
-
CLAUDE_SONNET_3_7.id,
|
|
800
|
-
CLAUDE_OPUS_4.id,
|
|
801
|
-
CLAUDE_HAIKU_3_5.id,
|
|
802
|
-
CLAUDE_HAIKU_3.id,
|
|
803
|
-
|
|
804
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
805
501
|
|
|
806
502
|
CLAUDE_OPUS_4_7.id,
|
|
807
|
-
|
|
808
|
-
CLAUDE_OPUS_4_7_FAST.id,
|
|
809
|
-
|
|
810
503
|
CLAUDE_OPUS_4_8.id,
|
|
811
|
-
CLAUDE_OPUS_4_8_FAST.id,
|
|
812
504
|
|
|
813
505
|
CLAUDE_FABLE_5.id,
|
|
814
506
|
CLAUDE_SONNET_5.id,
|
|
@@ -824,9 +516,10 @@ export const ANTHROPIC_MODELS = [
|
|
|
824
516
|
export const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
825
517
|
CLAUDE_OPUS_4_5.id,
|
|
826
518
|
CLAUDE_OPUS_4_6.id,
|
|
827
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
828
519
|
CLAUDE_OPUS_4_7.id,
|
|
829
|
-
|
|
520
|
+
CLAUDE_OPUS_4_8.id,
|
|
521
|
+
CLAUDE_FABLE_5.id,
|
|
522
|
+
CLAUDE_SONNET_5.id,
|
|
830
523
|
CLAUDE_SONNET_4_5.id,
|
|
831
524
|
CLAUDE_SONNET_4_6.id,
|
|
832
525
|
CLAUDE_HAIKU_4_5.id,
|
|
@@ -837,29 +530,32 @@ export const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
|
837
530
|
// const ANTHROPIC_AUDIO_MODELS = [] as const
|
|
838
531
|
// const ANTHROPIC_VIDEO_MODELS = [] as const
|
|
839
532
|
|
|
840
|
-
/* type AnthropicModel = (typeof ANTHROPIC_MODELS)[number] */
|
|
841
533
|
export type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number]
|
|
842
534
|
// Manual type map for per-model provider options
|
|
843
|
-
// Models are differentiated by
|
|
535
|
+
// Models are differentiated by which thinking shapes and sampling
|
|
536
|
+
// parameters the API accepts.
|
|
844
537
|
export type AnthropicChatModelProviderOptionsByName = {
|
|
845
|
-
//
|
|
538
|
+
// 4.6 generation: adaptive thinking plus the deprecated budget-based
|
|
539
|
+
// shape; sampling parameters still accepted.
|
|
846
540
|
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions &
|
|
847
541
|
AnthropicContextManagementOptions &
|
|
848
542
|
AnthropicMCPOptions &
|
|
849
543
|
AnthropicServiceTierOptions &
|
|
850
544
|
AnthropicStopSequencesOptions &
|
|
851
|
-
|
|
545
|
+
AnthropicAdaptiveThinkingOptions &
|
|
852
546
|
AnthropicToolChoiceOptions &
|
|
853
547
|
AnthropicSamplingOptions
|
|
854
|
-
[
|
|
548
|
+
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions &
|
|
855
549
|
AnthropicContextManagementOptions &
|
|
856
550
|
AnthropicMCPOptions &
|
|
857
551
|
AnthropicServiceTierOptions &
|
|
858
552
|
AnthropicStopSequencesOptions &
|
|
859
|
-
|
|
553
|
+
AnthropicAdaptiveThinkingOptions &
|
|
860
554
|
AnthropicToolChoiceOptions &
|
|
861
555
|
AnthropicSamplingOptions
|
|
862
|
-
|
|
556
|
+
|
|
557
|
+
// Pre-4.6 models: budget-based extended thinking and sampling parameters.
|
|
558
|
+
[CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions &
|
|
863
559
|
AnthropicContextManagementOptions &
|
|
864
560
|
AnthropicMCPOptions &
|
|
865
561
|
AnthropicServiceTierOptions &
|
|
@@ -891,103 +587,51 @@ export type AnthropicChatModelProviderOptionsByName = {
|
|
|
891
587
|
AnthropicThinkingOptions &
|
|
892
588
|
AnthropicToolChoiceOptions &
|
|
893
589
|
AnthropicSamplingOptions
|
|
894
|
-
[CLAUDE_SONNET_4.id]: AnthropicContainerOptions &
|
|
895
|
-
AnthropicContextManagementOptions &
|
|
896
|
-
AnthropicMCPOptions &
|
|
897
|
-
AnthropicServiceTierOptions &
|
|
898
|
-
AnthropicStopSequencesOptions &
|
|
899
|
-
AnthropicThinkingOptions &
|
|
900
|
-
AnthropicToolChoiceOptions &
|
|
901
|
-
AnthropicSamplingOptions
|
|
902
|
-
[CLAUDE_SONNET_3_7.id]: AnthropicContainerOptions &
|
|
903
|
-
AnthropicContextManagementOptions &
|
|
904
|
-
AnthropicMCPOptions &
|
|
905
|
-
AnthropicServiceTierOptions &
|
|
906
|
-
AnthropicStopSequencesOptions &
|
|
907
|
-
AnthropicThinkingOptions &
|
|
908
|
-
AnthropicToolChoiceOptions &
|
|
909
|
-
AnthropicSamplingOptions
|
|
910
|
-
[CLAUDE_OPUS_4.id]: AnthropicContainerOptions &
|
|
911
|
-
AnthropicContextManagementOptions &
|
|
912
|
-
AnthropicMCPOptions &
|
|
913
|
-
AnthropicServiceTierOptions &
|
|
914
|
-
AnthropicStopSequencesOptions &
|
|
915
|
-
AnthropicThinkingOptions &
|
|
916
|
-
AnthropicToolChoiceOptions &
|
|
917
|
-
AnthropicSamplingOptions
|
|
918
|
-
|
|
919
|
-
// Model with priority_tier but NO extended_thinking
|
|
920
|
-
[CLAUDE_HAIKU_3_5.id]: AnthropicContainerOptions &
|
|
921
|
-
AnthropicContextManagementOptions &
|
|
922
|
-
AnthropicMCPOptions &
|
|
923
|
-
AnthropicServiceTierOptions &
|
|
924
|
-
AnthropicStopSequencesOptions &
|
|
925
|
-
AnthropicToolChoiceOptions &
|
|
926
|
-
AnthropicSamplingOptions
|
|
927
590
|
|
|
928
|
-
//
|
|
929
|
-
|
|
930
|
-
AnthropicContextManagementOptions &
|
|
931
|
-
AnthropicMCPOptions &
|
|
932
|
-
AnthropicStopSequencesOptions &
|
|
933
|
-
AnthropicToolChoiceOptions &
|
|
934
|
-
AnthropicSamplingOptions
|
|
935
|
-
[CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions &
|
|
936
|
-
AnthropicContextManagementOptions &
|
|
937
|
-
AnthropicMCPOptions &
|
|
938
|
-
AnthropicServiceTierOptions &
|
|
939
|
-
AnthropicStopSequencesOptions &
|
|
940
|
-
AnthropicThinkingOptions &
|
|
941
|
-
AnthropicToolChoiceOptions &
|
|
942
|
-
AnthropicSamplingOptions
|
|
591
|
+
// Opus 4.7/4.8: adaptive thinking (or explicit disable), no
|
|
592
|
+
// budget_tokens, no sampling parameters — see the constants above.
|
|
943
593
|
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &
|
|
944
594
|
AnthropicContextManagementOptions &
|
|
945
595
|
AnthropicMCPOptions &
|
|
946
596
|
AnthropicServiceTierOptions &
|
|
947
597
|
AnthropicStopSequencesOptions &
|
|
948
|
-
|
|
598
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
949
599
|
AnthropicToolChoiceOptions &
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
AnthropicContextManagementOptions &
|
|
953
|
-
AnthropicMCPOptions &
|
|
954
|
-
AnthropicServiceTierOptions &
|
|
955
|
-
AnthropicStopSequencesOptions &
|
|
956
|
-
AnthropicThinkingOptions &
|
|
957
|
-
AnthropicToolChoiceOptions &
|
|
958
|
-
AnthropicSamplingOptions
|
|
600
|
+
AnthropicMaxTokensOptions &
|
|
601
|
+
AnthropicOutputConfigOptions
|
|
959
602
|
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions &
|
|
960
603
|
AnthropicContextManagementOptions &
|
|
961
604
|
AnthropicMCPOptions &
|
|
962
605
|
AnthropicServiceTierOptions &
|
|
963
606
|
AnthropicStopSequencesOptions &
|
|
964
|
-
|
|
965
|
-
AnthropicToolChoiceOptions &
|
|
966
|
-
AnthropicSamplingOptions
|
|
967
|
-
[CLAUDE_OPUS_4_8_FAST.id]: AnthropicContainerOptions &
|
|
968
|
-
AnthropicContextManagementOptions &
|
|
969
|
-
AnthropicMCPOptions &
|
|
970
|
-
AnthropicServiceTierOptions &
|
|
971
|
-
AnthropicStopSequencesOptions &
|
|
972
|
-
AnthropicThinkingOptions &
|
|
607
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
973
608
|
AnthropicToolChoiceOptions &
|
|
974
|
-
|
|
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.
|
|
975
614
|
[CLAUDE_FABLE_5.id]: AnthropicContainerOptions &
|
|
976
615
|
AnthropicContextManagementOptions &
|
|
977
616
|
AnthropicMCPOptions &
|
|
978
617
|
AnthropicServiceTierOptions &
|
|
979
618
|
AnthropicStopSequencesOptions &
|
|
980
|
-
|
|
619
|
+
AnthropicAdaptiveOnlyThinkingOptions &
|
|
981
620
|
AnthropicToolChoiceOptions &
|
|
982
|
-
|
|
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.
|
|
983
626
|
[CLAUDE_SONNET_5.id]: AnthropicContainerOptions &
|
|
984
627
|
AnthropicContextManagementOptions &
|
|
985
628
|
AnthropicMCPOptions &
|
|
986
629
|
AnthropicServiceTierOptions &
|
|
987
630
|
AnthropicStopSequencesOptions &
|
|
988
|
-
|
|
631
|
+
AnthropicAdaptiveOrDisabledThinkingOptions &
|
|
989
632
|
AnthropicToolChoiceOptions &
|
|
990
|
-
|
|
633
|
+
AnthropicMaxTokensOptions &
|
|
634
|
+
AnthropicOutputConfigOptions
|
|
991
635
|
}
|
|
992
636
|
|
|
993
637
|
export type AnthropicChatModelToolCapabilitiesByName = {
|
|
@@ -997,13 +641,10 @@ export type AnthropicChatModelToolCapabilitiesByName = {
|
|
|
997
641
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools
|
|
998
642
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools
|
|
999
643
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools
|
|
1000
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools
|
|
1001
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools
|
|
1002
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools
|
|
1003
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools
|
|
1004
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools
|
|
1005
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools
|
|
1006
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
|
|
1007
648
|
}
|
|
1008
649
|
|
|
1009
650
|
/**
|
|
@@ -1024,16 +665,8 @@ export type AnthropicModelInputModalitiesByName = {
|
|
|
1024
665
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input
|
|
1025
666
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input
|
|
1026
667
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input
|
|
1027
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input
|
|
1028
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input
|
|
1029
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input
|
|
1030
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input
|
|
1031
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input
|
|
1032
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input
|
|
1033
668
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input
|
|
1034
|
-
[CLAUDE_OPUS_4_7_FAST.id]: typeof CLAUDE_OPUS_4_7_FAST.supports.input
|
|
1035
669
|
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input
|
|
1036
|
-
[CLAUDE_OPUS_4_8_FAST.id]: typeof CLAUDE_OPUS_4_8_FAST.supports.input
|
|
1037
670
|
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input
|
|
1038
671
|
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input
|
|
1039
672
|
}
|