@tanstack/ai-anthropic 0.15.13 → 0.16.1
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 +107 -4
- package/dist/esm/adapters/text.js.map +1 -1
- package/dist/esm/model-meta.d.ts +77 -207
- package/dist/esm/model-meta.js +45 -45
- 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 +204 -3
- package/src/model-meta.ts +174 -466
- 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,35 +149,15 @@ declare const CLAUDE_OPUS_4_7: {
|
|
|
272
149
|
};
|
|
273
150
|
};
|
|
274
151
|
};
|
|
275
|
-
declare const CLAUDE_OPUS_4_7_FAST: {
|
|
276
|
-
readonly name: "claude-opus-4-7-fast";
|
|
277
|
-
readonly id: "claude-opus-4-7-fast";
|
|
278
|
-
readonly context_window: 1000000;
|
|
279
|
-
readonly max_output_tokens: 128000;
|
|
280
|
-
readonly supports: {
|
|
281
|
-
readonly input: ["text", "image", "document"];
|
|
282
|
-
readonly extended_thinking: true;
|
|
283
|
-
readonly priority_tier: true;
|
|
284
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
285
|
-
};
|
|
286
|
-
readonly pricing: {
|
|
287
|
-
readonly input: {
|
|
288
|
-
readonly normal: 30;
|
|
289
|
-
readonly cached: 3;
|
|
290
|
-
};
|
|
291
|
-
readonly output: {
|
|
292
|
-
readonly normal: 150;
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
152
|
declare const CLAUDE_OPUS_4_8: {
|
|
297
|
-
readonly name: "claude-opus-4
|
|
298
|
-
readonly id: "claude-opus-4
|
|
153
|
+
readonly name: "claude-opus-4-8";
|
|
154
|
+
readonly id: "claude-opus-4-8";
|
|
299
155
|
readonly context_window: 1000000;
|
|
300
156
|
readonly max_output_tokens: 128000;
|
|
301
157
|
readonly supports: {
|
|
302
158
|
readonly input: ["text", "image", "document"];
|
|
303
|
-
readonly extended_thinking:
|
|
159
|
+
readonly extended_thinking: false;
|
|
160
|
+
readonly adaptive_thinking: true;
|
|
304
161
|
readonly priority_tier: true;
|
|
305
162
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
306
163
|
};
|
|
@@ -314,27 +171,6 @@ declare const CLAUDE_OPUS_4_8: {
|
|
|
314
171
|
};
|
|
315
172
|
};
|
|
316
173
|
};
|
|
317
|
-
declare const CLAUDE_OPUS_4_8_FAST: {
|
|
318
|
-
readonly name: "claude-opus-4.8-fast";
|
|
319
|
-
readonly id: "claude-opus-4.8-fast";
|
|
320
|
-
readonly context_window: 1000000;
|
|
321
|
-
readonly max_output_tokens: 128000;
|
|
322
|
-
readonly supports: {
|
|
323
|
-
readonly input: ["text", "image", "document"];
|
|
324
|
-
readonly extended_thinking: true;
|
|
325
|
-
readonly priority_tier: true;
|
|
326
|
-
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
327
|
-
};
|
|
328
|
-
readonly pricing: {
|
|
329
|
-
readonly input: {
|
|
330
|
-
readonly normal: 10;
|
|
331
|
-
readonly cached: 1;
|
|
332
|
-
};
|
|
333
|
-
readonly output: {
|
|
334
|
-
readonly normal: 50;
|
|
335
|
-
};
|
|
336
|
-
};
|
|
337
|
-
};
|
|
338
174
|
declare const CLAUDE_FABLE_5: {
|
|
339
175
|
readonly name: "claude-fable-5";
|
|
340
176
|
readonly id: "claude-fable-5";
|
|
@@ -342,7 +178,8 @@ declare const CLAUDE_FABLE_5: {
|
|
|
342
178
|
readonly max_output_tokens: 128000;
|
|
343
179
|
readonly supports: {
|
|
344
180
|
readonly input: ["text", "image", "document"];
|
|
345
|
-
readonly extended_thinking:
|
|
181
|
+
readonly extended_thinking: false;
|
|
182
|
+
readonly adaptive_thinking: true;
|
|
346
183
|
readonly priority_tier: true;
|
|
347
184
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
348
185
|
};
|
|
@@ -363,21 +200,73 @@ declare const CLAUDE_SONNET_5: {
|
|
|
363
200
|
readonly max_output_tokens: 128000;
|
|
364
201
|
readonly supports: {
|
|
365
202
|
readonly input: ["text", "image", "document"];
|
|
366
|
-
readonly extended_thinking:
|
|
203
|
+
readonly extended_thinking: false;
|
|
204
|
+
readonly adaptive_thinking: true;
|
|
367
205
|
readonly priority_tier: true;
|
|
368
206
|
readonly tools: ["web_search", "web_fetch", "code_execution", "computer_use", "bash", "text_editor", "memory"];
|
|
369
207
|
};
|
|
370
208
|
readonly pricing: {
|
|
371
209
|
readonly input: {
|
|
372
|
-
readonly normal:
|
|
373
|
-
readonly cached: 0.
|
|
210
|
+
readonly normal: 3;
|
|
211
|
+
readonly cached: 0.3;
|
|
374
212
|
};
|
|
375
213
|
readonly output: {
|
|
376
|
-
readonly normal:
|
|
214
|
+
readonly normal: 15;
|
|
377
215
|
};
|
|
378
216
|
};
|
|
379
217
|
};
|
|
380
|
-
|
|
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"];
|
|
228
|
+
/**
|
|
229
|
+
* Fallback `max_tokens` ceiling for a model whose metadata carries no
|
|
230
|
+
* `max_output_tokens` (e.g. an unrecognized model id). Anthropic's Messages
|
|
231
|
+
* API *requires* `max_tokens`, so the adapter must always send a value. 64K is
|
|
232
|
+
* the output ceiling of the current mainstream Claude tier (Sonnet/Haiku 4.5),
|
|
233
|
+
* so it's a sane default for an unknown — almost certainly modern — model and
|
|
234
|
+
* avoids silently truncating long generations (issue #849). Recognized models
|
|
235
|
+
* use their exact `max_output_tokens` from {@link ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS}
|
|
236
|
+
* (e.g. 128K for Opus), so this fallback only ever applies to ids not in the
|
|
237
|
+
* map.
|
|
238
|
+
*/
|
|
239
|
+
export declare const ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS = 64000;
|
|
240
|
+
/**
|
|
241
|
+
* Largest `max_tokens` the Anthropic SDK permits on a **non-streaming**
|
|
242
|
+
* request. The SDK refuses to make a non-streaming call it estimates could
|
|
243
|
+
* exceed its 10-minute timeout, computed as
|
|
244
|
+
* `(60min * max_tokens) / 128_000 > 10min` — i.e. it throws
|
|
245
|
+
* `"Streaming is required for operations that may take longer than 10 minutes"`
|
|
246
|
+
* once `max_tokens > 128_000 * 10 / 60 ≈ 21_333`
|
|
247
|
+
* (`@anthropic-ai/sdk`'s `calculateNonstreamingTimeout`). The text adapter's
|
|
248
|
+
* only non-streaming call is the forced-tool `structuredOutput()` request, so
|
|
249
|
+
* its defaulted ceiling must stay at or below this; the streaming chat path
|
|
250
|
+
* keeps the model's full {@link getAnthropicDefaultMaxTokens} ceiling. We sit
|
|
251
|
+
* just under the boundary (`21_333` would round-trip to exactly 10min). This
|
|
252
|
+
* caps only the *default* — an explicit oversized `max_tokens` from the caller
|
|
253
|
+
* still surfaces the SDK's "use streaming" error, which is the correct signal.
|
|
254
|
+
*/
|
|
255
|
+
export declare const ANTHROPIC_MAX_NONSTREAMING_TOKENS = 21000;
|
|
256
|
+
/**
|
|
257
|
+
* Resolve the default `max_tokens` for a model: its known `max_output_tokens`
|
|
258
|
+
* ceiling, or {@link ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS} for unknown models.
|
|
259
|
+
* Callers that pass an explicit `max_tokens` bypass this entirely.
|
|
260
|
+
*
|
|
261
|
+
* Pass `stream: false` for non-streaming requests (the `structuredOutput()`
|
|
262
|
+
* path): the result is then clamped to {@link ANTHROPIC_MAX_NONSTREAMING_TOKENS}
|
|
263
|
+
* so the defaulted ceiling doesn't trip the SDK's non-streaming 10-minute guard
|
|
264
|
+
* (issue #849). Streaming requests (the default) are unaffected and get the
|
|
265
|
+
* model's full ceiling.
|
|
266
|
+
*/
|
|
267
|
+
export declare function getAnthropicDefaultMaxTokens(model: string, { stream }?: {
|
|
268
|
+
stream?: boolean;
|
|
269
|
+
}): number;
|
|
381
270
|
/**
|
|
382
271
|
* Anthropic models that support combining `tools` + JSON-Schema-constrained
|
|
383
272
|
* output in a single streaming Messages request (per issue #605). GA'd
|
|
@@ -388,24 +277,16 @@ export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-6", "claude-opus
|
|
|
388
277
|
export declare const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS: Set<string>;
|
|
389
278
|
export type AnthropicChatModel = (typeof ANTHROPIC_MODELS)[number];
|
|
390
279
|
export type AnthropicChatModelProviderOptionsByName = {
|
|
391
|
-
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions &
|
|
280
|
+
[CLAUDE_OPUS_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
281
|
+
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
392
282
|
[CLAUDE_OPUS_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
393
|
-
[CLAUDE_SONNET_4_6.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
394
283
|
[CLAUDE_SONNET_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
395
284
|
[CLAUDE_HAIKU_4_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
396
285
|
[CLAUDE_OPUS_4_1.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
397
|
-
[
|
|
398
|
-
[
|
|
399
|
-
[
|
|
400
|
-
[
|
|
401
|
-
[CLAUDE_HAIKU_3.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicStopSequencesOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
402
|
-
[CLAUDE_OPUS_4_6_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
403
|
-
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
404
|
-
[CLAUDE_OPUS_4_7_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
405
|
-
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
406
|
-
[CLAUDE_OPUS_4_8_FAST.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
407
|
-
[CLAUDE_FABLE_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
408
|
-
[CLAUDE_SONNET_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicThinkingOptions & AnthropicToolChoiceOptions & AnthropicSamplingOptions;
|
|
286
|
+
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
287
|
+
[CLAUDE_OPUS_4_8.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
288
|
+
[CLAUDE_FABLE_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOnlyThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
289
|
+
[CLAUDE_SONNET_5.id]: AnthropicContainerOptions & AnthropicContextManagementOptions & AnthropicMCPOptions & AnthropicServiceTierOptions & AnthropicStopSequencesOptions & AnthropicAdaptiveOrDisabledThinkingOptions & AnthropicToolChoiceOptions & AnthropicMaxTokensOptions & AnthropicOutputConfigOptions;
|
|
409
290
|
};
|
|
410
291
|
export type AnthropicChatModelToolCapabilitiesByName = {
|
|
411
292
|
[CLAUDE_OPUS_4_6.id]: typeof CLAUDE_OPUS_4_6.supports.tools;
|
|
@@ -414,13 +295,10 @@ export type AnthropicChatModelToolCapabilitiesByName = {
|
|
|
414
295
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.tools;
|
|
415
296
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.tools;
|
|
416
297
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.tools;
|
|
417
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.tools;
|
|
418
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.tools;
|
|
419
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.tools;
|
|
420
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.tools;
|
|
421
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.tools;
|
|
422
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.tools;
|
|
423
298
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.tools;
|
|
299
|
+
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.tools;
|
|
300
|
+
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.tools;
|
|
301
|
+
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.tools;
|
|
424
302
|
};
|
|
425
303
|
/**
|
|
426
304
|
* Type-only map from chat model name to its supported input modalities.
|
|
@@ -440,16 +318,8 @@ export type AnthropicModelInputModalitiesByName = {
|
|
|
440
318
|
[CLAUDE_SONNET_4_5.id]: typeof CLAUDE_SONNET_4_5.supports.input;
|
|
441
319
|
[CLAUDE_HAIKU_4_5.id]: typeof CLAUDE_HAIKU_4_5.supports.input;
|
|
442
320
|
[CLAUDE_OPUS_4_1.id]: typeof CLAUDE_OPUS_4_1.supports.input;
|
|
443
|
-
[CLAUDE_SONNET_4.id]: typeof CLAUDE_SONNET_4.supports.input;
|
|
444
|
-
[CLAUDE_SONNET_3_7.id]: typeof CLAUDE_SONNET_3_7.supports.input;
|
|
445
|
-
[CLAUDE_OPUS_4.id]: typeof CLAUDE_OPUS_4.supports.input;
|
|
446
|
-
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input;
|
|
447
|
-
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input;
|
|
448
|
-
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input;
|
|
449
321
|
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input;
|
|
450
|
-
[CLAUDE_OPUS_4_7_FAST.id]: typeof CLAUDE_OPUS_4_7_FAST.supports.input;
|
|
451
322
|
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input;
|
|
452
|
-
[CLAUDE_OPUS_4_8_FAST.id]: typeof CLAUDE_OPUS_4_8_FAST.supports.input;
|
|
453
323
|
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input;
|
|
454
324
|
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input;
|
|
455
325
|
};
|
package/dist/esm/model-meta.js
CHANGED
|
@@ -1,56 +1,42 @@
|
|
|
1
1
|
const CLAUDE_OPUS_4_6 = {
|
|
2
|
-
id: "claude-opus-4-6"
|
|
2
|
+
id: "claude-opus-4-6",
|
|
3
|
+
max_output_tokens: 128e3
|
|
3
4
|
};
|
|
4
5
|
const CLAUDE_OPUS_4_5 = {
|
|
5
|
-
id: "claude-opus-4-5"
|
|
6
|
+
id: "claude-opus-4-5",
|
|
7
|
+
max_output_tokens: 32e3
|
|
6
8
|
};
|
|
7
9
|
const CLAUDE_SONNET_4_6 = {
|
|
8
|
-
id: "claude-sonnet-4-6"
|
|
10
|
+
id: "claude-sonnet-4-6",
|
|
11
|
+
max_output_tokens: 64e3
|
|
9
12
|
};
|
|
10
13
|
const CLAUDE_SONNET_4_5 = {
|
|
11
|
-
id: "claude-sonnet-4-5"
|
|
14
|
+
id: "claude-sonnet-4-5",
|
|
15
|
+
max_output_tokens: 64e3
|
|
12
16
|
};
|
|
13
17
|
const CLAUDE_HAIKU_4_5 = {
|
|
14
|
-
id: "claude-haiku-4-5"
|
|
18
|
+
id: "claude-haiku-4-5",
|
|
19
|
+
max_output_tokens: 64e3
|
|
15
20
|
};
|
|
16
21
|
const CLAUDE_OPUS_4_1 = {
|
|
17
|
-
id: "claude-opus-4-1"
|
|
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"
|
|
22
|
+
id: "claude-opus-4-1",
|
|
23
|
+
max_output_tokens: 64e3
|
|
36
24
|
};
|
|
37
25
|
const CLAUDE_OPUS_4_7 = {
|
|
38
|
-
id: "claude-opus-4-7"
|
|
39
|
-
|
|
40
|
-
const CLAUDE_OPUS_4_7_FAST = {
|
|
41
|
-
id: "claude-opus-4-7-fast"
|
|
26
|
+
id: "claude-opus-4-7",
|
|
27
|
+
max_output_tokens: 128e3
|
|
42
28
|
};
|
|
43
29
|
const CLAUDE_OPUS_4_8 = {
|
|
44
|
-
id: "claude-opus-4
|
|
45
|
-
|
|
46
|
-
const CLAUDE_OPUS_4_8_FAST = {
|
|
47
|
-
id: "claude-opus-4.8-fast"
|
|
30
|
+
id: "claude-opus-4-8",
|
|
31
|
+
max_output_tokens: 128e3
|
|
48
32
|
};
|
|
49
33
|
const CLAUDE_FABLE_5 = {
|
|
50
|
-
id: "claude-fable-5"
|
|
34
|
+
id: "claude-fable-5",
|
|
35
|
+
max_output_tokens: 128e3
|
|
51
36
|
};
|
|
52
37
|
const CLAUDE_SONNET_5 = {
|
|
53
|
-
id: "claude-sonnet-5"
|
|
38
|
+
id: "claude-sonnet-5",
|
|
39
|
+
max_output_tokens: 128e3
|
|
54
40
|
};
|
|
55
41
|
const ANTHROPIC_MODELS = [
|
|
56
42
|
CLAUDE_OPUS_4_6.id,
|
|
@@ -59,31 +45,45 @@ const ANTHROPIC_MODELS = [
|
|
|
59
45
|
CLAUDE_SONNET_4_5.id,
|
|
60
46
|
CLAUDE_HAIKU_4_5.id,
|
|
61
47
|
CLAUDE_OPUS_4_1.id,
|
|
62
|
-
CLAUDE_SONNET_4.id,
|
|
63
|
-
CLAUDE_SONNET_3_7.id,
|
|
64
|
-
CLAUDE_OPUS_4.id,
|
|
65
|
-
CLAUDE_HAIKU_3_5.id,
|
|
66
|
-
CLAUDE_HAIKU_3.id,
|
|
67
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
68
48
|
CLAUDE_OPUS_4_7.id,
|
|
69
|
-
CLAUDE_OPUS_4_7_FAST.id,
|
|
70
49
|
CLAUDE_OPUS_4_8.id,
|
|
71
|
-
CLAUDE_OPUS_4_8_FAST.id,
|
|
72
50
|
CLAUDE_FABLE_5.id,
|
|
73
51
|
CLAUDE_SONNET_5.id
|
|
74
52
|
];
|
|
53
|
+
const ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS = 64e3;
|
|
54
|
+
const ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS = {
|
|
55
|
+
[CLAUDE_OPUS_4_6.id]: CLAUDE_OPUS_4_6.max_output_tokens,
|
|
56
|
+
[CLAUDE_OPUS_4_5.id]: CLAUDE_OPUS_4_5.max_output_tokens,
|
|
57
|
+
[CLAUDE_SONNET_4_6.id]: CLAUDE_SONNET_4_6.max_output_tokens,
|
|
58
|
+
[CLAUDE_SONNET_4_5.id]: CLAUDE_SONNET_4_5.max_output_tokens,
|
|
59
|
+
[CLAUDE_HAIKU_4_5.id]: CLAUDE_HAIKU_4_5.max_output_tokens,
|
|
60
|
+
[CLAUDE_OPUS_4_1.id]: CLAUDE_OPUS_4_1.max_output_tokens,
|
|
61
|
+
[CLAUDE_OPUS_4_7.id]: CLAUDE_OPUS_4_7.max_output_tokens,
|
|
62
|
+
[CLAUDE_OPUS_4_8.id]: CLAUDE_OPUS_4_8.max_output_tokens,
|
|
63
|
+
[CLAUDE_FABLE_5.id]: CLAUDE_FABLE_5.max_output_tokens,
|
|
64
|
+
[CLAUDE_SONNET_5.id]: CLAUDE_SONNET_5.max_output_tokens
|
|
65
|
+
};
|
|
66
|
+
const ANTHROPIC_MAX_NONSTREAMING_TOKENS = 21e3;
|
|
67
|
+
function getAnthropicDefaultMaxTokens(model, { stream = true } = {}) {
|
|
68
|
+
const ceiling = ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS[model] ?? ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS;
|
|
69
|
+
return stream ? ceiling : Math.min(ceiling, ANTHROPIC_MAX_NONSTREAMING_TOKENS);
|
|
70
|
+
}
|
|
75
71
|
const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = /* @__PURE__ */ new Set([
|
|
76
72
|
CLAUDE_OPUS_4_5.id,
|
|
77
73
|
CLAUDE_OPUS_4_6.id,
|
|
78
|
-
CLAUDE_OPUS_4_6_FAST.id,
|
|
79
74
|
CLAUDE_OPUS_4_7.id,
|
|
80
|
-
|
|
75
|
+
CLAUDE_OPUS_4_8.id,
|
|
76
|
+
CLAUDE_FABLE_5.id,
|
|
77
|
+
CLAUDE_SONNET_5.id,
|
|
81
78
|
CLAUDE_SONNET_4_5.id,
|
|
82
79
|
CLAUDE_SONNET_4_6.id,
|
|
83
80
|
CLAUDE_HAIKU_4_5.id
|
|
84
81
|
]);
|
|
85
82
|
export {
|
|
86
83
|
ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS,
|
|
87
|
-
|
|
84
|
+
ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS,
|
|
85
|
+
ANTHROPIC_MAX_NONSTREAMING_TOKENS,
|
|
86
|
+
ANTHROPIC_MODELS,
|
|
87
|
+
getAnthropicDefaultMaxTokens
|
|
88
88
|
};
|
|
89
89
|
//# sourceMappingURL=model-meta.js.map
|
|
@@ -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\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: 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\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: 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: 2,\n cached: 0.2,\n },\n output: {\n normal: 10,\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\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_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 [CLAUDE_FABLE_5.id]: AnthropicContainerOptions &\n AnthropicContextManagementOptions &\n AnthropicMCPOptions &\n AnthropicServiceTierOptions &\n AnthropicStopSequencesOptions &\n AnthropicThinkingOptions &\n AnthropicToolChoiceOptions &\n AnthropicSamplingOptions\n [CLAUDE_SONNET_5.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 [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":"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;AAWA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AA0BN;AAWA,MAAM,kBAAkB;AAAA,EAEtB,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;AAAA,EAErB,eAAe;AAAA,EACf,gBAAgB;AAClB;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 * Fallback `max_tokens` ceiling for a model whose metadata carries no\n * `max_output_tokens` (e.g. an unrecognized model id). Anthropic's Messages\n * API *requires* `max_tokens`, so the adapter must always send a value. 64K is\n * the output ceiling of the current mainstream Claude tier (Sonnet/Haiku 4.5),\n * so it's a sane default for an unknown — almost certainly modern — model and\n * avoids silently truncating long generations (issue #849). Recognized models\n * use their exact `max_output_tokens` from {@link ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS}\n * (e.g. 128K for Opus), so this fallback only ever applies to ids not in the\n * map.\n */\nexport const ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS = 64_000\n\n/**\n * Runtime lookup of each model's maximum output-token ceiling, keyed by model\n * id. Lets the text adapter default the required `max_tokens` request field to\n * the model's real ceiling when the caller doesn't specify one, rather than a\n * low constant that truncates responses mid-stream (issue #849).\n *\n * Kept in sync with {@link ANTHROPIC_MODELS} by `scripts/sync-provider-models.ts`\n * — when that script adds a model it also inserts the model's `max_output_tokens`\n * here, so a freshly-synced model resolves to its real ceiling rather than the\n * fallback above.\n */\nconst ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = {\n [CLAUDE_OPUS_4_6.id]: CLAUDE_OPUS_4_6.max_output_tokens,\n [CLAUDE_OPUS_4_5.id]: CLAUDE_OPUS_4_5.max_output_tokens,\n [CLAUDE_SONNET_4_6.id]: CLAUDE_SONNET_4_6.max_output_tokens,\n [CLAUDE_SONNET_4_5.id]: CLAUDE_SONNET_4_5.max_output_tokens,\n [CLAUDE_HAIKU_4_5.id]: CLAUDE_HAIKU_4_5.max_output_tokens,\n [CLAUDE_OPUS_4_1.id]: CLAUDE_OPUS_4_1.max_output_tokens,\n [CLAUDE_OPUS_4_7.id]: CLAUDE_OPUS_4_7.max_output_tokens,\n [CLAUDE_OPUS_4_8.id]: CLAUDE_OPUS_4_8.max_output_tokens,\n [CLAUDE_FABLE_5.id]: CLAUDE_FABLE_5.max_output_tokens,\n [CLAUDE_SONNET_5.id]: CLAUDE_SONNET_5.max_output_tokens,\n}\n\n/**\n * Largest `max_tokens` the Anthropic SDK permits on a **non-streaming**\n * request. The SDK refuses to make a non-streaming call it estimates could\n * exceed its 10-minute timeout, computed as\n * `(60min * max_tokens) / 128_000 > 10min` — i.e. it throws\n * `\"Streaming is required for operations that may take longer than 10 minutes\"`\n * once `max_tokens > 128_000 * 10 / 60 ≈ 21_333`\n * (`@anthropic-ai/sdk`'s `calculateNonstreamingTimeout`). The text adapter's\n * only non-streaming call is the forced-tool `structuredOutput()` request, so\n * its defaulted ceiling must stay at or below this; the streaming chat path\n * keeps the model's full {@link getAnthropicDefaultMaxTokens} ceiling. We sit\n * just under the boundary (`21_333` would round-trip to exactly 10min). This\n * caps only the *default* — an explicit oversized `max_tokens` from the caller\n * still surfaces the SDK's \"use streaming\" error, which is the correct signal.\n */\nexport const ANTHROPIC_MAX_NONSTREAMING_TOKENS = 21_000\n\n/**\n * Resolve the default `max_tokens` for a model: its known `max_output_tokens`\n * ceiling, or {@link ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS} for unknown models.\n * Callers that pass an explicit `max_tokens` bypass this entirely.\n *\n * Pass `stream: false` for non-streaming requests (the `structuredOutput()`\n * path): the result is then clamped to {@link ANTHROPIC_MAX_NONSTREAMING_TOKENS}\n * so the defaulted ceiling doesn't trip the SDK's non-streaming 10-minute guard\n * (issue #849). Streaming requests (the default) are unaffected and get the\n * model's full ceiling.\n */\nexport function getAnthropicDefaultMaxTokens(\n model: string,\n { stream = true }: { stream?: boolean } = {},\n): number {\n const ceiling =\n ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS[model] ??\n ANTHROPIC_DEFAULT_MAX_OUTPUT_TOKENS\n return stream ? ceiling : Math.min(ceiling, ANTHROPIC_MAX_NONSTREAMING_TOKENS)\n}\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;AAAA,EAEJ,mBAAmB;AAyBrB;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAAA,EAEJ,mBAAmB;AAwBrB;AAaA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAAA,EAEJ,mBAAmB;AAyBrB;AAWA,MAAM,oBAAoB;AAAA,EAExB,IAAI;AAAA,EAEJ,mBAAmB;AAwBrB;AAWA,MAAM,mBAAmB;AAAA,EAEvB,IAAI;AAAA,EAEJ,mBAAmB;AAwBrB;AAWA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAAA,EAEJ,mBAAmB;AAwBrB;AAcA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAAA,EAEJ,mBAAmB;AAyBrB;AAcA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAAA,EAEJ,mBAAmB;AAyBrB;AAiBA,MAAM,iBAAiB;AAAA,EAErB,IAAI;AAAA,EAEJ,mBAAmB;AAyBrB;AAkBA,MAAM,kBAAkB;AAAA,EAEtB,IAAI;AAAA,EAEJ,mBAAmB;AAyBrB;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;AAaO,MAAM,sCAAsC;AAanD,MAAM,oCAA4D;AAAA,EAChE,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AAAA,EACtC,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AAAA,EACtC,CAAC,kBAAkB,EAAE,GAAG,kBAAkB;AAAA,EAC1C,CAAC,kBAAkB,EAAE,GAAG,kBAAkB;AAAA,EAC1C,CAAC,iBAAiB,EAAE,GAAG,iBAAiB;AAAA,EACxC,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AAAA,EACtC,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AAAA,EACtC,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AAAA,EACtC,CAAC,eAAe,EAAE,GAAG,eAAe;AAAA,EACpC,CAAC,gBAAgB,EAAE,GAAG,gBAAgB;AACxC;AAiBO,MAAM,oCAAoC;AAa1C,SAAS,6BACd,OACA,EAAE,SAAS,KAAA,IAA+B,CAAA,GAClC;AACR,QAAM,UACJ,kCAAkC,KAAK,KACvC;AACF,SAAO,SAAS,UAAU,KAAK,IAAI,SAAS,iCAAiC;AAC/E;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;"}
|