Skip to content

Commit 75f4afe

Browse files
stainless-ci-botRobertCraigie
authored andcommitted
feat(api): add claude-3.7 + support for thinking
1 parent 521d6cd commit 75f4afe

File tree

17 files changed

+585
-119
lines changed

17 files changed

+585
-119
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-bda1c6bb3a8f16d4b0a936aa3a7b1618f23d38570547e7ef047a9c95265e6613.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-e1328d31b4446324096fb948bd5074b5ac00d7c7e3ce89b6974a1c5aebf5a64d.yml

api.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Types:
4141
- <code><a href="./src/resources/messages/messages.ts">ImageBlockParam</a></code>
4242
- <code><a href="./src/resources/messages/messages.ts">InputJSONDelta</a></code>
4343
- <code><a href="./src/resources/messages/messages.ts">Message</a></code>
44+
- <code><a href="./src/resources/messages/messages.ts">MessageCountTokensTool</a></code>
4445
- <code><a href="./src/resources/messages/messages.ts">MessageDeltaEvent</a></code>
4546
- <code><a href="./src/resources/messages/messages.ts">MessageDeltaUsage</a></code>
4647
- <code><a href="./src/resources/messages/messages.ts">MessageParam</a></code>
@@ -58,17 +59,29 @@ Types:
5859
- <code><a href="./src/resources/messages/messages.ts">RawMessageStartEvent</a></code>
5960
- <code><a href="./src/resources/messages/messages.ts">RawMessageStopEvent</a></code>
6061
- <code><a href="./src/resources/messages/messages.ts">RawMessageStreamEvent</a></code>
62+
- <code><a href="./src/resources/messages/messages.ts">RedactedThinkingBlock</a></code>
63+
- <code><a href="./src/resources/messages/messages.ts">RedactedThinkingBlockParam</a></code>
64+
- <code><a href="./src/resources/messages/messages.ts">SignatureDelta</a></code>
6165
- <code><a href="./src/resources/messages/messages.ts">TextBlock</a></code>
6266
- <code><a href="./src/resources/messages/messages.ts">TextBlockParam</a></code>
6367
- <code><a href="./src/resources/messages/messages.ts">TextCitation</a></code>
6468
- <code><a href="./src/resources/messages/messages.ts">TextCitationParam</a></code>
6569
- <code><a href="./src/resources/messages/messages.ts">TextDelta</a></code>
70+
- <code><a href="./src/resources/messages/messages.ts">ThinkingBlock</a></code>
71+
- <code><a href="./src/resources/messages/messages.ts">ThinkingBlockParam</a></code>
72+
- <code><a href="./src/resources/messages/messages.ts">ThinkingConfigDisabled</a></code>
73+
- <code><a href="./src/resources/messages/messages.ts">ThinkingConfigEnabled</a></code>
74+
- <code><a href="./src/resources/messages/messages.ts">ThinkingConfigParam</a></code>
75+
- <code><a href="./src/resources/messages/messages.ts">ThinkingDelta</a></code>
6676
- <code><a href="./src/resources/messages/messages.ts">Tool</a></code>
77+
- <code><a href="./src/resources/messages/messages.ts">ToolBash20250124</a></code>
6778
- <code><a href="./src/resources/messages/messages.ts">ToolChoice</a></code>
6879
- <code><a href="./src/resources/messages/messages.ts">ToolChoiceAny</a></code>
6980
- <code><a href="./src/resources/messages/messages.ts">ToolChoiceAuto</a></code>
7081
- <code><a href="./src/resources/messages/messages.ts">ToolChoiceTool</a></code>
7182
- <code><a href="./src/resources/messages/messages.ts">ToolResultBlockParam</a></code>
83+
- <code><a href="./src/resources/messages/messages.ts">ToolTextEditor20250124</a></code>
84+
- <code><a href="./src/resources/messages/messages.ts">ToolUnion</a></code>
7285
- <code><a href="./src/resources/messages/messages.ts">ToolUseBlock</a></code>
7386
- <code><a href="./src/resources/messages/messages.ts">ToolUseBlockParam</a></code>
7487
- <code><a href="./src/resources/messages/messages.ts">Usage</a></code>
@@ -175,20 +188,32 @@ Types:
175188
- <code><a href="./src/resources/beta/messages/messages.ts">BetaRawMessageStartEvent</a></code>
176189
- <code><a href="./src/resources/beta/messages/messages.ts">BetaRawMessageStopEvent</a></code>
177190
- <code><a href="./src/resources/beta/messages/messages.ts">BetaRawMessageStreamEvent</a></code>
191+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaRedactedThinkingBlock</a></code>
192+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaRedactedThinkingBlockParam</a></code>
193+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaSignatureDelta</a></code>
178194
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTextBlock</a></code>
179195
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTextBlockParam</a></code>
180196
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTextCitation</a></code>
181197
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTextCitationParam</a></code>
182198
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTextDelta</a></code>
199+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingBlock</a></code>
200+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingBlockParam</a></code>
201+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingConfigDisabled</a></code>
202+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingConfigEnabled</a></code>
203+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingConfigParam</a></code>
204+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaThinkingDelta</a></code>
183205
- <code><a href="./src/resources/beta/messages/messages.ts">BetaTool</a></code>
184206
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolBash20241022</a></code>
207+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolBash20250124</a></code>
185208
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolChoice</a></code>
186209
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolChoiceAny</a></code>
187210
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolChoiceAuto</a></code>
188211
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolChoiceTool</a></code>
189212
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolComputerUse20241022</a></code>
213+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolComputerUse20250124</a></code>
190214
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolResultBlockParam</a></code>
191215
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolTextEditor20241022</a></code>
216+
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolTextEditor20250124</a></code>
192217
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolUnion</a></code>
193218
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolUseBlock</a></code>
194219
- <code><a href="./src/resources/beta/messages/messages.ts">BetaToolUseBlockParam</a></code>

src/client.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
Message,
7272
MessageStreamParams,
7373
MessageCountTokensParams,
74+
MessageCountTokensTool,
7475
MessageCreateParams,
7576
MessageCreateParamsNonStreaming,
7677
MessageCreateParamsStreaming,
@@ -92,17 +93,29 @@ import {
9293
RawMessageStartEvent,
9394
RawMessageStopEvent,
9495
RawMessageStreamEvent,
96+
RedactedThinkingBlock,
97+
RedactedThinkingBlockParam,
98+
SignatureDelta,
9599
TextBlock,
96100
TextBlockParam,
97101
TextCitation,
98102
TextCitationParam,
99103
TextDelta,
104+
ThinkingBlock,
105+
ThinkingBlockParam,
106+
ThinkingConfigDisabled,
107+
ThinkingConfigEnabled,
108+
ThinkingConfigParam,
109+
ThinkingDelta,
100110
Tool,
111+
ToolBash20250124,
101112
ToolChoice,
102113
ToolChoiceAny,
103114
ToolChoiceAuto,
104115
ToolChoiceTool,
105116
ToolResultBlockParam,
117+
ToolTextEditor20250124,
118+
ToolUnion,
106119
ToolUseBlock,
107120
ToolUseBlockParam,
108121
Usage,
@@ -933,6 +946,7 @@ export declare namespace Anthropic {
933946
type ImageBlockParam as ImageBlockParam,
934947
type InputJSONDelta as InputJSONDelta,
935948
type Message as Message,
949+
type MessageCountTokensTool as MessageCountTokensTool,
936950
type MessageDeltaEvent as MessageDeltaEvent,
937951
type MessageDeltaUsage as MessageDeltaUsage,
938952
type MessageParam as MessageParam,
@@ -950,17 +964,29 @@ export declare namespace Anthropic {
950964
type RawMessageStartEvent as RawMessageStartEvent,
951965
type RawMessageStopEvent as RawMessageStopEvent,
952966
type RawMessageStreamEvent as RawMessageStreamEvent,
967+
type RedactedThinkingBlock as RedactedThinkingBlock,
968+
type RedactedThinkingBlockParam as RedactedThinkingBlockParam,
969+
type SignatureDelta as SignatureDelta,
953970
type TextBlock as TextBlock,
954971
type TextBlockParam as TextBlockParam,
955972
type TextCitation as TextCitation,
956973
type TextCitationParam as TextCitationParam,
957974
type TextDelta as TextDelta,
975+
type ThinkingBlock as ThinkingBlock,
976+
type ThinkingBlockParam as ThinkingBlockParam,
977+
type ThinkingConfigDisabled as ThinkingConfigDisabled,
978+
type ThinkingConfigEnabled as ThinkingConfigEnabled,
979+
type ThinkingConfigParam as ThinkingConfigParam,
980+
type ThinkingDelta as ThinkingDelta,
958981
type Tool as Tool,
982+
type ToolBash20250124 as ToolBash20250124,
959983
type ToolChoice as ToolChoice,
960984
type ToolChoiceAny as ToolChoiceAny,
961985
type ToolChoiceAuto as ToolChoiceAuto,
962986
type ToolChoiceTool as ToolChoiceTool,
963987
type ToolResultBlockParam as ToolResultBlockParam,
988+
type ToolTextEditor20250124 as ToolTextEditor20250124,
989+
type ToolUnion as ToolUnion,
964990
type ToolUseBlock as ToolUseBlock,
965991
type ToolUseBlockParam as ToolUseBlockParam,
966992
type Usage as Usage,

src/resources/beta/beta.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,32 @@ import {
3535
BetaRawMessageStartEvent,
3636
BetaRawMessageStopEvent,
3737
BetaRawMessageStreamEvent,
38+
BetaRedactedThinkingBlock,
39+
BetaRedactedThinkingBlockParam,
40+
BetaSignatureDelta,
3841
BetaTextBlock,
3942
BetaTextBlockParam,
4043
BetaTextCitation,
4144
BetaTextCitationParam,
4245
BetaTextDelta,
46+
BetaThinkingBlock,
47+
BetaThinkingBlockParam,
48+
BetaThinkingConfigDisabled,
49+
BetaThinkingConfigEnabled,
50+
BetaThinkingConfigParam,
51+
BetaThinkingDelta,
4352
BetaTool,
4453
BetaToolBash20241022,
54+
BetaToolBash20250124,
4555
BetaToolChoice,
4656
BetaToolChoiceAny,
4757
BetaToolChoiceAuto,
4858
BetaToolChoiceTool,
4959
BetaToolComputerUse20241022,
60+
BetaToolComputerUse20250124,
5061
BetaToolResultBlockParam,
5162
BetaToolTextEditor20241022,
63+
BetaToolTextEditor20250124,
5264
BetaToolUnion,
5365
BetaToolUseBlock,
5466
BetaToolUseBlockParam,
@@ -70,8 +82,11 @@ export type AnthropicBeta =
7082
| 'message-batches-2024-09-24'
7183
| 'prompt-caching-2024-07-31'
7284
| 'computer-use-2024-10-22'
85+
| 'computer-use-2025-01-24'
7386
| 'pdfs-2024-09-25'
74-
| 'token-counting-2024-11-01';
87+
| 'token-counting-2024-11-01'
88+
| 'token-efficient-tools-2025-02-19'
89+
| 'output-128k-2025-02-19';
7590

7691
export interface BetaAPIError {
7792
message: string;
@@ -202,20 +217,32 @@ export declare namespace Beta {
202217
type BetaRawMessageStartEvent as BetaRawMessageStartEvent,
203218
type BetaRawMessageStopEvent as BetaRawMessageStopEvent,
204219
type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent,
220+
type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock,
221+
type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam,
222+
type BetaSignatureDelta as BetaSignatureDelta,
205223
type BetaTextBlock as BetaTextBlock,
206224
type BetaTextBlockParam as BetaTextBlockParam,
207225
type BetaTextCitation as BetaTextCitation,
208226
type BetaTextCitationParam as BetaTextCitationParam,
209227
type BetaTextDelta as BetaTextDelta,
228+
type BetaThinkingBlock as BetaThinkingBlock,
229+
type BetaThinkingBlockParam as BetaThinkingBlockParam,
230+
type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
231+
type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
232+
type BetaThinkingConfigParam as BetaThinkingConfigParam,
233+
type BetaThinkingDelta as BetaThinkingDelta,
210234
type BetaTool as BetaTool,
211235
type BetaToolBash20241022 as BetaToolBash20241022,
236+
type BetaToolBash20250124 as BetaToolBash20250124,
212237
type BetaToolChoice as BetaToolChoice,
213238
type BetaToolChoiceAny as BetaToolChoiceAny,
214239
type BetaToolChoiceAuto as BetaToolChoiceAuto,
215240
type BetaToolChoiceTool as BetaToolChoiceTool,
216241
type BetaToolComputerUse20241022 as BetaToolComputerUse20241022,
242+
type BetaToolComputerUse20250124 as BetaToolComputerUse20250124,
217243
type BetaToolResultBlockParam as BetaToolResultBlockParam,
218244
type BetaToolTextEditor20241022 as BetaToolTextEditor20241022,
245+
type BetaToolTextEditor20250124 as BetaToolTextEditor20250124,
219246
type BetaToolUnion as BetaToolUnion,
220247
type BetaToolUseBlock as BetaToolUseBlock,
221248
type BetaToolUseBlockParam as BetaToolUseBlockParam,

src/resources/beta/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,32 @@ export {
4747
type BetaRawMessageStartEvent,
4848
type BetaRawMessageStopEvent,
4949
type BetaRawMessageStreamEvent,
50+
type BetaRedactedThinkingBlock,
51+
type BetaRedactedThinkingBlockParam,
52+
type BetaSignatureDelta,
5053
type BetaTextBlock,
5154
type BetaTextBlockParam,
5255
type BetaTextCitation,
5356
type BetaTextCitationParam,
5457
type BetaTextDelta,
58+
type BetaThinkingBlock,
59+
type BetaThinkingBlockParam,
60+
type BetaThinkingConfigDisabled,
61+
type BetaThinkingConfigEnabled,
62+
type BetaThinkingConfigParam,
63+
type BetaThinkingDelta,
5564
type BetaTool,
5665
type BetaToolBash20241022,
66+
type BetaToolBash20250124,
5767
type BetaToolChoice,
5868
type BetaToolChoiceAny,
5969
type BetaToolChoiceAuto,
6070
type BetaToolChoiceTool,
6171
type BetaToolComputerUse20241022,
72+
type BetaToolComputerUse20250124,
6273
type BetaToolResultBlockParam,
6374
type BetaToolTextEditor20241022,
75+
type BetaToolTextEditor20250124,
6476
type BetaToolUnion,
6577
type BetaToolUseBlock,
6678
type BetaToolUseBlockParam,

src/resources/beta/messages/batches.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export class Batches extends APIResource {
1818
* The Message Batches API can be used to process multiple Messages API requests at
1919
* once. Once a Message Batch is created, it begins processing immediately. Batches
2020
* can take up to 24 hours to complete.
21+
*
22+
* Learn more about the Message Batches API in our
23+
* [user guide](/en/docs/build-with-claude/batch-processing)
2124
*/
2225
create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BetaMessageBatch> {
2326
const { betas, ...body } = params;
@@ -35,6 +38,9 @@ export class Batches extends APIResource {
3538
* This endpoint is idempotent and can be used to poll for Message Batch
3639
* completion. To access the results of a Message Batch, make a request to the
3740
* `results_url` field in the response.
41+
*
42+
* Learn more about the Message Batches API in our
43+
* [user guide](/en/docs/build-with-claude/batch-processing)
3844
*/
3945
retrieve(
4046
messageBatchID: string,
@@ -54,6 +60,9 @@ export class Batches extends APIResource {
5460
/**
5561
* List all Message Batches within a Workspace. Most recently created batches are
5662
* returned first.
63+
*
64+
* Learn more about the Message Batches API in our
65+
* [user guide](/en/docs/build-with-claude/batch-processing)
5766
*/
5867
list(
5968
params: BatchListParams | null | undefined = {},
@@ -75,6 +84,9 @@ export class Batches extends APIResource {
7584
*
7685
* Message Batches can only be deleted once they've finished processing. If you'd
7786
* like to delete an in-progress batch, you must first cancel it.
87+
*
88+
* Learn more about the Message Batches API in our
89+
* [user guide](/en/docs/build-with-claude/batch-processing)
7890
*/
7991
delete(
8092
messageBatchID: string,
@@ -101,6 +113,9 @@ export class Batches extends APIResource {
101113
* which requests were canceled, check the individual results within the batch.
102114
* Note that cancellation may not result in any canceled requests if they were
103115
* non-interruptible.
116+
*
117+
* Learn more about the Message Batches API in our
118+
* [user guide](/en/docs/build-with-claude/batch-processing)
104119
*/
105120
cancel(
106121
messageBatchID: string,
@@ -123,6 +138,9 @@ export class Batches extends APIResource {
123138
* Each line in the file is a JSON object containing the result of a single request
124139
* in the Message Batch. Results are not guaranteed to be in the same order as
125140
* requests. Use the `custom_id` field to match results to requests.
141+
*
142+
* Learn more about the Message Batches API in our
143+
* [user guide](/en/docs/build-with-claude/batch-processing)
126144
*/
127145
async results(
128146
messageBatchID: string,

src/resources/beta/messages/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,32 @@ export {
5151
type BetaRawMessageStartEvent,
5252
type BetaRawMessageStopEvent,
5353
type BetaRawMessageStreamEvent,
54+
type BetaRedactedThinkingBlock,
55+
type BetaRedactedThinkingBlockParam,
56+
type BetaSignatureDelta,
5457
type BetaTextBlock,
5558
type BetaTextBlockParam,
5659
type BetaTextCitation,
5760
type BetaTextCitationParam,
5861
type BetaTextDelta,
62+
type BetaThinkingBlock,
63+
type BetaThinkingBlockParam,
64+
type BetaThinkingConfigDisabled,
65+
type BetaThinkingConfigEnabled,
66+
type BetaThinkingConfigParam,
67+
type BetaThinkingDelta,
5968
type BetaTool,
6069
type BetaToolBash20241022,
70+
type BetaToolBash20250124,
6171
type BetaToolChoice,
6272
type BetaToolChoiceAny,
6373
type BetaToolChoiceAuto,
6474
type BetaToolChoiceTool,
6575
type BetaToolComputerUse20241022,
76+
type BetaToolComputerUse20250124,
6677
type BetaToolResultBlockParam,
6778
type BetaToolTextEditor20241022,
79+
type BetaToolTextEditor20250124,
6880
type BetaToolUnion,
6981
type BetaToolUseBlock,
7082
type BetaToolUseBlockParam,

0 commit comments

Comments
 (0)