Skip to content

Commit e49ebfb

Browse files
feat(client): add support for new text_editor_20250429 tool
1 parent ab404cf commit e49ebfb

File tree

11 files changed

+47
-5
lines changed

11 files changed

+47
-5
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-1fdf23e8226430012c21819427e8d1ed16c08c0fb2d4abf69b8e318a42e99552.yml
3-
openapi_spec_hash: 836bbb4ab7c33c37456d1842876d7aba
4-
config_hash: 91be78a9c3fd8dcdc0137a2cf6950153
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-a7b84017aa1126ad99443296dcd81ab2b53f1c346014b92096226cf993f30502.yml
3+
openapi_spec_hash: 58d4e72c7906bd8a680ab17b99de6215
4+
config_hash: 044904ef8007ef54660b5fe84a41ca39

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Types:
8686
- <code><a href="./src/resources/messages/messages.ts">ToolChoiceTool</a></code>
8787
- <code><a href="./src/resources/messages/messages.ts">ToolResultBlockParam</a></code>
8888
- <code><a href="./src/resources/messages/messages.ts">ToolTextEditor20250124</a></code>
89+
- <code><a href="./src/resources/messages/messages.ts">ToolTextEditor20250429</a></code>
8990
- <code><a href="./src/resources/messages/messages.ts">ToolUnion</a></code>
9091
- <code><a href="./src/resources/messages/messages.ts">ToolUseBlock</a></code>
9192
- <code><a href="./src/resources/messages/messages.ts">ToolUseBlockParam</a></code>

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ import {
126126
ToolChoiceTool,
127127
ToolResultBlockParam,
128128
ToolTextEditor20250124,
129+
ToolTextEditor20250429,
129130
ToolUnion,
130131
ToolUseBlock,
131132
ToolUseBlockParam,
@@ -1009,6 +1010,7 @@ export declare namespace Anthropic {
10091010
type ToolChoiceTool as ToolChoiceTool,
10101011
type ToolResultBlockParam as ToolResultBlockParam,
10111012
type ToolTextEditor20250124 as ToolTextEditor20250124,
1013+
type ToolTextEditor20250429 as ToolTextEditor20250429,
10121014
type ToolUnion as ToolUnion,
10131015
type ToolUseBlock as ToolUseBlock,
10141016
type ToolUseBlockParam as ToolUseBlockParam,

src/resources/beta/messages/messages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ export namespace BetaTool {
11061106

11071107
properties?: unknown | null;
11081108

1109+
required?: Array<string> | null;
1110+
11091111
[k: string]: unknown;
11101112
}
11111113
}

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export {
9292
type ToolChoiceTool,
9393
type ToolResultBlockParam,
9494
type ToolTextEditor20250124,
95+
type ToolTextEditor20250429,
9596
type ToolUnion,
9697
type ToolUseBlock,
9798
type ToolUseBlockParam,

src/resources/messages/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export {
8383
type ToolChoiceTool,
8484
type ToolResultBlockParam,
8585
type ToolTextEditor20250124,
86+
type ToolTextEditor20250429,
8687
type ToolUnion,
8788
type ToolUseBlock,
8889
type ToolUseBlockParam,

src/resources/messages/messages.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,12 @@ export interface Message {
423423
usage: Usage;
424424
}
425425

426-
export type MessageCountTokensTool = Tool | ToolBash20250124 | ToolTextEditor20250124 | WebSearchTool20250305;
426+
export type MessageCountTokensTool =
427+
| Tool
428+
| ToolBash20250124
429+
| ToolTextEditor20250124
430+
| ToolTextEditor20250429
431+
| WebSearchTool20250305;
427432

428433
export interface MessageDeltaUsage {
429434
/**
@@ -811,6 +816,8 @@ export namespace Tool {
811816

812817
properties?: unknown | null;
813818

819+
required?: Array<string> | null;
820+
814821
[k: string]: unknown;
815822
}
816823
}
@@ -925,7 +932,28 @@ export interface ToolTextEditor20250124 {
925932
cache_control?: CacheControlEphemeral | null;
926933
}
927934

928-
export type ToolUnion = Tool | ToolBash20250124 | ToolTextEditor20250124 | WebSearchTool20250305;
935+
export interface ToolTextEditor20250429 {
936+
/**
937+
* Name of the tool.
938+
*
939+
* This is how the tool will be called by the model and in `tool_use` blocks.
940+
*/
941+
name: 'str_replace_based_edit_tool';
942+
943+
type: 'text_editor_20250429';
944+
945+
/**
946+
* Create a cache control breakpoint at this content block.
947+
*/
948+
cache_control?: CacheControlEphemeral | null;
949+
}
950+
951+
export type ToolUnion =
952+
| Tool
953+
| ToolBash20250124
954+
| ToolTextEditor20250124
955+
| ToolTextEditor20250429
956+
| WebSearchTool20250305;
929957

930958
export interface ToolUseBlock {
931959
id: string;
@@ -1739,6 +1767,7 @@ export declare namespace Messages {
17391767
type ToolChoiceTool as ToolChoiceTool,
17401768
type ToolResultBlockParam as ToolResultBlockParam,
17411769
type ToolTextEditor20250124 as ToolTextEditor20250124,
1770+
type ToolTextEditor20250429 as ToolTextEditor20250429,
17421771
type ToolUnion as ToolUnion,
17431772
type ToolUseBlock as ToolUseBlock,
17441773
type ToolUseBlockParam as ToolUseBlockParam,

tests/api-resources/beta/messages/batches.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ describe('resource batches', () => {
8484
type: 'string',
8585
},
8686
},
87+
required: ['location'],
8788
},
8889
name: 'name',
8990
cache_control: { type: 'ephemeral', ttl: '5m' },

tests/api-resources/beta/messages/messages.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('resource messages', () => {
7070
location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' },
7171
unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' },
7272
},
73+
required: ['location'],
7374
},
7475
name: 'name',
7576
cache_control: { type: 'ephemeral', ttl: '5m' },
@@ -137,6 +138,7 @@ describe('resource messages', () => {
137138
location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' },
138139
unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' },
139140
},
141+
required: ['location'],
140142
},
141143
name: 'name',
142144
cache_control: { type: 'ephemeral', ttl: '5m' },

tests/api-resources/messages/batches.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ describe('resource batches', () => {
7373
type: 'string',
7474
},
7575
},
76+
required: ['location'],
7677
},
7778
name: 'name',
7879
cache_control: { type: 'ephemeral' },

0 commit comments

Comments
 (0)