@ai-sdk/anthropic 4.0.96 → 4.0.98
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 +35 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +332 -65
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +287 -11
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +326 -66
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +292 -1
- package/package.json +3 -3
- package/src/anthropic-api.ts +24 -6
- package/src/anthropic-batch.ts +8 -0
- package/src/anthropic-error.ts +7 -0
- package/src/anthropic-language-model-options.ts +57 -7
- package/src/anthropic-language-model.ts +143 -15
- package/src/anthropic-message-metadata.ts +3 -0
- package/src/anthropic-model-catalog.ts +6 -0
- package/src/anthropic-prepare-tools.ts +24 -10
- package/src/anthropic-provider.ts +2 -1
- package/src/convert-to-anthropic-prompt.ts +141 -3
- package/src/files/anthropic-files-api.ts +26 -0
- package/src/files/anthropic-files.ts +217 -0
- package/src/get-cache-control.ts +6 -1
- package/src/internal/index.ts +7 -1
- package/src/anthropic-files.ts +0 -104
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { FilesV4, FilesV4DeleteFileCallOptions, FilesV4DeleteFileResult, FilesV4DownloadFileCallOptions, FilesV4DownloadFileResult, FilesV4GetFileMetadataCallOptions, FilesV4GetFileMetadataResult, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, JSONObject, JSONSchema7, LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4FilePart, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, ModelCapabilities, ModelCapability, ModelEntry, SharedV4ProviderMetadata, SharedV4Warning, SkillsV4 } from "@ai-sdk/provider";
|
|
1
2
|
import { Experimental_SandboxSession, FetchFunction, InferSchema, ProviderDefinedTool, Resolvable, Tool, ToolExecuteFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
|
|
2
3
|
import { z } from "zod/v4";
|
|
3
|
-
|
|
4
|
-
//#region src/anthropic-files.d.ts
|
|
4
|
+
//#region src/files/anthropic-files.d.ts
|
|
5
5
|
interface AnthropicFilesConfig {
|
|
6
6
|
provider: string;
|
|
7
7
|
baseURL: string;
|
|
@@ -13,7 +13,13 @@ export declare class AnthropicFiles implements FilesV4 {
|
|
|
13
13
|
readonly specificationVersion = "v4";
|
|
14
14
|
get provider(): string;
|
|
15
15
|
constructor(config: AnthropicFilesConfig);
|
|
16
|
+
private getFileId;
|
|
17
|
+
private getHeaders;
|
|
16
18
|
uploadFile({ data, mediaType, filename, abortSignal, headers }: FilesV4UploadFileCallOptions): Promise<FilesV4UploadFileResult>;
|
|
19
|
+
deleteFile({ file, abortSignal, headers }: FilesV4DeleteFileCallOptions): Promise<FilesV4DeleteFileResult>;
|
|
20
|
+
getFileMetadata({ file, abortSignal, headers }: FilesV4GetFileMetadataCallOptions): Promise<FilesV4GetFileMetadataResult>;
|
|
21
|
+
private toFileMetadata;
|
|
22
|
+
downloadFile({ file, abortSignal, headers }: FilesV4DownloadFileCallOptions): Promise<FilesV4DownloadFileResult>;
|
|
17
23
|
}
|
|
18
24
|
//#endregion
|
|
19
25
|
//#region src/anthropic-api.d.ts
|
|
@@ -35,16 +41,30 @@ interface AnthropicSystemMessage {
|
|
|
35
41
|
* conversation's tool set without invalidating the prompt cache.
|
|
36
42
|
*
|
|
37
43
|
* Only valid inside system messages that appear in the `messages` array.
|
|
38
|
-
*
|
|
44
|
+
* Changes by reference require the `mid-conversation-tool-changes-2026-07-01`
|
|
45
|
+
* beta. Additions by value (`tool_definition`) require the
|
|
46
|
+
* `inline-tools-2026-09-15` beta, which also covers changes by reference.
|
|
39
47
|
*/
|
|
40
|
-
|
|
48
|
+
type AnthropicToolChangeContent = {
|
|
41
49
|
type: 'tool_addition' | 'tool_removal';
|
|
42
50
|
tool: {
|
|
43
51
|
type: 'tool_reference';
|
|
44
52
|
name: string;
|
|
45
53
|
};
|
|
46
54
|
cache_control?: never;
|
|
47
|
-
}
|
|
55
|
+
} | {
|
|
56
|
+
type: 'tool_addition';
|
|
57
|
+
/**
|
|
58
|
+
* The tool definition, in the same shape as an entry of the top-level
|
|
59
|
+
* `tools` array. It replaces any earlier definition with the same name
|
|
60
|
+
* from this point on.
|
|
61
|
+
*/
|
|
62
|
+
tool: {
|
|
63
|
+
type: 'tool_definition';
|
|
64
|
+
definition: AnthropicTool;
|
|
65
|
+
};
|
|
66
|
+
cache_control?: never;
|
|
67
|
+
};
|
|
48
68
|
interface AnthropicUserMessage {
|
|
49
69
|
role: 'user';
|
|
50
70
|
content: Array<AnthropicTextContent | AnthropicImageContent | AnthropicVideoContent | AnthropicDocumentContent | AnthropicContainerUploadContent | AnthropicToolResultContent>;
|
|
@@ -757,6 +777,7 @@ declare const anthropicResponseSchema: import("@ai-sdk/provider-utils").LazySche
|
|
|
757
777
|
[x: string]: unknown;
|
|
758
778
|
input_tokens: number;
|
|
759
779
|
output_tokens: number;
|
|
780
|
+
service_tier?: string | null | undefined;
|
|
760
781
|
output_tokens_details?: {
|
|
761
782
|
thinking_tokens?: number | null | undefined;
|
|
762
783
|
} | null | undefined;
|
|
@@ -775,6 +796,7 @@ declare const anthropicResponseSchema: import("@ai-sdk/provider-utils").LazySche
|
|
|
775
796
|
model?: string | null | undefined;
|
|
776
797
|
stop_reason?: string | null | undefined;
|
|
777
798
|
stop_sequence?: string | null | undefined;
|
|
799
|
+
service_tier?: string | null | undefined;
|
|
778
800
|
stop_details?: {
|
|
779
801
|
type: string;
|
|
780
802
|
category?: string | null | undefined;
|
|
@@ -801,7 +823,7 @@ declare const anthropicResponseSchema: import("@ai-sdk/provider-utils").LazySche
|
|
|
801
823
|
expires_at: string;
|
|
802
824
|
id: string;
|
|
803
825
|
skills?: {
|
|
804
|
-
type: "
|
|
826
|
+
type: "custom" | "anthropic";
|
|
805
827
|
skill_id: string;
|
|
806
828
|
version: string;
|
|
807
829
|
}[] | null | undefined;
|
|
@@ -826,13 +848,136 @@ type Citation = NonNullable<(InferSchema<typeof anthropicResponseSchema>['conten
|
|
|
826
848
|
//#endregion
|
|
827
849
|
//#region src/anthropic-language-model-options.d.ts
|
|
828
850
|
type AnthropicModelId = 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-haiku-5-5' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | (string & {});
|
|
851
|
+
declare const anthropicLanguageModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
|
|
852
|
+
thread?: {
|
|
853
|
+
type: "create";
|
|
854
|
+
} | {
|
|
855
|
+
type: "continue";
|
|
856
|
+
previousMessageId: string;
|
|
857
|
+
} | undefined;
|
|
858
|
+
sendReasoning?: boolean | undefined;
|
|
859
|
+
structuredOutputMode?: "outputFormat" | "jsonTool" | "auto" | undefined;
|
|
860
|
+
includePings?: boolean | undefined;
|
|
861
|
+
thinking?: {
|
|
862
|
+
type: "adaptive";
|
|
863
|
+
display?: "omitted" | "summarized" | "updates" | undefined;
|
|
864
|
+
blockBinding?: {
|
|
865
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
866
|
+
} | undefined;
|
|
867
|
+
} | {
|
|
868
|
+
type: "enabled";
|
|
869
|
+
budgetTokens?: number | undefined;
|
|
870
|
+
} | {
|
|
871
|
+
type: "disabled";
|
|
872
|
+
} | {
|
|
873
|
+
type: "between_tools";
|
|
874
|
+
} | {
|
|
875
|
+
blockBinding: {
|
|
876
|
+
prefixMismatchBehavior: "error" | "drop_block";
|
|
877
|
+
};
|
|
878
|
+
type?: undefined;
|
|
879
|
+
} | undefined;
|
|
880
|
+
disableParallelToolUse?: boolean | undefined;
|
|
881
|
+
cacheControl?: {
|
|
882
|
+
type: "ephemeral";
|
|
883
|
+
ttl?: "5m" | "1h" | undefined;
|
|
884
|
+
} | undefined;
|
|
885
|
+
metadata?: {
|
|
886
|
+
userId?: string | undefined;
|
|
887
|
+
} | undefined;
|
|
888
|
+
mcpServers?: {
|
|
889
|
+
type: "url";
|
|
890
|
+
name: string;
|
|
891
|
+
url: string;
|
|
892
|
+
authorizationToken?: string | null | undefined;
|
|
893
|
+
toolConfiguration?: {
|
|
894
|
+
enabled?: boolean | null | undefined;
|
|
895
|
+
allowedTools?: string[] | null | undefined;
|
|
896
|
+
} | null | undefined;
|
|
897
|
+
}[] | undefined;
|
|
898
|
+
container?: {
|
|
899
|
+
id?: string | undefined;
|
|
900
|
+
skills?: ({
|
|
901
|
+
type: "anthropic";
|
|
902
|
+
skillId: string;
|
|
903
|
+
version?: string | undefined;
|
|
904
|
+
} | {
|
|
905
|
+
type: "custom";
|
|
906
|
+
providerReference: Record<string, string>;
|
|
907
|
+
version?: string | undefined;
|
|
908
|
+
})[] | undefined;
|
|
909
|
+
} | undefined;
|
|
910
|
+
toolStreaming?: boolean | undefined;
|
|
911
|
+
effort?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
912
|
+
taskBudget?: {
|
|
913
|
+
type: "tokens";
|
|
914
|
+
total: number;
|
|
915
|
+
remaining?: number | undefined;
|
|
916
|
+
} | undefined;
|
|
917
|
+
speed?: "fast" | "standard" | undefined;
|
|
918
|
+
serviceTier?: "auto" | "standard" | "standard_only" | "priority" | undefined;
|
|
919
|
+
inferenceGeo?: "us" | "global" | undefined;
|
|
920
|
+
fallbacks?: "default" | {
|
|
921
|
+
model: string;
|
|
922
|
+
max_tokens?: number | undefined;
|
|
923
|
+
thinking?: Record<string, unknown> | undefined;
|
|
924
|
+
output_config?: Record<string, unknown> | undefined;
|
|
925
|
+
speed?: "fast" | "standard" | undefined;
|
|
926
|
+
}[] | undefined;
|
|
927
|
+
anthropicBeta?: string[] | undefined;
|
|
928
|
+
safeguards?: {
|
|
929
|
+
type: "dangerous_tool_use";
|
|
930
|
+
classifierContext?: Record<string, unknown> | undefined;
|
|
931
|
+
}[] | undefined;
|
|
932
|
+
compaction?: {
|
|
933
|
+
type: "summarize";
|
|
934
|
+
instructions?: string | undefined;
|
|
935
|
+
} | undefined;
|
|
936
|
+
contextManagement?: {
|
|
937
|
+
edits: ({
|
|
938
|
+
type: "clear_tool_uses_20250919";
|
|
939
|
+
trigger?: {
|
|
940
|
+
type: "input_tokens";
|
|
941
|
+
value: number;
|
|
942
|
+
} | {
|
|
943
|
+
type: "tool_uses";
|
|
944
|
+
value: number;
|
|
945
|
+
} | undefined;
|
|
946
|
+
keep?: {
|
|
947
|
+
type: "tool_uses";
|
|
948
|
+
value: number;
|
|
949
|
+
} | undefined;
|
|
950
|
+
clearAtLeast?: {
|
|
951
|
+
type: "input_tokens";
|
|
952
|
+
value: number;
|
|
953
|
+
} | undefined;
|
|
954
|
+
clearToolInputs?: boolean | undefined;
|
|
955
|
+
excludeTools?: string[] | undefined;
|
|
956
|
+
} | {
|
|
957
|
+
type: "clear_thinking_20251015";
|
|
958
|
+
keep?: "all" | {
|
|
959
|
+
type: "thinking_turns";
|
|
960
|
+
value: number;
|
|
961
|
+
} | undefined;
|
|
962
|
+
} | {
|
|
963
|
+
type: "compact_20260112";
|
|
964
|
+
trigger?: {
|
|
965
|
+
type: "input_tokens";
|
|
966
|
+
value: number;
|
|
967
|
+
} | undefined;
|
|
968
|
+
pauseAfterCompaction?: boolean | undefined;
|
|
969
|
+
instructions?: string | undefined;
|
|
970
|
+
})[];
|
|
971
|
+
} | undefined;
|
|
972
|
+
}>;
|
|
973
|
+
type AnthropicLanguageModelOptions = InferSchema<typeof anthropicLanguageModelOptions>;
|
|
829
974
|
//#endregion
|
|
830
975
|
//#region src/get-cache-control.d.ts
|
|
831
976
|
declare class CacheControlValidator {
|
|
832
977
|
private readonly providerOptionsName;
|
|
833
978
|
private breakpointCount;
|
|
834
979
|
private warnings;
|
|
835
|
-
constructor(providerOptionsName?: string);
|
|
980
|
+
constructor(providerOptionsName?: string, initialBreakpointCount?: number);
|
|
836
981
|
getCacheControl(providerMetadata: SharedV4ProviderMetadata | undefined, context: {
|
|
837
982
|
type: string;
|
|
838
983
|
canCache: boolean;
|
|
@@ -845,6 +990,120 @@ declare class CacheControlValidator {
|
|
|
845
990
|
type AnthropicMediaPartConverter = (part: LanguageModelV4FilePart) => PromiseLike<Omit<AnthropicImageContent | AnthropicVideoContent, 'cache_control'> | undefined>;
|
|
846
991
|
//#endregion
|
|
847
992
|
//#region src/anthropic-model-catalog.d.ts
|
|
993
|
+
type AnthropicLanguageProviderOption = keyof AnthropicLanguageModelOptions;
|
|
994
|
+
/**
|
|
995
|
+
* Options accepted under `providerOptions.anthropic`. The `satisfies` check
|
|
996
|
+
* keeps this list in sync with the option schema.
|
|
997
|
+
*/
|
|
998
|
+
export declare const anthropicProviderOptions: {
|
|
999
|
+
readonly language: {
|
|
1000
|
+
thread: {
|
|
1001
|
+
description: string;
|
|
1002
|
+
};
|
|
1003
|
+
sendReasoning: {
|
|
1004
|
+
description: string;
|
|
1005
|
+
};
|
|
1006
|
+
includePings: {
|
|
1007
|
+
description: string;
|
|
1008
|
+
};
|
|
1009
|
+
structuredOutputMode: {
|
|
1010
|
+
description: string;
|
|
1011
|
+
};
|
|
1012
|
+
thinking: {
|
|
1013
|
+
description: string;
|
|
1014
|
+
};
|
|
1015
|
+
disableParallelToolUse: {
|
|
1016
|
+
description: string;
|
|
1017
|
+
};
|
|
1018
|
+
cacheControl: {
|
|
1019
|
+
description: string;
|
|
1020
|
+
};
|
|
1021
|
+
metadata: {
|
|
1022
|
+
description: string;
|
|
1023
|
+
};
|
|
1024
|
+
mcpServers: {
|
|
1025
|
+
description: string;
|
|
1026
|
+
};
|
|
1027
|
+
container: {
|
|
1028
|
+
description: string;
|
|
1029
|
+
};
|
|
1030
|
+
toolStreaming: {
|
|
1031
|
+
description: string;
|
|
1032
|
+
};
|
|
1033
|
+
effort: {
|
|
1034
|
+
description: string;
|
|
1035
|
+
};
|
|
1036
|
+
taskBudget: {
|
|
1037
|
+
description: string;
|
|
1038
|
+
};
|
|
1039
|
+
speed: {
|
|
1040
|
+
description: string;
|
|
1041
|
+
};
|
|
1042
|
+
serviceTier: {
|
|
1043
|
+
description: string;
|
|
1044
|
+
};
|
|
1045
|
+
inferenceGeo: {
|
|
1046
|
+
description: string;
|
|
1047
|
+
};
|
|
1048
|
+
fallbacks: {
|
|
1049
|
+
description: string;
|
|
1050
|
+
};
|
|
1051
|
+
anthropicBeta: {
|
|
1052
|
+
description: string;
|
|
1053
|
+
};
|
|
1054
|
+
safeguards: {
|
|
1055
|
+
description: string;
|
|
1056
|
+
};
|
|
1057
|
+
compaction: {
|
|
1058
|
+
description: string;
|
|
1059
|
+
};
|
|
1060
|
+
contextManagement: {
|
|
1061
|
+
description: string;
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
type AnthropicLanguageCapabilities = NonNullable<ModelCapabilities['language']> & {
|
|
1066
|
+
tools: NonNullable<ModelCapabilities['language']>['tools'] & {
|
|
1067
|
+
forcedChoice: boolean;
|
|
1068
|
+
computerUse: ModelCapability;
|
|
1069
|
+
webSearch: ModelCapability;
|
|
1070
|
+
toolSearch: ModelCapability;
|
|
1071
|
+
};
|
|
1072
|
+
reasoning: NonNullable<ModelCapabilities['language']>['reasoning'] & {
|
|
1073
|
+
adaptive: boolean;
|
|
1074
|
+
budget: boolean;
|
|
1075
|
+
canDisable: boolean;
|
|
1076
|
+
canDisableAboveHighEffort: boolean;
|
|
1077
|
+
supportsXhighEffort: boolean;
|
|
1078
|
+
betweenTools: boolean;
|
|
1079
|
+
};
|
|
1080
|
+
sampling: NonNullable<ModelCapabilities['language']>['sampling'] & {
|
|
1081
|
+
topK: ModelCapability;
|
|
1082
|
+
};
|
|
1083
|
+
structuredOutput: {
|
|
1084
|
+
native: boolean;
|
|
1085
|
+
};
|
|
1086
|
+
compaction: ModelCapability;
|
|
1087
|
+
};
|
|
1088
|
+
type AnthropicLanguageRequestConfig = {
|
|
1089
|
+
maxOutputTokens: number;
|
|
1090
|
+
knownModel: boolean;
|
|
1091
|
+
};
|
|
1092
|
+
type AnthropicLanguageModelEntry = ModelEntry<{
|
|
1093
|
+
language: AnthropicLanguageRequestConfig;
|
|
1094
|
+
}> & {
|
|
1095
|
+
capabilities: {
|
|
1096
|
+
language: AnthropicLanguageCapabilities;
|
|
1097
|
+
};
|
|
1098
|
+
providerOptions: {
|
|
1099
|
+
language: Record<AnthropicLanguageProviderOption, ModelCapability>;
|
|
1100
|
+
};
|
|
1101
|
+
requestConfig: {
|
|
1102
|
+
language: AnthropicLanguageRequestConfig;
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
export declare const anthropicModelCatalog: Readonly<Record<string, AnthropicLanguageModelEntry>>;
|
|
1106
|
+
export declare function getAnthropicLanguageModelEntry(modelId: string): AnthropicLanguageModelEntry;
|
|
848
1107
|
/** Compatibility projection for the provider's existing request preparation. */
|
|
849
1108
|
declare function getAnthropicModelCapabilities(modelId: string): {
|
|
850
1109
|
maxOutputTokens: number;
|
|
@@ -875,6 +1134,8 @@ type AnthropicLanguageModelConfig = {
|
|
|
875
1134
|
generateId?: () => string;
|
|
876
1135
|
supportsNativeStructuredOutput?: boolean;
|
|
877
1136
|
supportsStrictTools?: boolean;
|
|
1137
|
+
/** Opt in only for platforms that support Anthropic message threads. */
|
|
1138
|
+
supportsMessageThreads?: boolean;
|
|
878
1139
|
/** Maximum temperature for compatible providers. Defaults to 1. */
|
|
879
1140
|
maxTemperature?: number;
|
|
880
1141
|
/** Preserve temperature and topP with thinking for compatible providers. */
|
|
@@ -955,12 +1216,19 @@ export declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
955
1216
|
classifier_context?: Record<string, unknown> | undefined;
|
|
956
1217
|
type: "dangerous_tool_use";
|
|
957
1218
|
}[] | undefined;
|
|
958
|
-
system: AnthropicTextContent[] | undefined;
|
|
959
1219
|
messages: AnthropicMessage[];
|
|
1220
|
+
thread?: {
|
|
1221
|
+
type: "create";
|
|
1222
|
+
previous_message_id?: undefined;
|
|
1223
|
+
} | {
|
|
1224
|
+
type: "continue";
|
|
1225
|
+
previous_message_id: string;
|
|
1226
|
+
} | undefined;
|
|
1227
|
+
system: AnthropicTextContent[] | undefined;
|
|
960
1228
|
container?: string | {
|
|
961
1229
|
id: string | undefined;
|
|
962
1230
|
skills: {
|
|
963
|
-
type: "
|
|
1231
|
+
type: "custom" | "anthropic";
|
|
964
1232
|
skill_id: string;
|
|
965
1233
|
version: string | undefined;
|
|
966
1234
|
}[];
|
|
@@ -990,7 +1258,7 @@ export declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
990
1258
|
speed?: "fast" | "standard" | undefined;
|
|
991
1259
|
}[] | undefined;
|
|
992
1260
|
inference_geo?: "us" | "global" | undefined;
|
|
993
|
-
service_tier?: "auto" | "standard_only" | undefined;
|
|
1261
|
+
service_tier?: "auto" | "standard" | "standard_only" | "priority" | undefined;
|
|
994
1262
|
speed?: "fast" | "standard" | undefined;
|
|
995
1263
|
output_config?: {
|
|
996
1264
|
format?: {
|
|
@@ -1021,7 +1289,9 @@ export declare class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
1021
1289
|
};
|
|
1022
1290
|
warnings: SharedV4Warning[];
|
|
1023
1291
|
betas: Set<string>;
|
|
1292
|
+
markCodeExecutionDynamic: boolean;
|
|
1024
1293
|
usesJsonResponseTool: boolean;
|
|
1294
|
+
includePings: boolean;
|
|
1025
1295
|
toolNameMapping: import("@ai-sdk/provider-utils").ToolNameMapping;
|
|
1026
1296
|
providerOptionsName: string;
|
|
1027
1297
|
usedCustomProviderKey: boolean;
|
|
@@ -2087,9 +2357,15 @@ export declare const anthropicTools: {
|
|
|
2087
2357
|
};
|
|
2088
2358
|
//#endregion
|
|
2089
2359
|
//#region src/anthropic-prepare-tools.d.ts
|
|
2090
|
-
export declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, rejectsForcedToolUse }: {
|
|
2360
|
+
export declare function prepareTools({ tools, toolChoice, hasInlineTools, disableParallelToolUse, cacheControlValidator, supportsStructuredOutput, supportsStrictTools, defaultEagerInputStreaming, rejectsForcedToolUse }: {
|
|
2091
2361
|
tools: LanguageModelV4CallOptions['tools'];
|
|
2092
2362
|
toolChoice: LanguageModelV4CallOptions['toolChoice'] | undefined;
|
|
2363
|
+
/**
|
|
2364
|
+
* Whether tools are added by value in the prompt (mid-conversation tool
|
|
2365
|
+
* changes). The model has tools even when `tools` is empty, so the tool
|
|
2366
|
+
* choice and parallel tool use settings still need to be sent.
|
|
2367
|
+
*/
|
|
2368
|
+
hasInlineTools?: boolean;
|
|
2093
2369
|
disableParallelToolUse?: boolean;
|
|
2094
2370
|
cacheControlValidator?: CacheControlValidator;
|
|
2095
2371
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$__anthropic_api0.AnthropicToolChoice","_$__anthropic_api0.
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__anthropic_api0.AnthropicToolChoice","_$__anthropic_api0.AnthropicMessage","_$__anthropic_api0.AnthropicTextContent","SandboxSession","SandboxSession","_$__tool_computer_toolset_202608010.ComputerToolset_20260801Member"],"sources":["../../src/files/anthropic-files.ts","../../src/anthropic-api.ts","../../src/anthropic-language-model-options.ts","../../src/get-cache-control.ts","../../src/convert-to-anthropic-prompt.ts","../../src/anthropic-model-catalog.ts","../../src/anthropic-language-model.ts","../../src/tool/computer-toolset_20260801.ts","../../src/tool/bash_20241022.ts","../../src/tool/bash_20250124.ts","../../src/anthropic-tools.ts","../../src/anthropic-prepare-tools.ts","../../src/sanitize-json-schema.ts","../../src/supports-native-structured-output-schema.ts","../../src/skills/anthropic-skills.ts"],"mappings":";;;;UAiCU;EACR;EACA;EACA,SAAS,WAAW;EACpB,QAAQ;;qBAGG,0BAA0B;mBAOR;WANpB;MAEL;EAIyB,YAAA,QAAQ;UAE7B;UAWM;EAUR,aACJ,MACA,WACA,UACA,aACA,WACC,+BAA+B,QAAQ;EAwCpC,aACJ,MACA,aACA,WACC,+BAA+B,QAAQ;EAmBpC,kBACJ,MACA,aACA,WACC,oCAAoC,QAAQ;UA4BvC;EAqBF,eACJ,MACA,aACA,WACC,iCAAiC,QAAQ;;;;KCvLlC,mBACR,uBACA,4BACA;KAEQ;EACV;EACA;;UAGe;EACf;EACA,SAAS,MAAM,uBAAuB;EACtC;EACA;IACE;;;;;;;;;;;;KAaQ;EAEN;EACA;IAAQ;IAAwB;;EAChC;;EAGA;;;;;;EAMA;IAAQ;IAAyB,YAAY;;EAC7C;;UAGW;EACf;EACA,SAAS,MACL,uBACA,wBACA,wBACA,2BACA,kCACA;;UAIW;EACf;EACA,SAAS,MACL,uBACA,2BACA,mCACA,2BACA,2BACA,gCACA,0CACA,qCACA,sCACA,uCACA,8CACA,oDACA,oCACA,6BACA,gCACA;;cAIO,sCAA8B,EAAA;;;;;;;;GAKvC,EAAA,KAAA;KAKQ,2BAA2B,YACrC,kBAAkB;EAElB;;UAGe;EACf;EACA;EACA;EACA,gBAAgB;;UAGD;EACf;EACA;EACA,YAAY;EACZ,eAAe;;UAGA;EACf;EACA;EACA;EAGA;;UAGe;EACf;EACA;EAGA;;KAGG;EAEC;EACA;EACA;;EAGA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;;UAGW;EACf;EACA,QAAQ;EACR,eAAe;;;UAIA;EACf;EACA,QAAQ;EACR,eAAe;;UAGA;EACf;EACA,QAAQ;EACR;EACA;EACA;IAAc;;EACd,eAAe;;UAGA;EACf;EACA;EACA;;;;;;KAOU;EAEN;EACA;;EAGA;EACA;;EAGA;;UAGW;EACf;EACA;EACA;EACA;;;;;EAKA,SAAS;;;;;EAKT;EACA,eAAe;;UAGA;EACf;EACA;EACA;EAaA;EACA,SAAS;EACT,eAAe;;KAKZ,6BAA6B,KAChC;EAGA;;KAGG,8BAA8B,KACjC;EAGA;;KAGG,iCAAiC,KACpC;EAGA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;;;EAIA;EACA,kBAEI,MACI,6BACA,8BACA,iCACA;EAER;EACA,eAAe;;UAGA;EACf;EACA;EACA,SACI;IACE;IACA;IACA;IACA;IACA;;IAGA;IACA;;EAEN,SAAS;EACT,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA,iBAAiB;MACf;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;IACA;IACA;IACA,SAAS;MAAQ;MAA+B;;;IAGhD;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;;IAGA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;IAGA;IACA;IACA;IACA;IACA;IACA;;EAEN,eAAe;;UAIA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;IACA;MACE;MACA;;;IAIF;IACA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;;IAGA;IACA;IACA;;IAGA;;;;;;IAMA;;EAEN,eAAe;;UAGA;EACf;EACA;EACA;IAEM;IACA;IACA;IACA;MACE;MACA;MACA;QAAc;;MACd;QACM;QAAgB;QAA+B;;QAC/C;QAAc;QAA0B;;;;IAIhD;IACA;;EAEN,SAAS;EACT,eAAe;;UAEA;EACf;EACA;EACA;EACA;EACA;EACA,eAAe;;UAGA;EACf;EACA;EACA;EACA,kBAEI;IACE;IACA;IACA,YA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