@anthropic-ai/sdk 0.101.0 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/client.d.mts +35 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +35 -2
- package/client.d.ts.map +1 -1
- package/client.js +74 -24
- package/client.js.map +1 -1
- package/client.mjs +73 -23
- package/client.mjs.map +1 -1
- package/core/middleware.d.mts +42 -5
- package/core/middleware.d.mts.map +1 -1
- package/core/middleware.d.ts +42 -5
- package/core/middleware.d.ts.map +1 -1
- package/core/middleware.js +14 -7
- package/core/middleware.js.map +1 -1
- package/core/middleware.mjs +14 -7
- package/core/middleware.mjs.map +1 -1
- package/core/streaming.d.mts +9 -0
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts +9 -0
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +11 -0
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +11 -0
- package/core/streaming.mjs.map +1 -1
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +0 -3
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +0 -3
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +46 -3
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +46 -3
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js +12 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -1
- package/internal/utils/log.d.mts +11 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +11 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +34 -9
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +32 -8
- package/internal/utils/log.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +5 -0
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +5 -0
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/middleware.d.mts +96 -0
- package/lib/middleware.d.mts.map +1 -0
- package/lib/middleware.d.ts +96 -0
- package/lib/middleware.d.ts.map +1 -0
- package/lib/middleware.js +703 -0
- package/lib/middleware.js.map +1 -0
- package/lib/middleware.mjs +698 -0
- package/lib/middleware.mjs.map +1 -0
- package/lib/tools/BetaToolRunner.d.mts +1 -1
- package/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/lib/tools/BetaToolRunner.d.ts +1 -1
- package/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/lib/tools/BetaToolRunner.js +10 -2
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +10 -2
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/agents/agents.d.mts +12 -22
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +12 -22
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/beta.d.mts +3 -3
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +3 -3
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/messages/batches.d.mts +28 -0
- package/resources/beta/messages/batches.d.mts.map +1 -1
- package/resources/beta/messages/batches.d.ts +28 -0
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +247 -8
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +247 -8
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +7 -0
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +7 -0
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.mts +6 -0
- package/resources/beta/models.d.mts.map +1 -1
- package/resources/beta/models.d.ts +6 -0
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/webhooks.d.mts +22 -22
- package/resources/beta/webhooks.d.ts +22 -22
- package/resources/messages/messages.d.mts +3 -2
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +3 -2
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +1 -0
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +1 -0
- package/resources/messages/messages.mjs.map +1 -1
- package/src/client.ts +92 -27
- package/src/core/middleware.ts +53 -7
- package/src/core/streaming.ts +15 -0
- package/src/index.ts +6 -0
- package/src/internal/parse.ts +0 -4
- package/src/internal/request-options.ts +48 -3
- package/src/internal/utils/log.ts +39 -9
- package/src/lib/BetaMessageStream.ts +5 -0
- package/src/lib/middleware.ts +937 -0
- package/src/lib/tools/BetaToolRunner.ts +12 -3
- package/src/resources/beta/agents/agents.ts +13 -21
- package/src/resources/beta/beta.ts +15 -1
- package/src/resources/beta/index.ts +6 -0
- package/src/resources/beta/messages/batches.ts +30 -0
- package/src/resources/beta/messages/index.ts +6 -0
- package/src/resources/beta/messages/messages.ts +296 -7
- package/src/resources/beta/models.ts +7 -0
- package/src/resources/beta/webhooks.ts +22 -22
- package/src/resources/messages/messages.ts +6 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -186,6 +186,16 @@ export interface BetaAdvisorTool20260301 {
|
|
|
186
186
|
* returned via tool_reference from tool search.
|
|
187
187
|
*/
|
|
188
188
|
defer_loading?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Bounds the advisor's total output (thinking + text) per call. When the advisor
|
|
191
|
+
* hits this cap, the returned advisor_result or advisor_redacted_result block
|
|
192
|
+
* carries stop_reason='max_tokens', and a truncation note is appended to the
|
|
193
|
+
* advice text the worker model sees (inside the encrypted blob in redacted mode).
|
|
194
|
+
* When set, the server also emits a remaining-tokens budget block in the advisor's
|
|
195
|
+
* prompt so the advisor self-shapes toward the cap. When omitted, the advisor
|
|
196
|
+
* model's default output cap applies and no budget block is emitted.
|
|
197
|
+
*/
|
|
198
|
+
max_tokens?: number | null;
|
|
189
199
|
/**
|
|
190
200
|
* Maximum number of times the tool can be used in the API request.
|
|
191
201
|
*/
|
|
@@ -210,11 +220,11 @@ export interface BetaAdvisorToolResultBlockParam {
|
|
|
210
220
|
cache_control?: BetaCacheControlEphemeral | null;
|
|
211
221
|
}
|
|
212
222
|
export interface BetaAdvisorToolResultError {
|
|
213
|
-
error_code: 'max_uses_exceeded' | 'prompt_too_long' | 'too_many_requests' | 'overloaded' | 'unavailable' | 'execution_time_exceeded';
|
|
223
|
+
error_code: 'max_uses_exceeded' | 'prompt_too_long' | 'too_many_requests' | 'overloaded' | 'unavailable' | 'execution_time_exceeded' | 'model_not_found';
|
|
214
224
|
type: 'advisor_tool_result_error';
|
|
215
225
|
}
|
|
216
226
|
export interface BetaAdvisorToolResultErrorParam {
|
|
217
|
-
error_code: 'max_uses_exceeded' | 'prompt_too_long' | 'too_many_requests' | 'overloaded' | 'unavailable' | 'execution_time_exceeded';
|
|
227
|
+
error_code: 'max_uses_exceeded' | 'prompt_too_long' | 'too_many_requests' | 'overloaded' | 'unavailable' | 'execution_time_exceeded' | 'model_not_found';
|
|
218
228
|
type: 'advisor_tool_result_error';
|
|
219
229
|
}
|
|
220
230
|
export interface BetaAllThinkingTurns {
|
|
@@ -861,11 +871,11 @@ export interface BetaContainerUploadBlockParam {
|
|
|
861
871
|
/**
|
|
862
872
|
* Response model for a file uploaded to the container.
|
|
863
873
|
*/
|
|
864
|
-
export type BetaContentBlock = BetaTextBlock | BetaThinkingBlock | BetaRedactedThinkingBlock | BetaToolUseBlock | BetaServerToolUseBlock | BetaWebSearchToolResultBlock | BetaWebFetchToolResultBlock | BetaAdvisorToolResultBlock | BetaCodeExecutionToolResultBlock | BetaBashCodeExecutionToolResultBlock | BetaTextEditorCodeExecutionToolResultBlock | BetaToolSearchToolResultBlock | BetaMCPToolUseBlock | BetaMCPToolResultBlock | BetaContainerUploadBlock | BetaCompactionBlock;
|
|
874
|
+
export type BetaContentBlock = BetaTextBlock | BetaThinkingBlock | BetaRedactedThinkingBlock | BetaToolUseBlock | BetaServerToolUseBlock | BetaWebSearchToolResultBlock | BetaWebFetchToolResultBlock | BetaAdvisorToolResultBlock | BetaCodeExecutionToolResultBlock | BetaBashCodeExecutionToolResultBlock | BetaTextEditorCodeExecutionToolResultBlock | BetaToolSearchToolResultBlock | BetaMCPToolUseBlock | BetaMCPToolResultBlock | BetaContainerUploadBlock | BetaCompactionBlock | BetaFallbackBlock;
|
|
865
875
|
/**
|
|
866
876
|
* Regular text content.
|
|
867
877
|
*/
|
|
868
|
-
export type BetaContentBlockParam = BetaTextBlockParam | BetaImageBlockParam | BetaRequestDocumentBlock | BetaSearchResultBlockParam | BetaThinkingBlockParam | BetaRedactedThinkingBlockParam | BetaToolUseBlockParam | BetaToolResultBlockParam | BetaServerToolUseBlockParam | BetaWebSearchToolResultBlockParam | BetaWebFetchToolResultBlockParam | BetaAdvisorToolResultBlockParam | BetaCodeExecutionToolResultBlockParam | BetaBashCodeExecutionToolResultBlockParam | BetaTextEditorCodeExecutionToolResultBlockParam | BetaToolSearchToolResultBlockParam | BetaMCPToolUseBlockParam | BetaRequestMCPToolResultBlockParam | BetaContainerUploadBlockParam | BetaCompactionBlockParam | BetaMidConversationSystemBlockParam;
|
|
878
|
+
export type BetaContentBlockParam = BetaTextBlockParam | BetaImageBlockParam | BetaRequestDocumentBlock | BetaSearchResultBlockParam | BetaThinkingBlockParam | BetaRedactedThinkingBlockParam | BetaToolUseBlockParam | BetaToolResultBlockParam | BetaServerToolUseBlockParam | BetaWebSearchToolResultBlockParam | BetaWebFetchToolResultBlockParam | BetaAdvisorToolResultBlockParam | BetaCodeExecutionToolResultBlockParam | BetaBashCodeExecutionToolResultBlockParam | BetaTextEditorCodeExecutionToolResultBlockParam | BetaToolSearchToolResultBlockParam | BetaMCPToolUseBlockParam | BetaRequestMCPToolResultBlockParam | BetaContainerUploadBlockParam | BetaCompactionBlockParam | BetaMidConversationSystemBlockParam | BetaFallbackBlockParam;
|
|
869
879
|
export interface BetaContentBlockSource {
|
|
870
880
|
content: string | Array<BetaContentBlockSourceContent>;
|
|
871
881
|
type: 'content';
|
|
@@ -954,6 +964,149 @@ export interface BetaEncryptedCodeExecutionResultBlockParam {
|
|
|
954
964
|
stderr: string;
|
|
955
965
|
type: 'encrypted_code_execution_result';
|
|
956
966
|
}
|
|
967
|
+
/**
|
|
968
|
+
* Marks the point in `content` where one model's output gives way to the next.
|
|
969
|
+
*
|
|
970
|
+
* One block appears per hop where a preceding model actually ran this turn and
|
|
971
|
+
* declined. A turn routed directly by the sticky decision has no such boundary and
|
|
972
|
+
* carries no block — the signal for whether a fallback model served the response
|
|
973
|
+
* is the presence of a `fallback_message` entry in `usage.iterations`, not this
|
|
974
|
+
* block.
|
|
975
|
+
*
|
|
976
|
+
* The block is treated like a server-tool content block for streaming: it arrives
|
|
977
|
+
* via the standard `content_block_start` / `content_block_stop` pair and carries
|
|
978
|
+
* no deltas.
|
|
979
|
+
*/
|
|
980
|
+
export interface BetaFallbackBlock {
|
|
981
|
+
/**
|
|
982
|
+
* The model whose output ends at this point — the model that declined at this hop.
|
|
983
|
+
* When the declining hop is the requested model, its `model` echoes the top-level
|
|
984
|
+
* `model` string the caller sent (alias or canonical); when the declining hop is a
|
|
985
|
+
* fallback model, its `model` is that model's canonical id.
|
|
986
|
+
*/
|
|
987
|
+
from: BetaFallbackInfo;
|
|
988
|
+
/**
|
|
989
|
+
* The fallback model producing the content that follows this block. Its `model` is
|
|
990
|
+
* always the canonical id.
|
|
991
|
+
*/
|
|
992
|
+
to: BetaFallbackInfo;
|
|
993
|
+
type: 'fallback';
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* A `fallback` block echoed back from a prior response.
|
|
997
|
+
*
|
|
998
|
+
* Accepted in `messages[].content` and never rendered into the prompt, not
|
|
999
|
+
* validated against the request's `fallbacks` chain or top-level `model`, and
|
|
1000
|
+
* stripped before the sticky-routing cache key is computed.
|
|
1001
|
+
*
|
|
1002
|
+
* Callers should echo the assistant turn verbatim — block included. The block's
|
|
1003
|
+
* position is load-bearing for thinking verification: the thinking runs on either
|
|
1004
|
+
* side of a fallback hop carry independently-rooted verification hash chains, and
|
|
1005
|
+
* this block is the only record of where one chain ends and the next begins. When
|
|
1006
|
+
* thinking runs flank the boundary, omitting the block merges the runs into one
|
|
1007
|
+
* contiguous span whose hashes cannot verify (the request is rejected), and moving
|
|
1008
|
+
* it into the middle of a single run splits that run's chain and is likewise
|
|
1009
|
+
* rejected; between non-thinking blocks the block's placement has no verification
|
|
1010
|
+
* effect.
|
|
1011
|
+
*/
|
|
1012
|
+
export interface BetaFallbackBlockParam {
|
|
1013
|
+
/**
|
|
1014
|
+
* Identifies one hop of a fallback transition.
|
|
1015
|
+
*/
|
|
1016
|
+
from: BetaFallbackInfoParam;
|
|
1017
|
+
/**
|
|
1018
|
+
* Identifies one hop of a fallback transition.
|
|
1019
|
+
*/
|
|
1020
|
+
to: BetaFallbackInfoParam;
|
|
1021
|
+
type: 'fallback';
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Identifies one hop of a fallback transition.
|
|
1025
|
+
*/
|
|
1026
|
+
export interface BetaFallbackInfo {
|
|
1027
|
+
/**
|
|
1028
|
+
* The model that will complete your prompt.
|
|
1029
|
+
*
|
|
1030
|
+
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
1031
|
+
* details and options.
|
|
1032
|
+
*/
|
|
1033
|
+
model: MessagesAPI.Model;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Identifies one hop of a fallback transition.
|
|
1037
|
+
*/
|
|
1038
|
+
export interface BetaFallbackInfoParam {
|
|
1039
|
+
/**
|
|
1040
|
+
* The model that will complete your prompt.
|
|
1041
|
+
*
|
|
1042
|
+
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
1043
|
+
* details and options.
|
|
1044
|
+
*/
|
|
1045
|
+
model: MessagesAPI.Model;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Token usage for the fallback-model attempt of a server-side fallback request.
|
|
1049
|
+
*
|
|
1050
|
+
* Produced in place of a `message` entry for whichever hop served the response. A
|
|
1051
|
+
* declined hop produces the existing `message` entry. Whether a fallback model
|
|
1052
|
+
* served the response is signalled by the presence of this entry in
|
|
1053
|
+
* `usage.iterations`.
|
|
1054
|
+
*/
|
|
1055
|
+
export interface BetaFallbackMessageIterationUsage {
|
|
1056
|
+
/**
|
|
1057
|
+
* Breakdown of cached tokens by TTL
|
|
1058
|
+
*/
|
|
1059
|
+
cache_creation: BetaCacheCreation | null;
|
|
1060
|
+
/**
|
|
1061
|
+
* The number of input tokens used to create the cache entry.
|
|
1062
|
+
*/
|
|
1063
|
+
cache_creation_input_tokens: number;
|
|
1064
|
+
/**
|
|
1065
|
+
* The number of input tokens read from the cache.
|
|
1066
|
+
*/
|
|
1067
|
+
cache_read_input_tokens: number;
|
|
1068
|
+
/**
|
|
1069
|
+
* The number of input tokens which were used.
|
|
1070
|
+
*/
|
|
1071
|
+
input_tokens: number;
|
|
1072
|
+
/**
|
|
1073
|
+
* The model that will complete your prompt.
|
|
1074
|
+
*
|
|
1075
|
+
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
1076
|
+
* details and options.
|
|
1077
|
+
*/
|
|
1078
|
+
model: MessagesAPI.Model;
|
|
1079
|
+
/**
|
|
1080
|
+
* The number of output tokens which were used.
|
|
1081
|
+
*/
|
|
1082
|
+
output_tokens: number;
|
|
1083
|
+
/**
|
|
1084
|
+
* Usage for the fallback-model attempt that served the response
|
|
1085
|
+
*/
|
|
1086
|
+
type: 'fallback_message';
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* One entry in the `fallbacks` chain on a `/v1/messages` request.
|
|
1090
|
+
*
|
|
1091
|
+
* `model` is required. The four override fields (`max_tokens`, `thinking`,
|
|
1092
|
+
* `output_config`, and `speed`) replace the corresponding top-level field for this
|
|
1093
|
+
* attempt only and are validated as if the request were made to `model`. Any other
|
|
1094
|
+
* key is rejected at parse time.
|
|
1095
|
+
*/
|
|
1096
|
+
export interface BetaFallbackParam {
|
|
1097
|
+
/**
|
|
1098
|
+
* The model that will complete your prompt.
|
|
1099
|
+
*
|
|
1100
|
+
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
1101
|
+
* details and options.
|
|
1102
|
+
*/
|
|
1103
|
+
model: MessagesAPI.Model;
|
|
1104
|
+
max_tokens?: number | null;
|
|
1105
|
+
output_config?: BetaOutputConfig | null;
|
|
1106
|
+
speed?: 'standard' | 'fast' | null;
|
|
1107
|
+
thinking?: BetaThinkingConfigEnabled | BetaThinkingConfigDisabled | BetaThinkingConfigAdaptive | null;
|
|
1108
|
+
[k: string]: unknown;
|
|
1109
|
+
}
|
|
957
1110
|
export interface BetaFileDocumentSource {
|
|
958
1111
|
file_id: string;
|
|
959
1112
|
type: 'file';
|
|
@@ -992,7 +1145,7 @@ export interface BetaInputTokensTrigger {
|
|
|
992
1145
|
* - Calculate the true context window size from the last iteration
|
|
993
1146
|
* - Understand token accumulation across server-side tool use loops
|
|
994
1147
|
*/
|
|
995
|
-
export type BetaIterationsUsage = Array<BetaMessageIterationUsage | BetaCompactionIterationUsage | BetaAdvisorMessageIterationUsage>;
|
|
1148
|
+
export type BetaIterationsUsage = Array<BetaMessageIterationUsage | BetaCompactionIterationUsage | BetaAdvisorMessageIterationUsage | BetaFallbackMessageIterationUsage>;
|
|
996
1149
|
export interface BetaJSONOutputFormat {
|
|
997
1150
|
/**
|
|
998
1151
|
* The JSON schema of the format
|
|
@@ -1378,6 +1531,13 @@ export interface BetaMessageIterationUsage {
|
|
|
1378
1531
|
* The number of input tokens which were used.
|
|
1379
1532
|
*/
|
|
1380
1533
|
input_tokens: number;
|
|
1534
|
+
/**
|
|
1535
|
+
* The model that will complete your prompt.
|
|
1536
|
+
*
|
|
1537
|
+
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
1538
|
+
* details and options.
|
|
1539
|
+
*/
|
|
1540
|
+
model: MessagesAPI.Model;
|
|
1381
1541
|
/**
|
|
1382
1542
|
* The number of output tokens which were used.
|
|
1383
1543
|
*/
|
|
@@ -1473,7 +1633,7 @@ export interface BetaRawContentBlockStartEvent {
|
|
|
1473
1633
|
/**
|
|
1474
1634
|
* Response model for a file uploaded to the container.
|
|
1475
1635
|
*/
|
|
1476
|
-
content_block: BetaTextBlock | BetaThinkingBlock | BetaRedactedThinkingBlock | BetaToolUseBlock | BetaServerToolUseBlock | BetaWebSearchToolResultBlock | BetaWebFetchToolResultBlock | BetaAdvisorToolResultBlock | BetaCodeExecutionToolResultBlock | BetaBashCodeExecutionToolResultBlock | BetaTextEditorCodeExecutionToolResultBlock | BetaToolSearchToolResultBlock | BetaMCPToolUseBlock | BetaMCPToolResultBlock | BetaContainerUploadBlock | BetaCompactionBlock;
|
|
1636
|
+
content_block: BetaTextBlock | BetaThinkingBlock | BetaRedactedThinkingBlock | BetaToolUseBlock | BetaServerToolUseBlock | BetaWebSearchToolResultBlock | BetaWebFetchToolResultBlock | BetaAdvisorToolResultBlock | BetaCodeExecutionToolResultBlock | BetaBashCodeExecutionToolResultBlock | BetaTextEditorCodeExecutionToolResultBlock | BetaToolSearchToolResultBlock | BetaMCPToolUseBlock | BetaMCPToolResultBlock | BetaContainerUploadBlock | BetaCompactionBlock | BetaFallbackBlock;
|
|
1477
1637
|
index: number;
|
|
1478
1638
|
type: 'content_block_start';
|
|
1479
1639
|
}
|
|
@@ -1547,7 +1707,7 @@ export interface BetaRefusalStopDetails {
|
|
|
1547
1707
|
*
|
|
1548
1708
|
* `null` when the refusal doesn't map to a named category.
|
|
1549
1709
|
*/
|
|
1550
|
-
category: 'cyber' | 'bio' | null;
|
|
1710
|
+
category: 'cyber' | 'bio' | 'reasoning_extraction' | null;
|
|
1551
1711
|
/**
|
|
1552
1712
|
* Human-readable explanation of the refusal.
|
|
1553
1713
|
*
|
|
@@ -1555,6 +1715,56 @@ export interface BetaRefusalStopDetails {
|
|
|
1555
1715
|
* available for the category.
|
|
1556
1716
|
*/
|
|
1557
1717
|
explanation: string | null;
|
|
1718
|
+
/**
|
|
1719
|
+
* Opaque code that refunds the cache-miss cost when retrying this refused request
|
|
1720
|
+
* on the fallback model. Pass it as `fallback_credit_token` on the retry request.
|
|
1721
|
+
* Expires 5 minutes after the refusal.
|
|
1722
|
+
*
|
|
1723
|
+
* The retry is sent either with the same request body (`system`, `messages`,
|
|
1724
|
+
* `tools`, and other render-shaping fields), or with the same body plus one
|
|
1725
|
+
* appended `assistant` message whose content is the partial text (with any
|
|
1726
|
+
* trailing whitespace stripped from the final text block) and paired server-tool
|
|
1727
|
+
* blocks from this refusal — which also authorizes that appended turn as an
|
|
1728
|
+
* assistant-prefill continuation on models that otherwise disallow prefill. A
|
|
1729
|
+
* token minted mid-server-tool-loop whose partial content was continuable may only
|
|
1730
|
+
* be redeemed the second way — if a same-body retry is rejected with a 400 saying
|
|
1731
|
+
* the token must be redeemed by continuing the partial response, retry the second
|
|
1732
|
+
* way instead. Either way: same workspace, same platform; a mismatch is a 400.
|
|
1733
|
+
* Resending a token for an already-warm prefix is permitted but yields no
|
|
1734
|
+
* additional credit.
|
|
1735
|
+
*
|
|
1736
|
+
* `null` when the refused model isn't eligible for a fallback credit.
|
|
1737
|
+
*/
|
|
1738
|
+
fallback_credit_token: string | null;
|
|
1739
|
+
/**
|
|
1740
|
+
* Whether the accompanying `fallback_credit_token` may be redeemed with the
|
|
1741
|
+
* appended-assistant retry form. Only set when `fallback_credit_token` is present.
|
|
1742
|
+
*
|
|
1743
|
+
* `true`: retry by resending the same request body plus one appended `assistant`
|
|
1744
|
+
* message whose content is this response's `content` with any trailing whitespace
|
|
1745
|
+
* stripped from the final text block and unpaired `tool_use` blocks omitted (the
|
|
1746
|
+
* same appended-turn shape described on `fallback_credit_token`), with the token
|
|
1747
|
+
* attached. `false`: retry by resending the original request body unchanged, with
|
|
1748
|
+
* the token attached — the appended-assistant form is not available for this
|
|
1749
|
+
* refusal (no continuable partial content, or the request uses `output_format` or
|
|
1750
|
+
* a `tool_choice` that forces tool use). One exception: when the request used
|
|
1751
|
+
* `output_format` or a forced `tool_choice` and the refusal arrived after server
|
|
1752
|
+
* tools (including MCP connector tools) had already executed, the token may not be
|
|
1753
|
+
* redeemable by either retry form; if the exact-body retry is then rejected with a
|
|
1754
|
+
* 400 saying the token must be redeemed by continuing the partial response,
|
|
1755
|
+
* discard the token and retry without it.
|
|
1756
|
+
*
|
|
1757
|
+
* Advisory: if an appended-assistant retry is rejected with a 400 despite `true`,
|
|
1758
|
+
* fall back to resending the original request body with the token.
|
|
1759
|
+
*/
|
|
1760
|
+
fallback_has_prefill_claim: boolean | null;
|
|
1761
|
+
/**
|
|
1762
|
+
* The server's suggested retry target for this refusal. Populated when a fallback
|
|
1763
|
+
* attempt could not be made (the fallback model's rate limit was exhausted, or it
|
|
1764
|
+
* was overloaded); names the fallback model the caller can retry directly. Null
|
|
1765
|
+
* otherwise.
|
|
1766
|
+
*/
|
|
1767
|
+
recommended_model: string | null;
|
|
1558
1768
|
type: 'refusal';
|
|
1559
1769
|
}
|
|
1560
1770
|
export interface BetaRequestDocumentBlock {
|
|
@@ -2252,6 +2462,7 @@ export interface BetaToolSearchToolResultError {
|
|
|
2252
2462
|
export interface BetaToolSearchToolResultErrorParam {
|
|
2253
2463
|
error_code: 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded';
|
|
2254
2464
|
type: 'tool_search_tool_result_error';
|
|
2465
|
+
error_message?: string | null;
|
|
2255
2466
|
}
|
|
2256
2467
|
export interface BetaToolSearchToolSearchResultBlock {
|
|
2257
2468
|
tool_references: Array<BetaToolReferenceBlock>;
|
|
@@ -2941,6 +3152,34 @@ export interface MessageCreateParamsBase {
|
|
|
2941
3152
|
* id for prompt-cache divergence reporting.
|
|
2942
3153
|
*/
|
|
2943
3154
|
diagnostics?: BetaDiagnosticsParam | null;
|
|
3155
|
+
/**
|
|
3156
|
+
* Body param: The `fallback_credit_token` from a prior refusal's `stop_details`.
|
|
3157
|
+
*
|
|
3158
|
+
* When a preceding request was refused and returned a `fallback_credit_token`,
|
|
3159
|
+
* pass that code here on the retry to have the retry's cache-creation tokens for
|
|
3160
|
+
* the prefix that was warm on the refused model billed at the cache-read rate.
|
|
3161
|
+
* Must be redeemed by the same organization and workspace, with the same request
|
|
3162
|
+
* body (optionally extended by one appended `assistant` message whose content is
|
|
3163
|
+
* the partial text — with any trailing whitespace stripped from the final text
|
|
3164
|
+
* block — and paired server-tool blocks streamed before the refusal; the
|
|
3165
|
+
* appended-assistant form is not available for requests with `output_format` set
|
|
3166
|
+
* or forced `tool_choice`), on an eligible fallback model, on the same platform,
|
|
3167
|
+
* and within 5 minutes of the refusal; a mismatch is a 400. A token minted
|
|
3168
|
+
* mid-server-tool-loop whose partial content was continuable may only be redeemed
|
|
3169
|
+
* with the appended-assistant form — if an exact-body retry is rejected with a 400
|
|
3170
|
+
* saying the token must be redeemed by continuing the partial response, retry with
|
|
3171
|
+
* the appended-assistant form instead.
|
|
3172
|
+
*
|
|
3173
|
+
* When the appended-assistant form is used on a model that otherwise disallows
|
|
3174
|
+
* assistant-turn prefill, this token also authorizes that one prefill.
|
|
3175
|
+
*/
|
|
3176
|
+
fallback_credit_token?: string | null;
|
|
3177
|
+
/**
|
|
3178
|
+
* Body param: Opt-in server-side retry on one or more substitute models when the
|
|
3179
|
+
* requested model declines for policy reasons. Tried in order: if the first entry
|
|
3180
|
+
* also declines, the second is tried, and so on.
|
|
3181
|
+
*/
|
|
3182
|
+
fallbacks?: Array<BetaFallbackParam> | null;
|
|
2944
3183
|
/**
|
|
2945
3184
|
* Body param: Specifies the geographic region for inference processing. If not
|
|
2946
3185
|
* specified, the workspace's `default_inference_geo` is used.
|
|
@@ -3372,7 +3611,7 @@ export interface MessageCountTokensParams {
|
|
|
3372
3611
|
export { BetaToolRunner, type BetaToolRunnerParams } from "../../../lib/tools/BetaToolRunner.mjs";
|
|
3373
3612
|
export { ToolError } from "../../../lib/tools/ToolError.mjs";
|
|
3374
3613
|
export declare namespace Messages {
|
|
3375
|
-
export { type BetaAdvisorMessageIterationUsage as BetaAdvisorMessageIterationUsage, type BetaAdvisorRedactedResultBlock as BetaAdvisorRedactedResultBlock, type BetaAdvisorRedactedResultBlockParam as BetaAdvisorRedactedResultBlockParam, type BetaAdvisorResultBlock as BetaAdvisorResultBlock, type BetaAdvisorResultBlockParam as BetaAdvisorResultBlockParam, type BetaAdvisorTool20260301 as BetaAdvisorTool20260301, type BetaAdvisorToolResultBlock as BetaAdvisorToolResultBlock, type BetaAdvisorToolResultBlockParam as BetaAdvisorToolResultBlockParam, type BetaAdvisorToolResultError as BetaAdvisorToolResultError, type BetaAdvisorToolResultErrorParam as BetaAdvisorToolResultErrorParam, type BetaAllThinkingTurns as BetaAllThinkingTurns, type BetaBase64ImageSource as BetaBase64ImageSource, type BetaBase64PDFSource as BetaBase64PDFSource, type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock, type BetaBashCodeExecutionOutputBlockParam as BetaBashCodeExecutionOutputBlockParam, type BetaBashCodeExecutionResultBlock as BetaBashCodeExecutionResultBlock, type BetaBashCodeExecutionResultBlockParam as BetaBashCodeExecutionResultBlockParam, type BetaBashCodeExecutionToolResultBlock as BetaBashCodeExecutionToolResultBlock, type BetaBashCodeExecutionToolResultBlockParam as BetaBashCodeExecutionToolResultBlockParam, type BetaBashCodeExecutionToolResultError as BetaBashCodeExecutionToolResultError, type BetaBashCodeExecutionToolResultErrorParam as BetaBashCodeExecutionToolResultErrorParam, type BetaCacheControlEphemeral as BetaCacheControlEphemeral, type BetaCacheCreation as BetaCacheCreation, type BetaCacheMissMessagesChanged as BetaCacheMissMessagesChanged, type BetaCacheMissModelChanged as BetaCacheMissModelChanged, type BetaCacheMissPreviousMessageNotFound as BetaCacheMissPreviousMessageNotFound, type BetaCacheMissSystemChanged as BetaCacheMissSystemChanged, type BetaCacheMissToolsChanged as BetaCacheMissToolsChanged, type BetaCacheMissUnavailable as BetaCacheMissUnavailable, type BetaCitationCharLocation as BetaCitationCharLocation, type BetaCitationCharLocationParam as BetaCitationCharLocationParam, type BetaCitationConfig as BetaCitationConfig, type BetaCitationContentBlockLocation as BetaCitationContentBlockLocation, type BetaCitationContentBlockLocationParam as BetaCitationContentBlockLocationParam, type BetaCitationPageLocation as BetaCitationPageLocation, type BetaCitationPageLocationParam as BetaCitationPageLocationParam, type BetaCitationSearchResultLocation as BetaCitationSearchResultLocation, type BetaCitationSearchResultLocationParam as BetaCitationSearchResultLocationParam, type BetaCitationWebSearchResultLocationParam as BetaCitationWebSearchResultLocationParam, type BetaCitationsConfigParam as BetaCitationsConfigParam, type BetaCitationsDelta as BetaCitationsDelta, type BetaCitationsWebSearchResultLocation as BetaCitationsWebSearchResultLocation, type BetaClearThinking20251015Edit as BetaClearThinking20251015Edit, type BetaClearThinking20251015EditResponse as BetaClearThinking20251015EditResponse, type BetaClearToolUses20250919Edit as BetaClearToolUses20250919Edit, type BetaClearToolUses20250919EditResponse as BetaClearToolUses20250919EditResponse, type BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock, type BetaCodeExecutionOutputBlockParam as BetaCodeExecutionOutputBlockParam, type BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock, type BetaCodeExecutionResultBlockParam as BetaCodeExecutionResultBlockParam, type BetaCodeExecutionTool20250522 as BetaCodeExecutionTool20250522, type BetaCodeExecutionTool20250825 as BetaCodeExecutionTool20250825, type BetaCodeExecutionTool20260120 as BetaCodeExecutionTool20260120, type BetaCodeExecutionToolResultBlock as BetaCodeExecutionToolResultBlock, type BetaCodeExecutionToolResultBlockContent as BetaCodeExecutionToolResultBlockContent, type BetaCodeExecutionToolResultBlockParam as BetaCodeExecutionToolResultBlockParam, type BetaCodeExecutionToolResultBlockParamContent as BetaCodeExecutionToolResultBlockParamContent, type BetaCodeExecutionToolResultError as BetaCodeExecutionToolResultError, type BetaCodeExecutionToolResultErrorCode as BetaCodeExecutionToolResultErrorCode, type BetaCodeExecutionToolResultErrorParam as BetaCodeExecutionToolResultErrorParam, type BetaCompact20260112Edit as BetaCompact20260112Edit, type BetaCompactionBlock as BetaCompactionBlock, type BetaCompactionBlockParam as BetaCompactionBlockParam, type BetaCompactionContentBlockDelta as BetaCompactionContentBlockDelta, type BetaCompactionIterationUsage as BetaCompactionIterationUsage, type BetaContainer as BetaContainer, type BetaContainerParams as BetaContainerParams, type BetaContainerUploadBlock as BetaContainerUploadBlock, type BetaContainerUploadBlockParam as BetaContainerUploadBlockParam, type BetaContentBlock as BetaContentBlock, type BetaContentBlockParam as BetaContentBlockParam, type BetaContentBlockSource as BetaContentBlockSource, type BetaContentBlockSourceContent as BetaContentBlockSourceContent, type BetaContextManagementConfig as BetaContextManagementConfig, type BetaContextManagementResponse as BetaContextManagementResponse, type BetaCountTokensContextManagementResponse as BetaCountTokensContextManagementResponse, type BetaDiagnostics as BetaDiagnostics, type BetaDiagnosticsParam as BetaDiagnosticsParam, type BetaDirectCaller as BetaDirectCaller, type BetaDocumentBlock as BetaDocumentBlock, type BetaEncryptedCodeExecutionResultBlock as BetaEncryptedCodeExecutionResultBlock, type BetaEncryptedCodeExecutionResultBlockParam as BetaEncryptedCodeExecutionResultBlockParam, type BetaFileDocumentSource as BetaFileDocumentSource, type BetaFileImageSource as BetaFileImageSource, type BetaImageBlockParam as BetaImageBlockParam, type BetaInputJSONDelta as BetaInputJSONDelta, type BetaInputTokensClearAtLeast as BetaInputTokensClearAtLeast, type BetaInputTokensTrigger as BetaInputTokensTrigger, type BetaIterationsUsage as BetaIterationsUsage, type BetaJSONOutputFormat as BetaJSONOutputFormat, type BetaMCPToolConfig as BetaMCPToolConfig, type BetaMCPToolDefaultConfig as BetaMCPToolDefaultConfig, type BetaMCPToolResultBlock as BetaMCPToolResultBlock, type BetaMCPToolUseBlock as BetaMCPToolUseBlock, type BetaMCPToolUseBlockParam as BetaMCPToolUseBlockParam, type BetaMCPToolset as BetaMCPToolset, type BetaMemoryTool20250818 as BetaMemoryTool20250818, type BetaMemoryTool20250818Command as BetaMemoryTool20250818Command, type BetaMemoryTool20250818CreateCommand as BetaMemoryTool20250818CreateCommand, type BetaMemoryTool20250818DeleteCommand as BetaMemoryTool20250818DeleteCommand, type BetaMemoryTool20250818InsertCommand as BetaMemoryTool20250818InsertCommand, type BetaMemoryTool20250818RenameCommand as BetaMemoryTool20250818RenameCommand, type BetaMemoryTool20250818StrReplaceCommand as BetaMemoryTool20250818StrReplaceCommand, type BetaMemoryTool20250818ViewCommand as BetaMemoryTool20250818ViewCommand, type BetaMessage as BetaMessage, type BetaMessageDeltaUsage as BetaMessageDeltaUsage, type BetaMessageIterationUsage as BetaMessageIterationUsage, type BetaMessageParam as BetaMessageParam, type BetaMessageTokensCount as BetaMessageTokensCount, type BetaMetadata as BetaMetadata, type BetaMidConversationSystemBlockParam as BetaMidConversationSystemBlockParam, type BetaOutputConfig as BetaOutputConfig, type BetaOutputTokensDetails as BetaOutputTokensDetails, type BetaPlainTextSource as BetaPlainTextSource, type BetaRawContentBlockDelta as BetaRawContentBlockDelta, type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent, type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent, type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent, type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent, type BetaRawMessageStartEvent as BetaRawMessageStartEvent, type BetaRawMessageStopEvent as BetaRawMessageStopEvent, type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent, type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock, type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam, type BetaRefusalStopDetails as BetaRefusalStopDetails, type BetaRequestDocumentBlock as BetaRequestDocumentBlock, type BetaRequestMCPServerToolConfiguration as BetaRequestMCPServerToolConfiguration, type BetaRequestMCPServerURLDefinition as BetaRequestMCPServerURLDefinition, type BetaRequestMCPToolResultBlockParam as BetaRequestMCPToolResultBlockParam, type BetaSearchResultBlockParam as BetaSearchResultBlockParam, type BetaServerToolCaller as BetaServerToolCaller, type BetaServerToolCaller20260120 as BetaServerToolCaller20260120, type BetaServerToolUsage as BetaServerToolUsage, type BetaServerToolUseBlock as BetaServerToolUseBlock, type BetaServerToolUseBlockParam as BetaServerToolUseBlockParam, type BetaSignatureDelta as BetaSignatureDelta, type BetaSkill as BetaSkill, type BetaSkillParams as BetaSkillParams, type BetaStopReason as BetaStopReason, type BetaTextBlock as BetaTextBlock, type BetaTextBlockParam as BetaTextBlockParam, type BetaTextCitation as BetaTextCitation, type BetaTextCitationParam as BetaTextCitationParam, type BetaTextDelta as BetaTextDelta, type BetaTextEditorCodeExecutionCreateResultBlock as BetaTextEditorCodeExecutionCreateResultBlock, type BetaTextEditorCodeExecutionCreateResultBlockParam as BetaTextEditorCodeExecutionCreateResultBlockParam, type BetaTextEditorCodeExecutionStrReplaceResultBlock as BetaTextEditorCodeExecutionStrReplaceResultBlock, type BetaTextEditorCodeExecutionStrReplaceResultBlockParam as BetaTextEditorCodeExecutionStrReplaceResultBlockParam, type BetaTextEditorCodeExecutionToolResultBlock as BetaTextEditorCodeExecutionToolResultBlock, type BetaTextEditorCodeExecutionToolResultBlockParam as BetaTextEditorCodeExecutionToolResultBlockParam, type BetaTextEditorCodeExecutionToolResultError as BetaTextEditorCodeExecutionToolResultError, type BetaTextEditorCodeExecutionToolResultErrorParam as BetaTextEditorCodeExecutionToolResultErrorParam, type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock, type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam, type BetaThinkingBlock as BetaThinkingBlock, type BetaThinkingBlockParam as BetaThinkingBlockParam, type BetaThinkingConfigAdaptive as BetaThinkingConfigAdaptive, type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled, type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled, type BetaThinkingConfigParam as BetaThinkingConfigParam, type BetaThinkingDelta as BetaThinkingDelta, type BetaThinkingTurns as BetaThinkingTurns, type BetaTokenTaskBudget as BetaTokenTaskBudget, type BetaTool as BetaTool, type BetaToolBash20241022 as BetaToolBash20241022, type BetaToolBash20250124 as BetaToolBash20250124, type BetaToolChoice as BetaToolChoice, type BetaToolChoiceAny as BetaToolChoiceAny, type BetaToolChoiceAuto as BetaToolChoiceAuto, type BetaToolChoiceNone as BetaToolChoiceNone, type BetaToolChoiceTool as BetaToolChoiceTool, type BetaToolComputerUse20241022 as BetaToolComputerUse20241022, type BetaToolComputerUse20250124 as BetaToolComputerUse20250124, type BetaToolComputerUse20251124 as BetaToolComputerUse20251124, type BetaToolReferenceBlock as BetaToolReferenceBlock, type BetaToolReferenceBlockParam as BetaToolReferenceBlockParam, type BetaToolResultBlockParam as BetaToolResultBlockParam, type BetaToolResultContentBlockParam as BetaToolResultContentBlockParam, type BetaToolSearchToolBm25_20251119 as BetaToolSearchToolBm25_20251119, type BetaToolSearchToolRegex20251119 as BetaToolSearchToolRegex20251119, type BetaToolSearchToolResultBlock as BetaToolSearchToolResultBlock, type BetaToolSearchToolResultBlockParam as BetaToolSearchToolResultBlockParam, type BetaToolSearchToolResultError as BetaToolSearchToolResultError, type BetaToolSearchToolResultErrorParam as BetaToolSearchToolResultErrorParam, type BetaToolSearchToolSearchResultBlock as BetaToolSearchToolSearchResultBlock, type BetaToolSearchToolSearchResultBlockParam as BetaToolSearchToolSearchResultBlockParam, type BetaToolTextEditor20241022 as BetaToolTextEditor20241022, type BetaToolTextEditor20250124 as BetaToolTextEditor20250124, type BetaToolTextEditor20250429 as BetaToolTextEditor20250429, type BetaToolTextEditor20250728 as BetaToolTextEditor20250728, type BetaToolUnion as BetaToolUnion, type BetaToolUseBlock as BetaToolUseBlock, type BetaToolUseBlockParam as BetaToolUseBlockParam, type BetaToolUsesKeep as BetaToolUsesKeep, type BetaToolUsesTrigger as BetaToolUsesTrigger, type BetaURLImageSource as BetaURLImageSource, type BetaURLPDFSource as BetaURLPDFSource, type BetaUsage as BetaUsage, type BetaUserLocation as BetaUserLocation, type BetaWebFetchBlock as BetaWebFetchBlock, type BetaWebFetchBlockParam as BetaWebFetchBlockParam, type BetaWebFetchTool20250910 as BetaWebFetchTool20250910, type BetaWebFetchTool20260209 as BetaWebFetchTool20260209, type BetaWebFetchTool20260309 as BetaWebFetchTool20260309, type BetaWebFetchToolResultBlock as BetaWebFetchToolResultBlock, type BetaWebFetchToolResultBlockParam as BetaWebFetchToolResultBlockParam, type BetaWebFetchToolResultErrorBlock as BetaWebFetchToolResultErrorBlock, type BetaWebFetchToolResultErrorBlockParam as BetaWebFetchToolResultErrorBlockParam, type BetaWebFetchToolResultErrorCode as BetaWebFetchToolResultErrorCode, type BetaWebSearchResultBlock as BetaWebSearchResultBlock, type BetaWebSearchResultBlockParam as BetaWebSearchResultBlockParam, type BetaWebSearchTool20250305 as BetaWebSearchTool20250305, type BetaWebSearchTool20260209 as BetaWebSearchTool20260209, type BetaWebSearchToolRequestError as BetaWebSearchToolRequestError, type BetaWebSearchToolResultBlock as BetaWebSearchToolResultBlock, type BetaWebSearchToolResultBlockContent as BetaWebSearchToolResultBlockContent, type BetaWebSearchToolResultBlockParam as BetaWebSearchToolResultBlockParam, type BetaWebSearchToolResultBlockParamContent as BetaWebSearchToolResultBlockParamContent, type BetaWebSearchToolResultError as BetaWebSearchToolResultError, type BetaWebSearchToolResultErrorCode as BetaWebSearchToolResultErrorCode, type BetaBase64PDFBlock as BetaBase64PDFBlock, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageCountTokensParams as MessageCountTokensParams, };
|
|
3614
|
+
export { type BetaAdvisorMessageIterationUsage as BetaAdvisorMessageIterationUsage, type BetaAdvisorRedactedResultBlock as BetaAdvisorRedactedResultBlock, type BetaAdvisorRedactedResultBlockParam as BetaAdvisorRedactedResultBlockParam, type BetaAdvisorResultBlock as BetaAdvisorResultBlock, type BetaAdvisorResultBlockParam as BetaAdvisorResultBlockParam, type BetaAdvisorTool20260301 as BetaAdvisorTool20260301, type BetaAdvisorToolResultBlock as BetaAdvisorToolResultBlock, type BetaAdvisorToolResultBlockParam as BetaAdvisorToolResultBlockParam, type BetaAdvisorToolResultError as BetaAdvisorToolResultError, type BetaAdvisorToolResultErrorParam as BetaAdvisorToolResultErrorParam, type BetaAllThinkingTurns as BetaAllThinkingTurns, type BetaBase64ImageSource as BetaBase64ImageSource, type BetaBase64PDFSource as BetaBase64PDFSource, type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock, type BetaBashCodeExecutionOutputBlockParam as BetaBashCodeExecutionOutputBlockParam, type BetaBashCodeExecutionResultBlock as BetaBashCodeExecutionResultBlock, type BetaBashCodeExecutionResultBlockParam as BetaBashCodeExecutionResultBlockParam, type BetaBashCodeExecutionToolResultBlock as BetaBashCodeExecutionToolResultBlock, type BetaBashCodeExecutionToolResultBlockParam as BetaBashCodeExecutionToolResultBlockParam, type BetaBashCodeExecutionToolResultError as BetaBashCodeExecutionToolResultError, type BetaBashCodeExecutionToolResultErrorParam as BetaBashCodeExecutionToolResultErrorParam, type BetaCacheControlEphemeral as BetaCacheControlEphemeral, type BetaCacheCreation as BetaCacheCreation, type BetaCacheMissMessagesChanged as BetaCacheMissMessagesChanged, type BetaCacheMissModelChanged as BetaCacheMissModelChanged, type BetaCacheMissPreviousMessageNotFound as BetaCacheMissPreviousMessageNotFound, type BetaCacheMissSystemChanged as BetaCacheMissSystemChanged, type BetaCacheMissToolsChanged as BetaCacheMissToolsChanged, type BetaCacheMissUnavailable as BetaCacheMissUnavailable, type BetaCitationCharLocation as BetaCitationCharLocation, type BetaCitationCharLocationParam as BetaCitationCharLocationParam, type BetaCitationConfig as BetaCitationConfig, type BetaCitationContentBlockLocation as BetaCitationContentBlockLocation, type BetaCitationContentBlockLocationParam as BetaCitationContentBlockLocationParam, type BetaCitationPageLocation as BetaCitationPageLocation, type BetaCitationPageLocationParam as BetaCitationPageLocationParam, type BetaCitationSearchResultLocation as BetaCitationSearchResultLocation, type BetaCitationSearchResultLocationParam as BetaCitationSearchResultLocationParam, type BetaCitationWebSearchResultLocationParam as BetaCitationWebSearchResultLocationParam, type BetaCitationsConfigParam as BetaCitationsConfigParam, type BetaCitationsDelta as BetaCitationsDelta, type BetaCitationsWebSearchResultLocation as BetaCitationsWebSearchResultLocation, type BetaClearThinking20251015Edit as BetaClearThinking20251015Edit, type BetaClearThinking20251015EditResponse as BetaClearThinking20251015EditResponse, type BetaClearToolUses20250919Edit as BetaClearToolUses20250919Edit, type BetaClearToolUses20250919EditResponse as BetaClearToolUses20250919EditResponse, type BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock, type BetaCodeExecutionOutputBlockParam as BetaCodeExecutionOutputBlockParam, type BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock, type BetaCodeExecutionResultBlockParam as BetaCodeExecutionResultBlockParam, type BetaCodeExecutionTool20250522 as BetaCodeExecutionTool20250522, type BetaCodeExecutionTool20250825 as BetaCodeExecutionTool20250825, type BetaCodeExecutionTool20260120 as BetaCodeExecutionTool20260120, type BetaCodeExecutionToolResultBlock as BetaCodeExecutionToolResultBlock, type BetaCodeExecutionToolResultBlockContent as BetaCodeExecutionToolResultBlockContent, type BetaCodeExecutionToolResultBlockParam as BetaCodeExecutionToolResultBlockParam, type BetaCodeExecutionToolResultBlockParamContent as BetaCodeExecutionToolResultBlockParamContent, type BetaCodeExecutionToolResultError as BetaCodeExecutionToolResultError, type BetaCodeExecutionToolResultErrorCode as BetaCodeExecutionToolResultErrorCode, type BetaCodeExecutionToolResultErrorParam as BetaCodeExecutionToolResultErrorParam, type BetaCompact20260112Edit as BetaCompact20260112Edit, type BetaCompactionBlock as BetaCompactionBlock, type BetaCompactionBlockParam as BetaCompactionBlockParam, type BetaCompactionContentBlockDelta as BetaCompactionContentBlockDelta, type BetaCompactionIterationUsage as BetaCompactionIterationUsage, type BetaContainer as BetaContainer, type BetaContainerParams as BetaContainerParams, type BetaContainerUploadBlock as BetaContainerUploadBlock, type BetaContainerUploadBlockParam as BetaContainerUploadBlockParam, type BetaContentBlock as BetaContentBlock, type BetaContentBlockParam as BetaContentBlockParam, type BetaContentBlockSource as BetaContentBlockSource, type BetaContentBlockSourceContent as BetaContentBlockSourceContent, type BetaContextManagementConfig as BetaContextManagementConfig, type BetaContextManagementResponse as BetaContextManagementResponse, type BetaCountTokensContextManagementResponse as BetaCountTokensContextManagementResponse, type BetaDiagnostics as BetaDiagnostics, type BetaDiagnosticsParam as BetaDiagnosticsParam, type BetaDirectCaller as BetaDirectCaller, type BetaDocumentBlock as BetaDocumentBlock, type BetaEncryptedCodeExecutionResultBlock as BetaEncryptedCodeExecutionResultBlock, type BetaEncryptedCodeExecutionResultBlockParam as BetaEncryptedCodeExecutionResultBlockParam, type BetaFallbackBlock as BetaFallbackBlock, type BetaFallbackBlockParam as BetaFallbackBlockParam, type BetaFallbackInfo as BetaFallbackInfo, type BetaFallbackInfoParam as BetaFallbackInfoParam, type BetaFallbackMessageIterationUsage as BetaFallbackMessageIterationUsage, type BetaFallbackParam as BetaFallbackParam, type BetaFileDocumentSource as BetaFileDocumentSource, type BetaFileImageSource as BetaFileImageSource, type BetaImageBlockParam as BetaImageBlockParam, type BetaInputJSONDelta as BetaInputJSONDelta, type BetaInputTokensClearAtLeast as BetaInputTokensClearAtLeast, type BetaInputTokensTrigger as BetaInputTokensTrigger, type BetaIterationsUsage as BetaIterationsUsage, type BetaJSONOutputFormat as BetaJSONOutputFormat, type BetaMCPToolConfig as BetaMCPToolConfig, type BetaMCPToolDefaultConfig as BetaMCPToolDefaultConfig, type BetaMCPToolResultBlock as BetaMCPToolResultBlock, type BetaMCPToolUseBlock as BetaMCPToolUseBlock, type BetaMCPToolUseBlockParam as BetaMCPToolUseBlockParam, type BetaMCPToolset as BetaMCPToolset, type BetaMemoryTool20250818 as BetaMemoryTool20250818, type BetaMemoryTool20250818Command as BetaMemoryTool20250818Command, type BetaMemoryTool20250818CreateCommand as BetaMemoryTool20250818CreateCommand, type BetaMemoryTool20250818DeleteCommand as BetaMemoryTool20250818DeleteCommand, type BetaMemoryTool20250818InsertCommand as BetaMemoryTool20250818InsertCommand, type BetaMemoryTool20250818RenameCommand as BetaMemoryTool20250818RenameCommand, type BetaMemoryTool20250818StrReplaceCommand as BetaMemoryTool20250818StrReplaceCommand, type BetaMemoryTool20250818ViewCommand as BetaMemoryTool20250818ViewCommand, type BetaMessage as BetaMessage, type BetaMessageDeltaUsage as BetaMessageDeltaUsage, type BetaMessageIterationUsage as BetaMessageIterationUsage, type BetaMessageParam as BetaMessageParam, type BetaMessageTokensCount as BetaMessageTokensCount, type BetaMetadata as BetaMetadata, type BetaMidConversationSystemBlockParam as BetaMidConversationSystemBlockParam, type BetaOutputConfig as BetaOutputConfig, type BetaOutputTokensDetails as BetaOutputTokensDetails, type BetaPlainTextSource as BetaPlainTextSource, type BetaRawContentBlockDelta as BetaRawContentBlockDelta, type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent, type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent, type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent, type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent, type BetaRawMessageStartEvent as BetaRawMessageStartEvent, type BetaRawMessageStopEvent as BetaRawMessageStopEvent, type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent, type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock, type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam, type BetaRefusalStopDetails as BetaRefusalStopDetails, type BetaRequestDocumentBlock as BetaRequestDocumentBlock, type BetaRequestMCPServerToolConfiguration as BetaRequestMCPServerToolConfiguration, type BetaRequestMCPServerURLDefinition as BetaRequestMCPServerURLDefinition, type BetaRequestMCPToolResultBlockParam as BetaRequestMCPToolResultBlockParam, type BetaSearchResultBlockParam as BetaSearchResultBlockParam, type BetaServerToolCaller as BetaServerToolCaller, type BetaServerToolCaller20260120 as BetaServerToolCaller20260120, type BetaServerToolUsage as BetaServerToolUsage, type BetaServerToolUseBlock as BetaServerToolUseBlock, type BetaServerToolUseBlockParam as BetaServerToolUseBlockParam, type BetaSignatureDelta as BetaSignatureDelta, type BetaSkill as BetaSkill, type BetaSkillParams as BetaSkillParams, type BetaStopReason as BetaStopReason, type BetaTextBlock as BetaTextBlock, type BetaTextBlockParam as BetaTextBlockParam, type BetaTextCitation as BetaTextCitation, type BetaTextCitationParam as BetaTextCitationParam, type BetaTextDelta as BetaTextDelta, type BetaTextEditorCodeExecutionCreateResultBlock as BetaTextEditorCodeExecutionCreateResultBlock, type BetaTextEditorCodeExecutionCreateResultBlockParam as BetaTextEditorCodeExecutionCreateResultBlockParam, type BetaTextEditorCodeExecutionStrReplaceResultBlock as BetaTextEditorCodeExecutionStrReplaceResultBlock, type BetaTextEditorCodeExecutionStrReplaceResultBlockParam as BetaTextEditorCodeExecutionStrReplaceResultBlockParam, type BetaTextEditorCodeExecutionToolResultBlock as BetaTextEditorCodeExecutionToolResultBlock, type BetaTextEditorCodeExecutionToolResultBlockParam as BetaTextEditorCodeExecutionToolResultBlockParam, type BetaTextEditorCodeExecutionToolResultError as BetaTextEditorCodeExecutionToolResultError, type BetaTextEditorCodeExecutionToolResultErrorParam as BetaTextEditorCodeExecutionToolResultErrorParam, type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock, type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam, type BetaThinkingBlock as BetaThinkingBlock, type BetaThinkingBlockParam as BetaThinkingBlockParam, type BetaThinkingConfigAdaptive as BetaThinkingConfigAdaptive, type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled, type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled, type BetaThinkingConfigParam as BetaThinkingConfigParam, type BetaThinkingDelta as BetaThinkingDelta, type BetaThinkingTurns as BetaThinkingTurns, type BetaTokenTaskBudget as BetaTokenTaskBudget, type BetaTool as BetaTool, type BetaToolBash20241022 as BetaToolBash20241022, type BetaToolBash20250124 as BetaToolBash20250124, type BetaToolChoice as BetaToolChoice, type BetaToolChoiceAny as BetaToolChoiceAny, type BetaToolChoiceAuto as BetaToolChoiceAuto, type BetaToolChoiceNone as BetaToolChoiceNone, type BetaToolChoiceTool as BetaToolChoiceTool, type BetaToolComputerUse20241022 as BetaToolComputerUse20241022, type BetaToolComputerUse20250124 as BetaToolComputerUse20250124, type BetaToolComputerUse20251124 as BetaToolComputerUse20251124, type BetaToolReferenceBlock as BetaToolReferenceBlock, type BetaToolReferenceBlockParam as BetaToolReferenceBlockParam, type BetaToolResultBlockParam as BetaToolResultBlockParam, type BetaToolResultContentBlockParam as BetaToolResultContentBlockParam, type BetaToolSearchToolBm25_20251119 as BetaToolSearchToolBm25_20251119, type BetaToolSearchToolRegex20251119 as BetaToolSearchToolRegex20251119, type BetaToolSearchToolResultBlock as BetaToolSearchToolResultBlock, type BetaToolSearchToolResultBlockParam as BetaToolSearchToolResultBlockParam, type BetaToolSearchToolResultError as BetaToolSearchToolResultError, type BetaToolSearchToolResultErrorParam as BetaToolSearchToolResultErrorParam, type BetaToolSearchToolSearchResultBlock as BetaToolSearchToolSearchResultBlock, type BetaToolSearchToolSearchResultBlockParam as BetaToolSearchToolSearchResultBlockParam, type BetaToolTextEditor20241022 as BetaToolTextEditor20241022, type BetaToolTextEditor20250124 as BetaToolTextEditor20250124, type BetaToolTextEditor20250429 as BetaToolTextEditor20250429, type BetaToolTextEditor20250728 as BetaToolTextEditor20250728, type BetaToolUnion as BetaToolUnion, type BetaToolUseBlock as BetaToolUseBlock, type BetaToolUseBlockParam as BetaToolUseBlockParam, type BetaToolUsesKeep as BetaToolUsesKeep, type BetaToolUsesTrigger as BetaToolUsesTrigger, type BetaURLImageSource as BetaURLImageSource, type BetaURLPDFSource as BetaURLPDFSource, type BetaUsage as BetaUsage, type BetaUserLocation as BetaUserLocation, type BetaWebFetchBlock as BetaWebFetchBlock, type BetaWebFetchBlockParam as BetaWebFetchBlockParam, type BetaWebFetchTool20250910 as BetaWebFetchTool20250910, type BetaWebFetchTool20260209 as BetaWebFetchTool20260209, type BetaWebFetchTool20260309 as BetaWebFetchTool20260309, type BetaWebFetchToolResultBlock as BetaWebFetchToolResultBlock, type BetaWebFetchToolResultBlockParam as BetaWebFetchToolResultBlockParam, type BetaWebFetchToolResultErrorBlock as BetaWebFetchToolResultErrorBlock, type BetaWebFetchToolResultErrorBlockParam as BetaWebFetchToolResultErrorBlockParam, type BetaWebFetchToolResultErrorCode as BetaWebFetchToolResultErrorCode, type BetaWebSearchResultBlock as BetaWebSearchResultBlock, type BetaWebSearchResultBlockParam as BetaWebSearchResultBlockParam, type BetaWebSearchTool20250305 as BetaWebSearchTool20250305, type BetaWebSearchTool20260209 as BetaWebSearchTool20260209, type BetaWebSearchToolRequestError as BetaWebSearchToolRequestError, type BetaWebSearchToolResultBlock as BetaWebSearchToolResultBlock, type BetaWebSearchToolResultBlockContent as BetaWebSearchToolResultBlockContent, type BetaWebSearchToolResultBlockParam as BetaWebSearchToolResultBlockParam, type BetaWebSearchToolResultBlockParamContent as BetaWebSearchToolResultBlockParamContent, type BetaWebSearchToolResultError as BetaWebSearchToolResultError, type BetaWebSearchToolResultErrorCode as BetaWebSearchToolResultErrorCode, type BetaBase64PDFBlock as BetaBase64PDFBlock, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageCountTokensParams as MessageCountTokensParams, };
|
|
3376
3615
|
export { type BetaToolRunnerParams, BetaToolRunner };
|
|
3377
3616
|
export { ToolError };
|
|
3378
3617
|
export { Batches as Batches, type BetaDeletedMessageBatch as BetaDeletedMessageBatch, type BetaMessageBatch as BetaMessageBatch, type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult, type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult, type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult, type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts, type BetaMessageBatchResult as BetaMessageBatchResult, type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult, type BetaMessageBatchesPage as BetaMessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchRetrieveParams as BatchRetrieveParams, type BatchListParams as BatchListParams, type BatchDeleteParams as BatchDeleteParams, type BatchCancelParams as BatchCancelParams, type BatchResultsParams as BatchResultsParams, };
|