@ai-sdk/anthropic 2.0.108 → 2.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.d.mts +108 -138
- package/dist/index.d.ts +108 -138
- package/dist/index.js +455 -412
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +426 -380
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +6 -1
- package/dist/internal/index.d.ts +6 -1
- package/dist/internal/index.js +448 -405
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +425 -379
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "2.0.
|
|
14
|
+
var VERSION = true ? "2.0.110" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
zodSchema as zodSchema2
|
|
58
58
|
} from "@ai-sdk/provider-utils";
|
|
59
59
|
import { z as z2 } from "zod/v4";
|
|
60
|
-
var anthropicStopDetailsSchema = z2.object({
|
|
60
|
+
var anthropicStopDetailsSchema = () => z2.object({
|
|
61
61
|
type: z2.string(),
|
|
62
62
|
category: z2.string().nullish(),
|
|
63
63
|
explanation: z2.string().nullish(),
|
|
@@ -263,7 +263,7 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
263
263
|
),
|
|
264
264
|
stop_reason: z2.string().nullish(),
|
|
265
265
|
stop_sequence: z2.string().nullish(),
|
|
266
|
-
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
266
|
+
stop_details: anthropicStopDetailsSchema().nullish(),
|
|
267
267
|
usage: z2.looseObject({
|
|
268
268
|
input_tokens: z2.number(),
|
|
269
269
|
output_tokens: z2.number(),
|
|
@@ -567,7 +567,7 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
567
567
|
delta: z2.object({
|
|
568
568
|
stop_reason: z2.string().nullish(),
|
|
569
569
|
stop_sequence: z2.string().nullish(),
|
|
570
|
-
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
570
|
+
stop_details: anthropicStopDetailsSchema().nullish(),
|
|
571
571
|
container: z2.object({
|
|
572
572
|
expires_at: z2.string(),
|
|
573
573
|
id: z2.string(),
|
|
@@ -643,314 +643,330 @@ var anthropicReasoningMetadataSchema = lazySchema2(
|
|
|
643
643
|
);
|
|
644
644
|
|
|
645
645
|
// src/anthropic-messages-options.ts
|
|
646
|
+
import {
|
|
647
|
+
lazySchema as lazySchema3,
|
|
648
|
+
zodSchema as zodSchema3
|
|
649
|
+
} from "@ai-sdk/provider-utils";
|
|
646
650
|
import { z as z3 } from "zod/v4";
|
|
647
|
-
var anthropicFilePartProviderOptions =
|
|
648
|
-
|
|
649
|
-
* Citation configuration for this document.
|
|
650
|
-
* When enabled, this document will generate citations in the response.
|
|
651
|
-
*/
|
|
652
|
-
citations: z3.object({
|
|
653
|
-
/**
|
|
654
|
-
* Enable citations for this document
|
|
655
|
-
*/
|
|
656
|
-
enabled: z3.boolean()
|
|
657
|
-
}).optional(),
|
|
658
|
-
/**
|
|
659
|
-
* Custom title for the document.
|
|
660
|
-
* If not provided, the filename will be used.
|
|
661
|
-
*/
|
|
662
|
-
title: z3.string().optional(),
|
|
663
|
-
/**
|
|
664
|
-
* Context about the document that will be passed to the model
|
|
665
|
-
* but not used towards cited content.
|
|
666
|
-
* Useful for storing document metadata as text or stringified JSON.
|
|
667
|
-
*/
|
|
668
|
-
context: z3.string().optional()
|
|
669
|
-
});
|
|
670
|
-
var anthropicSystemMessageProviderOptions = z3.object({
|
|
671
|
-
/**
|
|
672
|
-
* Controls when a mid-conversation system message is cleared.
|
|
673
|
-
*
|
|
674
|
-
* The value is forwarded to Anthropic as `clear_at`. The required
|
|
675
|
-
* `mid-conversation-system-clear-at-2026-08-21` beta is added automatically.
|
|
676
|
-
*/
|
|
677
|
-
clearAt: z3.literal("next_user_message").optional(),
|
|
678
|
-
/**
|
|
679
|
-
* Sets the model effort from the next user turn until a later message
|
|
680
|
-
* changes it. An effort-only system message with empty content can appear
|
|
681
|
-
* first. The required `mid-conversation-output-config-2026-07-01` beta is
|
|
682
|
-
* added automatically.
|
|
683
|
-
*/
|
|
684
|
-
effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
685
|
-
/**
|
|
686
|
-
* Mid-conversation tool changes. Adds or removes tools from the
|
|
687
|
-
* conversation's tool set between turns without invalidating the prompt
|
|
688
|
-
* cache.
|
|
689
|
-
*
|
|
690
|
-
* Only supported on system messages that appear mid-conversation (not the
|
|
691
|
-
* initial system prompt). A system message carrying tool changes must come
|
|
692
|
-
* right before an assistant message or at the end of the messages.
|
|
693
|
-
*
|
|
694
|
-
* Tools referenced by a `tool_addition` must be declared in the `tools`
|
|
695
|
-
* option (typically with `deferLoading: true` so they are not loaded until
|
|
696
|
-
* the addition surfaces them). The required
|
|
697
|
-
* `mid-conversation-tool-changes-2026-07-01` beta is added automatically.
|
|
698
|
-
*/
|
|
699
|
-
toolChanges: z3.array(
|
|
700
|
-
z3.discriminatedUnion("type", [
|
|
701
|
-
z3.object({
|
|
702
|
-
type: z3.literal("tool_addition"),
|
|
703
|
-
toolName: z3.string()
|
|
704
|
-
}),
|
|
705
|
-
z3.object({
|
|
706
|
-
type: z3.literal("tool_removal"),
|
|
707
|
-
toolName: z3.string()
|
|
708
|
-
})
|
|
709
|
-
])
|
|
710
|
-
).optional()
|
|
711
|
-
});
|
|
712
|
-
var anthropicThinkingBlockBinding = z3.object({
|
|
713
|
-
/**
|
|
714
|
-
* Controls behavior when a replayed thinking block does not match its
|
|
715
|
-
* conversation prefix. The `drop_block` behavior drops the mismatched block
|
|
716
|
-
* instead of returning an invalid signature error.
|
|
717
|
-
*/
|
|
718
|
-
prefixMismatchBehavior: z3.literal("drop_block")
|
|
719
|
-
});
|
|
720
|
-
var anthropicProviderOptions = z3.object({
|
|
721
|
-
/**
|
|
722
|
-
* Whether to send reasoning to the model.
|
|
723
|
-
*
|
|
724
|
-
* This allows you to deactivate reasoning inputs for models that do not support them.
|
|
725
|
-
*/
|
|
726
|
-
sendReasoning: z3.boolean().optional(),
|
|
727
|
-
/**
|
|
728
|
-
* Determines how structured outputs are generated.
|
|
729
|
-
*
|
|
730
|
-
* - `outputFormat`: Use the `output_format` parameter to specify the structured output format.
|
|
731
|
-
* - `jsonTool`: Use a special JSON response tool to specify the structured output format (default for most models).
|
|
732
|
-
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Sonnet 5.5, Opus 5.5, and Fable 5.1).
|
|
733
|
-
*/
|
|
734
|
-
structuredOutputMode: z3.enum(["outputFormat", "jsonTool", "auto"]).optional(),
|
|
735
|
-
/**
|
|
736
|
-
* Configuration for enabling Claude's extended thinking.
|
|
737
|
-
*
|
|
738
|
-
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
739
|
-
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
740
|
-
*
|
|
741
|
-
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
742
|
-
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
743
|
-
* provider drops the unsupported setting, emits a warning, and sends an
|
|
744
|
-
* adaptive thinking request. Use `effort` to control how much they think.
|
|
745
|
-
*
|
|
746
|
-
* `claude-sonnet-5-5` supports `between_tools`, its lowest thinking setting,
|
|
747
|
-
* and the provider uses it in place of `disabled` for that model.
|
|
748
|
-
*/
|
|
749
|
-
thinking: z3.union([
|
|
651
|
+
var anthropicFilePartProviderOptions = lazySchema3(
|
|
652
|
+
() => zodSchema3(
|
|
750
653
|
z3.object({
|
|
751
|
-
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
752
|
-
type: z3.literal("adaptive"),
|
|
753
654
|
/**
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
* - `"summarized"`: Thinking content is returned. Required to see reasoning output.
|
|
757
|
-
* - `"updates"`: Thinking summaries are emitted between tool calls.
|
|
655
|
+
* Citation configuration for this document.
|
|
656
|
+
* When enabled, this document will generate citations in the response.
|
|
758
657
|
*/
|
|
759
|
-
|
|
658
|
+
citations: z3.object({
|
|
659
|
+
/**
|
|
660
|
+
* Enable citations for this document
|
|
661
|
+
*/
|
|
662
|
+
enabled: z3.boolean()
|
|
663
|
+
}).optional(),
|
|
760
664
|
/**
|
|
761
|
-
*
|
|
762
|
-
*
|
|
665
|
+
* Custom title for the document.
|
|
666
|
+
* If not provided, the filename will be used.
|
|
763
667
|
*/
|
|
764
|
-
|
|
765
|
-
}),
|
|
766
|
-
z3.object({
|
|
767
|
-
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
768
|
-
type: z3.literal("enabled"),
|
|
769
|
-
budgetTokens: z3.number().optional(),
|
|
668
|
+
title: z3.string().optional(),
|
|
770
669
|
/**
|
|
771
|
-
*
|
|
772
|
-
*
|
|
670
|
+
* Context about the document that will be passed to the model
|
|
671
|
+
* but not used towards cited content.
|
|
672
|
+
* Useful for storing document metadata as text or stringified JSON.
|
|
773
673
|
*/
|
|
774
|
-
|
|
775
|
-
})
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
674
|
+
context: z3.string().optional()
|
|
675
|
+
})
|
|
676
|
+
)
|
|
677
|
+
);
|
|
678
|
+
var anthropicSystemMessageProviderOptions = lazySchema3(
|
|
679
|
+
() => zodSchema3(
|
|
779
680
|
z3.object({
|
|
780
681
|
/**
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
682
|
+
* Controls when a mid-conversation system message is cleared.
|
|
683
|
+
*
|
|
684
|
+
* The value is forwarded to Anthropic as `clear_at`. The required
|
|
685
|
+
* `mid-conversation-system-clear-at-2026-08-21` beta is added automatically.
|
|
784
686
|
*/
|
|
785
|
-
|
|
786
|
-
}),
|
|
787
|
-
z3.object({
|
|
687
|
+
clearAt: z3.literal("next_user_message").optional(),
|
|
788
688
|
/**
|
|
789
|
-
*
|
|
790
|
-
*
|
|
689
|
+
* Sets the model effort from the next user turn until a later message
|
|
690
|
+
* changes it. An effort-only system message with empty content can appear
|
|
691
|
+
* first. The required `mid-conversation-output-config-2026-07-01` beta is
|
|
692
|
+
* added automatically.
|
|
791
693
|
*/
|
|
792
|
-
|
|
694
|
+
effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
695
|
+
/**
|
|
696
|
+
* Mid-conversation tool changes. Adds or removes tools from the
|
|
697
|
+
* conversation's tool set between turns without invalidating the prompt
|
|
698
|
+
* cache.
|
|
699
|
+
*
|
|
700
|
+
* Only supported on system messages that appear mid-conversation (not the
|
|
701
|
+
* initial system prompt). A system message carrying tool changes must come
|
|
702
|
+
* right before an assistant message or at the end of the messages.
|
|
703
|
+
*
|
|
704
|
+
* Tools referenced by a `tool_addition` must be declared in the `tools`
|
|
705
|
+
* option (typically with `deferLoading: true` so they are not loaded until
|
|
706
|
+
* the addition surfaces them). The required
|
|
707
|
+
* `mid-conversation-tool-changes-2026-07-01` beta is added automatically.
|
|
708
|
+
*/
|
|
709
|
+
toolChanges: z3.array(
|
|
710
|
+
z3.discriminatedUnion("type", [
|
|
711
|
+
z3.object({
|
|
712
|
+
type: z3.literal("tool_addition"),
|
|
713
|
+
toolName: z3.string()
|
|
714
|
+
}),
|
|
715
|
+
z3.object({
|
|
716
|
+
type: z3.literal("tool_removal"),
|
|
717
|
+
toolName: z3.string()
|
|
718
|
+
})
|
|
719
|
+
])
|
|
720
|
+
).optional()
|
|
793
721
|
})
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
*/
|
|
799
|
-
disableParallelToolUse: z3.boolean().optional(),
|
|
800
|
-
/**
|
|
801
|
-
* Cache control settings for this message.
|
|
802
|
-
* See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
|
|
803
|
-
*/
|
|
804
|
-
cacheControl: z3.object({
|
|
805
|
-
type: z3.literal("ephemeral"),
|
|
806
|
-
ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
|
|
807
|
-
}).optional(),
|
|
808
|
-
/**
|
|
809
|
-
* Metadata to include with the request.
|
|
810
|
-
*
|
|
811
|
-
* See https://platform.claude.com/docs/en/api/messages/create for details.
|
|
812
|
-
*/
|
|
813
|
-
metadata: z3.object({
|
|
722
|
+
)
|
|
723
|
+
);
|
|
724
|
+
var anthropicProviderOptions = lazySchema3(() => {
|
|
725
|
+
const anthropicThinkingBlockBinding = z3.object({
|
|
814
726
|
/**
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
* Must not contain PII (name, email, phone number, etc.).
|
|
727
|
+
* Controls behavior when a replayed thinking block does not match its
|
|
728
|
+
* conversation prefix. The `drop_block` behavior drops the mismatched block
|
|
729
|
+
* instead of returning an invalid signature error.
|
|
819
730
|
*/
|
|
820
|
-
|
|
821
|
-
})
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Enable fast mode for faster inference (2.5x faster output token speeds).
|
|
855
|
-
* Only supported with claude-opus-4-6.
|
|
856
|
-
*/
|
|
857
|
-
speed: z3.enum(["fast", "standard"]).optional(),
|
|
858
|
-
/**
|
|
859
|
-
* Controls where model inference runs for this request.
|
|
860
|
-
*
|
|
861
|
-
* - `"global"`: Inference may run in any available geography (default).
|
|
862
|
-
* - `"us"`: Inference runs only in US-based infrastructure.
|
|
863
|
-
*
|
|
864
|
-
* See https://platform.claude.com/docs/en/build-with-claude/data-residency
|
|
865
|
-
*/
|
|
866
|
-
inferenceGeo: z3.enum(["us", "global"]).optional(),
|
|
867
|
-
/**
|
|
868
|
-
* Server-side fallback configuration.
|
|
869
|
-
*
|
|
870
|
-
* When the primary model's safety classifiers block a turn, the API
|
|
871
|
-
* automatically retries it server-side on a fallback model. A
|
|
872
|
-
* `content-filter` finish reason means the fallback(s) refused as well.
|
|
873
|
-
*
|
|
874
|
-
* - `'default'` (recommended): the API routes the retry to Anthropic's
|
|
875
|
-
* recommended fallback model based on the refusal category. Requires the
|
|
876
|
-
* `server-side-fallback-2026-07-01` beta, which is added automatically.
|
|
877
|
-
* - Array form: an explicit fallback chain. Each entry is merged into the
|
|
878
|
-
* request as a direct request to that entry's model, so it must be
|
|
879
|
-
* formatted accordingly: `model` is required, and an entry may
|
|
880
|
-
* additionally override `max_tokens`, `thinking`, `output_config`, and
|
|
881
|
-
* `speed` for that attempt only (`speed` additionally requires the speed
|
|
882
|
-
* beta). The value is passed through to the API as-is, and the
|
|
883
|
-
* `server-side-fallback-2026-06-01` beta is added automatically.
|
|
884
|
-
*/
|
|
885
|
-
fallbacks: z3.union([
|
|
886
|
-
z3.literal("default"),
|
|
887
|
-
z3.array(
|
|
888
|
-
z3.object({
|
|
889
|
-
model: z3.string(),
|
|
890
|
-
max_tokens: z3.number().int().optional(),
|
|
891
|
-
thinking: z3.record(z3.string(), z3.unknown()).optional(),
|
|
892
|
-
output_config: z3.record(z3.string(), z3.unknown()).optional(),
|
|
893
|
-
speed: z3.enum(["fast", "standard"]).optional()
|
|
894
|
-
})
|
|
895
|
-
)
|
|
896
|
-
]).optional(),
|
|
897
|
-
/**
|
|
898
|
-
* Context management configuration for automatic context window management.
|
|
899
|
-
* Enables features like automatic compaction and clearing of tool uses/thinking blocks.
|
|
900
|
-
*/
|
|
901
|
-
contextManagement: z3.object({
|
|
902
|
-
edits: z3.array(
|
|
903
|
-
z3.discriminatedUnion("type", [
|
|
731
|
+
prefixMismatchBehavior: z3.literal("drop_block")
|
|
732
|
+
});
|
|
733
|
+
return zodSchema3(
|
|
734
|
+
z3.object({
|
|
735
|
+
/**
|
|
736
|
+
* Whether to send reasoning to the model.
|
|
737
|
+
*
|
|
738
|
+
* This allows you to deactivate reasoning inputs for models that do not support them.
|
|
739
|
+
*/
|
|
740
|
+
sendReasoning: z3.boolean().optional(),
|
|
741
|
+
/**
|
|
742
|
+
* Determines how structured outputs are generated.
|
|
743
|
+
*
|
|
744
|
+
* - `outputFormat`: Use the `output_format` parameter to specify the structured output format.
|
|
745
|
+
* - `jsonTool`: Use a special JSON response tool to specify the structured output format (default for most models).
|
|
746
|
+
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default for Sonnet 5.5, Opus 5.5, and Fable 5.1).
|
|
747
|
+
*/
|
|
748
|
+
structuredOutputMode: z3.enum(["outputFormat", "jsonTool", "auto"]).optional(),
|
|
749
|
+
/**
|
|
750
|
+
* Configuration for enabling Claude's extended thinking.
|
|
751
|
+
*
|
|
752
|
+
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
753
|
+
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
754
|
+
*
|
|
755
|
+
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
756
|
+
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
757
|
+
* provider drops the unsupported setting, emits a warning, and sends an
|
|
758
|
+
* adaptive thinking request. Use `effort` to control how much they think.
|
|
759
|
+
*
|
|
760
|
+
* `claude-sonnet-5-5` supports `between_tools`, its lowest thinking setting,
|
|
761
|
+
* and the provider uses it in place of `disabled` for that model.
|
|
762
|
+
*/
|
|
763
|
+
thinking: z3.union([
|
|
904
764
|
z3.object({
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
}).optional(),
|
|
920
|
-
clearAtLeast: z3.object({
|
|
921
|
-
type: z3.literal("input_tokens"),
|
|
922
|
-
value: z3.number()
|
|
923
|
-
}).optional(),
|
|
924
|
-
clearToolInputs: z3.boolean().optional(),
|
|
925
|
-
excludeTools: z3.array(z3.string()).optional()
|
|
765
|
+
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
766
|
+
type: z3.literal("adaptive"),
|
|
767
|
+
/**
|
|
768
|
+
* Controls whether thinking content is included in the response.
|
|
769
|
+
* - `"omitted"`: Thinking blocks are present but text is empty (default for Opus 4.7+).
|
|
770
|
+
* - `"summarized"`: Thinking content is returned. Required to see reasoning output.
|
|
771
|
+
* - `"updates"`: Thinking summaries are emitted between tool calls.
|
|
772
|
+
*/
|
|
773
|
+
display: z3.enum(["omitted", "summarized", "updates"]).optional(),
|
|
774
|
+
/**
|
|
775
|
+
* Controls handling for thinking blocks whose conversation prefix no
|
|
776
|
+
* longer matches. Forwarded as `block_binding`.
|
|
777
|
+
*/
|
|
778
|
+
blockBinding: anthropicThinkingBlockBinding.optional()
|
|
926
779
|
}),
|
|
927
780
|
z3.object({
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
781
|
+
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
782
|
+
type: z3.literal("enabled"),
|
|
783
|
+
budgetTokens: z3.number().optional(),
|
|
784
|
+
/**
|
|
785
|
+
* Controls handling for thinking blocks whose conversation prefix no
|
|
786
|
+
* longer matches. Forwarded as `block_binding`.
|
|
787
|
+
*/
|
|
788
|
+
blockBinding: anthropicThinkingBlockBinding.optional()
|
|
789
|
+
}),
|
|
790
|
+
z3.object({
|
|
791
|
+
type: z3.literal("disabled")
|
|
792
|
+
}),
|
|
793
|
+
z3.object({
|
|
794
|
+
/**
|
|
795
|
+
* for `claude-sonnet-5-5`: no upfront thinking, but progress notes
|
|
796
|
+
* between tool calls are returned as summarized thinking blocks.
|
|
797
|
+
* Only supported at `low`, `medium`, and `high` effort.
|
|
798
|
+
*/
|
|
799
|
+
type: z3.literal("between_tools")
|
|
936
800
|
}),
|
|
937
801
|
z3.object({
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
pauseAfterCompaction: z3.boolean().optional(),
|
|
944
|
-
instructions: z3.string().optional()
|
|
802
|
+
/**
|
|
803
|
+
* Configure prefix mismatch handling without changing the model's
|
|
804
|
+
* default thinking mode.
|
|
805
|
+
*/
|
|
806
|
+
blockBinding: anthropicThinkingBlockBinding
|
|
945
807
|
})
|
|
946
|
-
])
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
808
|
+
]).optional(),
|
|
809
|
+
/**
|
|
810
|
+
* Whether to disable parallel function calling during tool use. Default is false.
|
|
811
|
+
* When set to true, Claude will use at most one tool per response.
|
|
812
|
+
*/
|
|
813
|
+
disableParallelToolUse: z3.boolean().optional(),
|
|
814
|
+
/**
|
|
815
|
+
* Cache control settings for this message.
|
|
816
|
+
* See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
|
|
817
|
+
*/
|
|
818
|
+
cacheControl: z3.object({
|
|
819
|
+
type: z3.literal("ephemeral"),
|
|
820
|
+
ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
|
|
821
|
+
}).optional(),
|
|
822
|
+
/**
|
|
823
|
+
* Metadata to include with the request.
|
|
824
|
+
*
|
|
825
|
+
* See https://platform.claude.com/docs/en/api/messages/create for details.
|
|
826
|
+
*/
|
|
827
|
+
metadata: z3.object({
|
|
828
|
+
/**
|
|
829
|
+
* An external identifier for the user associated with the request.
|
|
830
|
+
*
|
|
831
|
+
* Should be a UUID, hash value, or other opaque identifier.
|
|
832
|
+
* Must not contain PII (name, email, phone number, etc.).
|
|
833
|
+
*/
|
|
834
|
+
userId: z3.string().optional()
|
|
835
|
+
}).optional(),
|
|
836
|
+
/**
|
|
837
|
+
* Agent Skills configuration. Skills enable Claude to perform specialized tasks
|
|
838
|
+
* like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
|
|
839
|
+
* Requires code execution tool to be enabled.
|
|
840
|
+
*/
|
|
841
|
+
container: z3.object({
|
|
842
|
+
id: z3.string().optional(),
|
|
843
|
+
skills: z3.array(
|
|
844
|
+
z3.object({
|
|
845
|
+
type: z3.union([z3.literal("anthropic"), z3.literal("custom")]),
|
|
846
|
+
skillId: z3.string(),
|
|
847
|
+
version: z3.string().optional()
|
|
848
|
+
})
|
|
849
|
+
).optional()
|
|
850
|
+
}).optional(),
|
|
851
|
+
/**
|
|
852
|
+
* @default 'high'
|
|
853
|
+
*/
|
|
854
|
+
effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
855
|
+
/**
|
|
856
|
+
* Task budget for agentic turns. Informs the model of the total token budget
|
|
857
|
+
* available for the current task, allowing it to prioritize work and wind down
|
|
858
|
+
* gracefully as the budget is consumed.
|
|
859
|
+
*
|
|
860
|
+
* Advisory only — does not enforce a hard token limit.
|
|
861
|
+
*/
|
|
862
|
+
taskBudget: z3.object({
|
|
863
|
+
type: z3.literal("tokens"),
|
|
864
|
+
total: z3.number().int().min(2e4),
|
|
865
|
+
remaining: z3.number().int().min(0).optional()
|
|
866
|
+
}).optional(),
|
|
867
|
+
/**
|
|
868
|
+
* Enable fast mode for faster inference (2.5x faster output token speeds).
|
|
869
|
+
* Only supported with claude-opus-4-6.
|
|
870
|
+
*/
|
|
871
|
+
speed: z3.enum(["fast", "standard"]).optional(),
|
|
872
|
+
/**
|
|
873
|
+
* Controls where model inference runs for this request.
|
|
874
|
+
*
|
|
875
|
+
* - `"global"`: Inference may run in any available geography (default).
|
|
876
|
+
* - `"us"`: Inference runs only in US-based infrastructure.
|
|
877
|
+
*
|
|
878
|
+
* See https://platform.claude.com/docs/en/build-with-claude/data-residency
|
|
879
|
+
*/
|
|
880
|
+
inferenceGeo: z3.enum(["us", "global"]).optional(),
|
|
881
|
+
/**
|
|
882
|
+
* Server-side fallback configuration.
|
|
883
|
+
*
|
|
884
|
+
* When the primary model's safety classifiers block a turn, the API
|
|
885
|
+
* automatically retries it server-side on a fallback model. A
|
|
886
|
+
* `content-filter` finish reason means the fallback(s) refused as well.
|
|
887
|
+
*
|
|
888
|
+
* - `'default'` (recommended): the API routes the retry to Anthropic's
|
|
889
|
+
* recommended fallback model based on the refusal category. Requires the
|
|
890
|
+
* `server-side-fallback-2026-07-01` beta, which is added automatically.
|
|
891
|
+
* - Array form: an explicit fallback chain. Each entry is merged into the
|
|
892
|
+
* request as a direct request to that entry's model, so it must be
|
|
893
|
+
* formatted accordingly: `model` is required, and an entry may
|
|
894
|
+
* additionally override `max_tokens`, `thinking`, `output_config`, and
|
|
895
|
+
* `speed` for that attempt only (`speed` additionally requires the speed
|
|
896
|
+
* beta). The value is passed through to the API as-is, and the
|
|
897
|
+
* `server-side-fallback-2026-06-01` beta is added automatically.
|
|
898
|
+
*/
|
|
899
|
+
fallbacks: z3.union([
|
|
900
|
+
z3.literal("default"),
|
|
901
|
+
z3.array(
|
|
902
|
+
z3.object({
|
|
903
|
+
model: z3.string(),
|
|
904
|
+
max_tokens: z3.number().int().optional(),
|
|
905
|
+
thinking: z3.record(z3.string(), z3.unknown()).optional(),
|
|
906
|
+
output_config: z3.record(z3.string(), z3.unknown()).optional(),
|
|
907
|
+
speed: z3.enum(["fast", "standard"]).optional()
|
|
908
|
+
})
|
|
909
|
+
)
|
|
910
|
+
]).optional(),
|
|
911
|
+
/**
|
|
912
|
+
* Context management configuration for automatic context window management.
|
|
913
|
+
* Enables features like automatic compaction and clearing of tool uses/thinking blocks.
|
|
914
|
+
*/
|
|
915
|
+
contextManagement: z3.object({
|
|
916
|
+
edits: z3.array(
|
|
917
|
+
z3.discriminatedUnion("type", [
|
|
918
|
+
z3.object({
|
|
919
|
+
type: z3.literal("clear_tool_uses_20250919"),
|
|
920
|
+
trigger: z3.discriminatedUnion("type", [
|
|
921
|
+
z3.object({
|
|
922
|
+
type: z3.literal("input_tokens"),
|
|
923
|
+
value: z3.number()
|
|
924
|
+
}),
|
|
925
|
+
z3.object({
|
|
926
|
+
type: z3.literal("tool_uses"),
|
|
927
|
+
value: z3.number()
|
|
928
|
+
})
|
|
929
|
+
]).optional(),
|
|
930
|
+
keep: z3.object({
|
|
931
|
+
type: z3.literal("tool_uses"),
|
|
932
|
+
value: z3.number()
|
|
933
|
+
}).optional(),
|
|
934
|
+
clearAtLeast: z3.object({
|
|
935
|
+
type: z3.literal("input_tokens"),
|
|
936
|
+
value: z3.number()
|
|
937
|
+
}).optional(),
|
|
938
|
+
clearToolInputs: z3.boolean().optional(),
|
|
939
|
+
excludeTools: z3.array(z3.string()).optional()
|
|
940
|
+
}),
|
|
941
|
+
z3.object({
|
|
942
|
+
type: z3.literal("clear_thinking_20251015"),
|
|
943
|
+
keep: z3.union([
|
|
944
|
+
z3.literal("all"),
|
|
945
|
+
z3.object({
|
|
946
|
+
type: z3.literal("thinking_turns"),
|
|
947
|
+
value: z3.number()
|
|
948
|
+
})
|
|
949
|
+
]).optional()
|
|
950
|
+
}),
|
|
951
|
+
z3.object({
|
|
952
|
+
type: z3.literal("compact_20260112"),
|
|
953
|
+
trigger: z3.object({
|
|
954
|
+
type: z3.literal("input_tokens"),
|
|
955
|
+
value: z3.number()
|
|
956
|
+
}).optional(),
|
|
957
|
+
pauseAfterCompaction: z3.boolean().optional(),
|
|
958
|
+
instructions: z3.string().optional()
|
|
959
|
+
})
|
|
960
|
+
])
|
|
961
|
+
)
|
|
962
|
+
}).optional(),
|
|
963
|
+
/**
|
|
964
|
+
* A set of beta features to enable.
|
|
965
|
+
* Allow a provider to receive the full `betas` set if it needs it.
|
|
966
|
+
*/
|
|
967
|
+
anthropicBeta: z3.array(z3.string()).optional()
|
|
968
|
+
})
|
|
969
|
+
);
|
|
954
970
|
});
|
|
955
971
|
|
|
956
972
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1003,8 +1019,8 @@ var CacheControlValidator = class {
|
|
|
1003
1019
|
// src/tool/computer-toolset_20260801.ts
|
|
1004
1020
|
import {
|
|
1005
1021
|
createProviderDefinedToolFactory,
|
|
1006
|
-
lazySchema as
|
|
1007
|
-
zodSchema as
|
|
1022
|
+
lazySchema as lazySchema4,
|
|
1023
|
+
zodSchema as zodSchema4
|
|
1008
1024
|
} from "@ai-sdk/provider-utils";
|
|
1009
1025
|
import { z as z4 } from "zod/v4";
|
|
1010
1026
|
var computerToolset_20260801Members = [
|
|
@@ -1026,8 +1042,8 @@ var computerToolset_20260801Members = [
|
|
|
1026
1042
|
"hold_key",
|
|
1027
1043
|
"wait"
|
|
1028
1044
|
];
|
|
1029
|
-
var computerToolset_20260801InputSchema =
|
|
1030
|
-
() =>
|
|
1045
|
+
var computerToolset_20260801InputSchema = lazySchema4(
|
|
1046
|
+
() => zodSchema4(
|
|
1031
1047
|
z4.object({
|
|
1032
1048
|
action: z4.enum(computerToolset_20260801Members),
|
|
1033
1049
|
coordinate: z4.tuple([z4.number().int(), z4.number().int()]).optional(),
|
|
@@ -1046,8 +1062,8 @@ var computerToolset_20260801InputSchema = lazySchema3(
|
|
|
1046
1062
|
})
|
|
1047
1063
|
)
|
|
1048
1064
|
);
|
|
1049
|
-
var computerToolset_20260801ArgsSchema =
|
|
1050
|
-
() =>
|
|
1065
|
+
var computerToolset_20260801ArgsSchema = lazySchema4(
|
|
1066
|
+
() => zodSchema4(
|
|
1051
1067
|
z4.object({
|
|
1052
1068
|
configs: z4.partialRecord(
|
|
1053
1069
|
z4.enum(computerToolset_20260801Members),
|
|
@@ -1068,19 +1084,19 @@ var computerToolset_20260801 = createProviderDefinedToolFactory({
|
|
|
1068
1084
|
// src/tool/text-editor_20250728.ts
|
|
1069
1085
|
import {
|
|
1070
1086
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
|
1071
|
-
lazySchema as
|
|
1072
|
-
zodSchema as
|
|
1087
|
+
lazySchema as lazySchema5,
|
|
1088
|
+
zodSchema as zodSchema5
|
|
1073
1089
|
} from "@ai-sdk/provider-utils";
|
|
1074
1090
|
import { z as z5 } from "zod/v4";
|
|
1075
|
-
var textEditor_20250728ArgsSchema =
|
|
1076
|
-
() =>
|
|
1091
|
+
var textEditor_20250728ArgsSchema = lazySchema5(
|
|
1092
|
+
() => zodSchema5(
|
|
1077
1093
|
z5.object({
|
|
1078
1094
|
maxCharacters: z5.number().optional()
|
|
1079
1095
|
})
|
|
1080
1096
|
)
|
|
1081
1097
|
);
|
|
1082
|
-
var textEditor_20250728InputSchema =
|
|
1083
|
-
() =>
|
|
1098
|
+
var textEditor_20250728InputSchema = lazySchema5(
|
|
1099
|
+
() => zodSchema5(
|
|
1084
1100
|
z5.object({
|
|
1085
1101
|
command: z5.enum(["view", "create", "str_replace", "insert"]),
|
|
1086
1102
|
path: z5.string(),
|
|
@@ -1104,12 +1120,12 @@ var textEditor_20250728 = (args = {}) => {
|
|
|
1104
1120
|
// src/tool/web-search_20250305.ts
|
|
1105
1121
|
import {
|
|
1106
1122
|
createProviderDefinedToolFactoryWithOutputSchema,
|
|
1107
|
-
lazySchema as
|
|
1108
|
-
zodSchema as
|
|
1123
|
+
lazySchema as lazySchema6,
|
|
1124
|
+
zodSchema as zodSchema6
|
|
1109
1125
|
} from "@ai-sdk/provider-utils";
|
|
1110
1126
|
import { z as z6 } from "zod/v4";
|
|
1111
|
-
var webSearch_20250305ArgsSchema =
|
|
1112
|
-
() =>
|
|
1127
|
+
var webSearch_20250305ArgsSchema = lazySchema6(
|
|
1128
|
+
() => zodSchema6(
|
|
1113
1129
|
z6.object({
|
|
1114
1130
|
maxUses: z6.number().optional(),
|
|
1115
1131
|
allowedDomains: z6.array(z6.string()).optional(),
|
|
@@ -1124,8 +1140,8 @@ var webSearch_20250305ArgsSchema = lazySchema5(
|
|
|
1124
1140
|
})
|
|
1125
1141
|
)
|
|
1126
1142
|
);
|
|
1127
|
-
var webSearch_20250305OutputSchema =
|
|
1128
|
-
() =>
|
|
1143
|
+
var webSearch_20250305OutputSchema = lazySchema6(
|
|
1144
|
+
() => zodSchema6(
|
|
1129
1145
|
z6.array(
|
|
1130
1146
|
z6.object({
|
|
1131
1147
|
url: z6.string(),
|
|
@@ -1137,8 +1153,8 @@ var webSearch_20250305OutputSchema = lazySchema5(
|
|
|
1137
1153
|
)
|
|
1138
1154
|
)
|
|
1139
1155
|
);
|
|
1140
|
-
var webSearch_20250305InputSchema =
|
|
1141
|
-
() =>
|
|
1156
|
+
var webSearch_20250305InputSchema = lazySchema6(
|
|
1157
|
+
() => zodSchema6(
|
|
1142
1158
|
z6.object({
|
|
1143
1159
|
query: z6.string()
|
|
1144
1160
|
})
|
|
@@ -1157,12 +1173,12 @@ var webSearch_20250305 = (args = {}) => {
|
|
|
1157
1173
|
// src/tool/web-fetch-20250910.ts
|
|
1158
1174
|
import {
|
|
1159
1175
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
|
|
1160
|
-
lazySchema as
|
|
1161
|
-
zodSchema as
|
|
1176
|
+
lazySchema as lazySchema7,
|
|
1177
|
+
zodSchema as zodSchema7
|
|
1162
1178
|
} from "@ai-sdk/provider-utils";
|
|
1163
1179
|
import { z as z7 } from "zod/v4";
|
|
1164
|
-
var webFetch_20250910ArgsSchema =
|
|
1165
|
-
() =>
|
|
1180
|
+
var webFetch_20250910ArgsSchema = lazySchema7(
|
|
1181
|
+
() => zodSchema7(
|
|
1166
1182
|
z7.object({
|
|
1167
1183
|
maxUses: z7.number().optional(),
|
|
1168
1184
|
allowedDomains: z7.array(z7.string()).optional(),
|
|
@@ -1172,8 +1188,8 @@ var webFetch_20250910ArgsSchema = lazySchema6(
|
|
|
1172
1188
|
})
|
|
1173
1189
|
)
|
|
1174
1190
|
);
|
|
1175
|
-
var webFetch_20250910OutputSchema =
|
|
1176
|
-
() =>
|
|
1191
|
+
var webFetch_20250910OutputSchema = lazySchema7(
|
|
1192
|
+
() => zodSchema7(
|
|
1177
1193
|
z7.object({
|
|
1178
1194
|
type: z7.literal("web_fetch_result"),
|
|
1179
1195
|
url: z7.string(),
|
|
@@ -1198,8 +1214,8 @@ var webFetch_20250910OutputSchema = lazySchema6(
|
|
|
1198
1214
|
})
|
|
1199
1215
|
)
|
|
1200
1216
|
);
|
|
1201
|
-
var webFetch_20250910InputSchema =
|
|
1202
|
-
() =>
|
|
1217
|
+
var webFetch_20250910InputSchema = lazySchema7(
|
|
1218
|
+
() => zodSchema7(
|
|
1203
1219
|
z7.object({
|
|
1204
1220
|
url: z7.string()
|
|
1205
1221
|
})
|
|
@@ -1538,12 +1554,12 @@ import {
|
|
|
1538
1554
|
// src/tool/code-execution_20250522.ts
|
|
1539
1555
|
import {
|
|
1540
1556
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
|
|
1541
|
-
lazySchema as
|
|
1542
|
-
zodSchema as
|
|
1557
|
+
lazySchema as lazySchema8,
|
|
1558
|
+
zodSchema as zodSchema8
|
|
1543
1559
|
} from "@ai-sdk/provider-utils";
|
|
1544
1560
|
import { z as z8 } from "zod/v4";
|
|
1545
|
-
var codeExecution_20250522OutputSchema =
|
|
1546
|
-
() =>
|
|
1561
|
+
var codeExecution_20250522OutputSchema = lazySchema8(
|
|
1562
|
+
() => zodSchema8(
|
|
1547
1563
|
z8.object({
|
|
1548
1564
|
type: z8.literal("code_execution_result"),
|
|
1549
1565
|
stdout: z8.string(),
|
|
@@ -1552,8 +1568,8 @@ var codeExecution_20250522OutputSchema = lazySchema7(
|
|
|
1552
1568
|
})
|
|
1553
1569
|
)
|
|
1554
1570
|
);
|
|
1555
|
-
var codeExecution_20250522InputSchema =
|
|
1556
|
-
() =>
|
|
1571
|
+
var codeExecution_20250522InputSchema = lazySchema8(
|
|
1572
|
+
() => zodSchema8(
|
|
1557
1573
|
z8.object({
|
|
1558
1574
|
code: z8.string()
|
|
1559
1575
|
})
|
|
@@ -1572,12 +1588,12 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
1572
1588
|
// src/tool/code-execution_20250825.ts
|
|
1573
1589
|
import {
|
|
1574
1590
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
|
|
1575
|
-
lazySchema as
|
|
1576
|
-
zodSchema as
|
|
1591
|
+
lazySchema as lazySchema9,
|
|
1592
|
+
zodSchema as zodSchema9
|
|
1577
1593
|
} from "@ai-sdk/provider-utils";
|
|
1578
1594
|
import { z as z9 } from "zod/v4";
|
|
1579
|
-
var codeExecution_20250825OutputSchema =
|
|
1580
|
-
() =>
|
|
1595
|
+
var codeExecution_20250825OutputSchema = lazySchema9(
|
|
1596
|
+
() => zodSchema9(
|
|
1581
1597
|
z9.discriminatedUnion("type", [
|
|
1582
1598
|
z9.object({
|
|
1583
1599
|
type: z9.literal("bash_code_execution_result"),
|
|
@@ -1622,8 +1638,8 @@ var codeExecution_20250825OutputSchema = lazySchema8(
|
|
|
1622
1638
|
])
|
|
1623
1639
|
)
|
|
1624
1640
|
);
|
|
1625
|
-
var codeExecution_20250825InputSchema =
|
|
1626
|
-
() =>
|
|
1641
|
+
var codeExecution_20250825InputSchema = lazySchema9(
|
|
1642
|
+
() => zodSchema9(
|
|
1627
1643
|
z9.discriminatedUnion("type", [
|
|
1628
1644
|
z9.object({
|
|
1629
1645
|
type: z9.literal("bash_code_execution"),
|
|
@@ -2679,6 +2695,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2679
2695
|
rejectsSamplingParameters,
|
|
2680
2696
|
rejectsThinkingDisabledAboveHighEffort,
|
|
2681
2697
|
rejectsThinkingDisabled,
|
|
2698
|
+
rejectsBudgetThinking,
|
|
2682
2699
|
rejectsForcedToolUse,
|
|
2683
2700
|
supportsBetweenToolsThinking,
|
|
2684
2701
|
isKnownModel
|
|
@@ -2765,20 +2782,22 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2765
2782
|
details: `thinking cannot be disabled for ${this.modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
2766
2783
|
});
|
|
2767
2784
|
anthropicOptions.thinking = void 0;
|
|
2768
|
-
} else if ("type" in thinking && thinking.type === "enabled") {
|
|
2769
|
-
warnings.push({
|
|
2770
|
-
type: "unsupported-setting",
|
|
2771
|
-
setting: "providerOptions.anthropic.thinking",
|
|
2772
|
-
details: `budget-based thinking is not supported by ${this.modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
|
|
2773
|
-
});
|
|
2774
|
-
anthropicOptions.thinking = {
|
|
2775
|
-
type: "adaptive",
|
|
2776
|
-
...thinking.blockBinding != null && {
|
|
2777
|
-
blockBinding: thinking.blockBinding
|
|
2778
|
-
}
|
|
2779
|
-
};
|
|
2780
2785
|
}
|
|
2781
2786
|
}
|
|
2787
|
+
const budgetThinking = anthropicOptions == null ? void 0 : anthropicOptions.thinking;
|
|
2788
|
+
if (anthropicOptions != null && rejectsBudgetThinking && budgetThinking != null && "type" in budgetThinking && budgetThinking.type === "enabled") {
|
|
2789
|
+
warnings.push({
|
|
2790
|
+
type: "unsupported-setting",
|
|
2791
|
+
setting: "providerOptions.anthropic.thinking",
|
|
2792
|
+
details: rejectsThinkingDisabled ? `budget-based thinking is not supported by ${this.modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.` : `budget-based thinking is not supported by ${this.modelId}. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
|
|
2793
|
+
});
|
|
2794
|
+
anthropicOptions.thinking = {
|
|
2795
|
+
type: "adaptive",
|
|
2796
|
+
...budgetThinking.blockBinding != null && {
|
|
2797
|
+
blockBinding: budgetThinking.blockBinding
|
|
2798
|
+
}
|
|
2799
|
+
};
|
|
2800
|
+
}
|
|
2782
2801
|
const thinkingOptions = anthropicOptions == null ? void 0 : anthropicOptions.thinking;
|
|
2783
2802
|
const thinkingType = thinkingOptions != null && "type" in thinkingOptions ? thinkingOptions.type : void 0;
|
|
2784
2803
|
if (rejectsThinkingDisabledAboveHighEffort && thinkingType === "disabled" && anthropicOptions != null && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
@@ -4169,6 +4188,7 @@ function getModelCapabilities(modelId) {
|
|
|
4169
4188
|
rejectsSamplingParameters: true,
|
|
4170
4189
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4171
4190
|
rejectsThinkingDisabled: true,
|
|
4191
|
+
rejectsBudgetThinking: true,
|
|
4172
4192
|
rejectsForcedToolUse: true,
|
|
4173
4193
|
supportsBetweenToolsThinking: true,
|
|
4174
4194
|
isKnownModel: true
|
|
@@ -4180,10 +4200,23 @@ function getModelCapabilities(modelId) {
|
|
|
4180
4200
|
rejectsSamplingParameters: true,
|
|
4181
4201
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4182
4202
|
rejectsThinkingDisabled: true,
|
|
4203
|
+
rejectsBudgetThinking: true,
|
|
4183
4204
|
rejectsForcedToolUse: true,
|
|
4184
4205
|
supportsBetweenToolsThinking: false,
|
|
4185
4206
|
isKnownModel: true
|
|
4186
4207
|
};
|
|
4208
|
+
} else if (modelId.includes("claude-haiku-5-5")) {
|
|
4209
|
+
return {
|
|
4210
|
+
maxOutputTokens: 128e3,
|
|
4211
|
+
supportsStructuredOutput: true,
|
|
4212
|
+
rejectsSamplingParameters: true,
|
|
4213
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4214
|
+
rejectsThinkingDisabled: false,
|
|
4215
|
+
rejectsBudgetThinking: true,
|
|
4216
|
+
rejectsForcedToolUse: false,
|
|
4217
|
+
supportsBetweenToolsThinking: false,
|
|
4218
|
+
isKnownModel: true
|
|
4219
|
+
};
|
|
4187
4220
|
} else if (modelId.includes("claude-opus-5")) {
|
|
4188
4221
|
return {
|
|
4189
4222
|
maxOutputTokens: 128e3,
|
|
@@ -4191,6 +4224,7 @@ function getModelCapabilities(modelId) {
|
|
|
4191
4224
|
rejectsSamplingParameters: true,
|
|
4192
4225
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4193
4226
|
rejectsThinkingDisabled: false,
|
|
4227
|
+
rejectsBudgetThinking: false,
|
|
4194
4228
|
rejectsForcedToolUse: false,
|
|
4195
4229
|
supportsBetweenToolsThinking: false,
|
|
4196
4230
|
isKnownModel: true
|
|
@@ -4202,6 +4236,7 @@ function getModelCapabilities(modelId) {
|
|
|
4202
4236
|
rejectsSamplingParameters: true,
|
|
4203
4237
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4204
4238
|
rejectsThinkingDisabled: true,
|
|
4239
|
+
rejectsBudgetThinking: true,
|
|
4205
4240
|
rejectsForcedToolUse: true,
|
|
4206
4241
|
supportsBetweenToolsThinking: false,
|
|
4207
4242
|
isKnownModel: true
|
|
@@ -4213,6 +4248,7 @@ function getModelCapabilities(modelId) {
|
|
|
4213
4248
|
rejectsSamplingParameters: true,
|
|
4214
4249
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4215
4250
|
rejectsThinkingDisabled: true,
|
|
4251
|
+
rejectsBudgetThinking: true,
|
|
4216
4252
|
rejectsForcedToolUse: false,
|
|
4217
4253
|
supportsBetweenToolsThinking: false,
|
|
4218
4254
|
isKnownModel: true
|
|
@@ -4224,6 +4260,7 @@ function getModelCapabilities(modelId) {
|
|
|
4224
4260
|
rejectsSamplingParameters: true,
|
|
4225
4261
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4226
4262
|
rejectsThinkingDisabled: false,
|
|
4263
|
+
rejectsBudgetThinking: false,
|
|
4227
4264
|
rejectsForcedToolUse: false,
|
|
4228
4265
|
supportsBetweenToolsThinking: false,
|
|
4229
4266
|
isKnownModel: true
|
|
@@ -4235,6 +4272,7 @@ function getModelCapabilities(modelId) {
|
|
|
4235
4272
|
rejectsSamplingParameters: false,
|
|
4236
4273
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4237
4274
|
rejectsThinkingDisabled: false,
|
|
4275
|
+
rejectsBudgetThinking: false,
|
|
4238
4276
|
rejectsForcedToolUse: false,
|
|
4239
4277
|
supportsBetweenToolsThinking: false,
|
|
4240
4278
|
isKnownModel: true
|
|
@@ -4246,6 +4284,7 @@ function getModelCapabilities(modelId) {
|
|
|
4246
4284
|
rejectsSamplingParameters: false,
|
|
4247
4285
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4248
4286
|
rejectsThinkingDisabled: false,
|
|
4287
|
+
rejectsBudgetThinking: false,
|
|
4249
4288
|
rejectsForcedToolUse: false,
|
|
4250
4289
|
supportsBetweenToolsThinking: false,
|
|
4251
4290
|
isKnownModel: true
|
|
@@ -4257,6 +4296,7 @@ function getModelCapabilities(modelId) {
|
|
|
4257
4296
|
rejectsSamplingParameters: false,
|
|
4258
4297
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4259
4298
|
rejectsThinkingDisabled: false,
|
|
4299
|
+
rejectsBudgetThinking: false,
|
|
4260
4300
|
rejectsForcedToolUse: false,
|
|
4261
4301
|
supportsBetweenToolsThinking: false,
|
|
4262
4302
|
isKnownModel: true
|
|
@@ -4268,6 +4308,7 @@ function getModelCapabilities(modelId) {
|
|
|
4268
4308
|
rejectsSamplingParameters: false,
|
|
4269
4309
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4270
4310
|
rejectsThinkingDisabled: false,
|
|
4311
|
+
rejectsBudgetThinking: false,
|
|
4271
4312
|
rejectsForcedToolUse: false,
|
|
4272
4313
|
supportsBetweenToolsThinking: false,
|
|
4273
4314
|
isKnownModel: true
|
|
@@ -4279,6 +4320,7 @@ function getModelCapabilities(modelId) {
|
|
|
4279
4320
|
rejectsSamplingParameters: false,
|
|
4280
4321
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4281
4322
|
rejectsThinkingDisabled: false,
|
|
4323
|
+
rejectsBudgetThinking: false,
|
|
4282
4324
|
rejectsForcedToolUse: false,
|
|
4283
4325
|
supportsBetweenToolsThinking: false,
|
|
4284
4326
|
isKnownModel: true
|
|
@@ -4290,6 +4332,7 @@ function getModelCapabilities(modelId) {
|
|
|
4290
4332
|
rejectsSamplingParameters: false,
|
|
4291
4333
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4292
4334
|
rejectsThinkingDisabled: false,
|
|
4335
|
+
rejectsBudgetThinking: false,
|
|
4293
4336
|
rejectsForcedToolUse: false,
|
|
4294
4337
|
supportsBetweenToolsThinking: false,
|
|
4295
4338
|
isKnownModel: true
|
|
@@ -4301,6 +4344,7 @@ function getModelCapabilities(modelId) {
|
|
|
4301
4344
|
rejectsSamplingParameters: false,
|
|
4302
4345
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4303
4346
|
rejectsThinkingDisabled: false,
|
|
4347
|
+
rejectsBudgetThinking: false,
|
|
4304
4348
|
rejectsForcedToolUse: false,
|
|
4305
4349
|
supportsBetweenToolsThinking: false,
|
|
4306
4350
|
isKnownModel: false
|
|
@@ -4312,6 +4356,7 @@ function getModelCapabilities(modelId) {
|
|
|
4312
4356
|
rejectsSamplingParameters: true,
|
|
4313
4357
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
4314
4358
|
rejectsThinkingDisabled: false,
|
|
4359
|
+
rejectsBudgetThinking: false,
|
|
4315
4360
|
rejectsForcedToolUse: false,
|
|
4316
4361
|
supportsBetweenToolsThinking: false,
|
|
4317
4362
|
isKnownModel: false
|
|
@@ -4323,6 +4368,7 @@ function getModelCapabilities(modelId) {
|
|
|
4323
4368
|
rejectsSamplingParameters: false,
|
|
4324
4369
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
4325
4370
|
rejectsThinkingDisabled: false,
|
|
4371
|
+
rejectsBudgetThinking: false,
|
|
4326
4372
|
rejectsForcedToolUse: false,
|
|
4327
4373
|
supportsBetweenToolsThinking: false,
|
|
4328
4374
|
isKnownModel: false
|
|
@@ -4344,12 +4390,12 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
4344
4390
|
// src/tool/bash_20241022.ts
|
|
4345
4391
|
import {
|
|
4346
4392
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
4347
|
-
lazySchema as
|
|
4348
|
-
zodSchema as
|
|
4393
|
+
lazySchema as lazySchema10,
|
|
4394
|
+
zodSchema as zodSchema10
|
|
4349
4395
|
} from "@ai-sdk/provider-utils";
|
|
4350
4396
|
import { z as z10 } from "zod/v4";
|
|
4351
|
-
var bash_20241022InputSchema =
|
|
4352
|
-
() =>
|
|
4397
|
+
var bash_20241022InputSchema = lazySchema10(
|
|
4398
|
+
() => zodSchema10(
|
|
4353
4399
|
z10.object({
|
|
4354
4400
|
command: z10.string(),
|
|
4355
4401
|
restart: z10.boolean().optional()
|
|
@@ -4365,12 +4411,12 @@ var bash_20241022 = createProviderDefinedToolFactory3({
|
|
|
4365
4411
|
// src/tool/bash_20250124.ts
|
|
4366
4412
|
import {
|
|
4367
4413
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
4368
|
-
lazySchema as
|
|
4369
|
-
zodSchema as
|
|
4414
|
+
lazySchema as lazySchema11,
|
|
4415
|
+
zodSchema as zodSchema11
|
|
4370
4416
|
} from "@ai-sdk/provider-utils";
|
|
4371
4417
|
import { z as z11 } from "zod/v4";
|
|
4372
|
-
var bash_20250124InputSchema =
|
|
4373
|
-
() =>
|
|
4418
|
+
var bash_20250124InputSchema = lazySchema11(
|
|
4419
|
+
() => zodSchema11(
|
|
4374
4420
|
z11.object({
|
|
4375
4421
|
command: z11.string(),
|
|
4376
4422
|
restart: z11.boolean().optional()
|
|
@@ -4386,12 +4432,12 @@ var bash_20250124 = createProviderDefinedToolFactory4({
|
|
|
4386
4432
|
// src/tool/code-execution_20260120.ts
|
|
4387
4433
|
import {
|
|
4388
4434
|
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
|
|
4389
|
-
lazySchema as
|
|
4390
|
-
zodSchema as
|
|
4435
|
+
lazySchema as lazySchema12,
|
|
4436
|
+
zodSchema as zodSchema12
|
|
4391
4437
|
} from "@ai-sdk/provider-utils";
|
|
4392
4438
|
import { z as z12 } from "zod/v4";
|
|
4393
|
-
var codeExecution_20260120OutputSchema =
|
|
4394
|
-
() =>
|
|
4439
|
+
var codeExecution_20260120OutputSchema = lazySchema12(
|
|
4440
|
+
() => zodSchema12(
|
|
4395
4441
|
z12.discriminatedUnion("type", [
|
|
4396
4442
|
z12.object({
|
|
4397
4443
|
type: z12.literal("code_execution_result"),
|
|
@@ -4448,8 +4494,8 @@ var codeExecution_20260120OutputSchema = lazySchema11(
|
|
|
4448
4494
|
])
|
|
4449
4495
|
)
|
|
4450
4496
|
);
|
|
4451
|
-
var codeExecution_20260120InputSchema =
|
|
4452
|
-
() =>
|
|
4497
|
+
var codeExecution_20260120InputSchema = lazySchema12(
|
|
4498
|
+
() => zodSchema12(
|
|
4453
4499
|
z12.discriminatedUnion("type", [
|
|
4454
4500
|
z12.object({
|
|
4455
4501
|
type: z12.literal("programmatic-tool-call"),
|
|
@@ -4495,12 +4541,12 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
4495
4541
|
// src/tool/computer_20241022.ts
|
|
4496
4542
|
import {
|
|
4497
4543
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
4498
|
-
lazySchema as
|
|
4499
|
-
zodSchema as
|
|
4544
|
+
lazySchema as lazySchema13,
|
|
4545
|
+
zodSchema as zodSchema13
|
|
4500
4546
|
} from "@ai-sdk/provider-utils";
|
|
4501
4547
|
import { z as z13 } from "zod/v4";
|
|
4502
|
-
var computer_20241022InputSchema =
|
|
4503
|
-
() =>
|
|
4548
|
+
var computer_20241022InputSchema = lazySchema13(
|
|
4549
|
+
() => zodSchema13(
|
|
4504
4550
|
z13.object({
|
|
4505
4551
|
action: z13.enum([
|
|
4506
4552
|
"key",
|
|
@@ -4528,12 +4574,12 @@ var computer_20241022 = createProviderDefinedToolFactory5({
|
|
|
4528
4574
|
// src/tool/computer_20250124.ts
|
|
4529
4575
|
import {
|
|
4530
4576
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
4531
|
-
lazySchema as
|
|
4532
|
-
zodSchema as
|
|
4577
|
+
lazySchema as lazySchema14,
|
|
4578
|
+
zodSchema as zodSchema14
|
|
4533
4579
|
} from "@ai-sdk/provider-utils";
|
|
4534
4580
|
import { z as z14 } from "zod/v4";
|
|
4535
|
-
var computer_20250124InputSchema =
|
|
4536
|
-
() =>
|
|
4581
|
+
var computer_20250124InputSchema = lazySchema14(
|
|
4582
|
+
() => zodSchema14(
|
|
4537
4583
|
z14.object({
|
|
4538
4584
|
action: z14.enum([
|
|
4539
4585
|
"key",
|
|
@@ -4571,12 +4617,12 @@ var computer_20250124 = createProviderDefinedToolFactory6({
|
|
|
4571
4617
|
// src/tool/memory_20250818.ts
|
|
4572
4618
|
import {
|
|
4573
4619
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
4574
|
-
lazySchema as
|
|
4575
|
-
zodSchema as
|
|
4620
|
+
lazySchema as lazySchema15,
|
|
4621
|
+
zodSchema as zodSchema15
|
|
4576
4622
|
} from "@ai-sdk/provider-utils";
|
|
4577
4623
|
import { z as z15 } from "zod/v4";
|
|
4578
|
-
var memory_20250818InputSchema =
|
|
4579
|
-
() =>
|
|
4624
|
+
var memory_20250818InputSchema = lazySchema15(
|
|
4625
|
+
() => zodSchema15(
|
|
4580
4626
|
z15.discriminatedUnion("command", [
|
|
4581
4627
|
z15.object({
|
|
4582
4628
|
command: z15.literal("view"),
|
|
@@ -4621,12 +4667,12 @@ var memory_20250818 = createProviderDefinedToolFactory7({
|
|
|
4621
4667
|
// src/tool/text-editor_20241022.ts
|
|
4622
4668
|
import {
|
|
4623
4669
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
4624
|
-
lazySchema as
|
|
4625
|
-
zodSchema as
|
|
4670
|
+
lazySchema as lazySchema16,
|
|
4671
|
+
zodSchema as zodSchema16
|
|
4626
4672
|
} from "@ai-sdk/provider-utils";
|
|
4627
4673
|
import { z as z16 } from "zod/v4";
|
|
4628
|
-
var textEditor_20241022InputSchema =
|
|
4629
|
-
() =>
|
|
4674
|
+
var textEditor_20241022InputSchema = lazySchema16(
|
|
4675
|
+
() => zodSchema16(
|
|
4630
4676
|
z16.object({
|
|
4631
4677
|
command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
4632
4678
|
path: z16.string(),
|
|
@@ -4647,12 +4693,12 @@ var textEditor_20241022 = createProviderDefinedToolFactory8({
|
|
|
4647
4693
|
// src/tool/text-editor_20250124.ts
|
|
4648
4694
|
import {
|
|
4649
4695
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
4650
|
-
lazySchema as
|
|
4651
|
-
zodSchema as
|
|
4696
|
+
lazySchema as lazySchema17,
|
|
4697
|
+
zodSchema as zodSchema17
|
|
4652
4698
|
} from "@ai-sdk/provider-utils";
|
|
4653
4699
|
import { z as z17 } from "zod/v4";
|
|
4654
|
-
var textEditor_20250124InputSchema =
|
|
4655
|
-
() =>
|
|
4700
|
+
var textEditor_20250124InputSchema = lazySchema17(
|
|
4701
|
+
() => zodSchema17(
|
|
4656
4702
|
z17.object({
|
|
4657
4703
|
command: z17.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
4658
4704
|
path: z17.string(),
|
|
@@ -4673,12 +4719,12 @@ var textEditor_20250124 = createProviderDefinedToolFactory9({
|
|
|
4673
4719
|
// src/tool/text-editor_20250429.ts
|
|
4674
4720
|
import {
|
|
4675
4721
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
4676
|
-
lazySchema as
|
|
4677
|
-
zodSchema as
|
|
4722
|
+
lazySchema as lazySchema18,
|
|
4723
|
+
zodSchema as zodSchema18
|
|
4678
4724
|
} from "@ai-sdk/provider-utils";
|
|
4679
4725
|
import { z as z18 } from "zod/v4";
|
|
4680
|
-
var textEditor_20250429InputSchema =
|
|
4681
|
-
() =>
|
|
4726
|
+
var textEditor_20250429InputSchema = lazySchema18(
|
|
4727
|
+
() => zodSchema18(
|
|
4682
4728
|
z18.object({
|
|
4683
4729
|
command: z18.enum(["view", "create", "str_replace", "insert"]),
|
|
4684
4730
|
path: z18.string(),
|