Skip to content

Commit fe92af0

Browse files
feat(client): adds support for code-execution-2025-08-26 tool
1 parent f542b54 commit fe92af0

File tree

40 files changed

+505
-488
lines changed

40 files changed

+505
-488
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-0f40955413f5d04b30ecd6c2f5002ce36a85c320cc671911ff70902fed6e342c.yml
3-
openapi_spec_hash: 92a37231c475ddfec0093718cd24f7ab
4-
config_hash: 21a1f78a64f751cc59c36f88095511cc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-c150096acd4c91e98b0b888f5cb61e9c2d73c433f165f6fe343a8af50ff40daa.yml
3+
openapi_spec_hash: b0fc4933c9280be98c637752c5cb3acc
4+
config_hash: 6c2c7f9a9019f8299e3fa94c6ac190d1

api.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ Types:
204204
from anthropic.types.beta import (
205205
BetaBase64ImageSource,
206206
BetaBase64PDFSource,
207+
BetaBashCodeExecutionOutputBlock,
208+
BetaBashCodeExecutionOutputBlockParam,
209+
BetaBashCodeExecutionResultBlock,
210+
BetaBashCodeExecutionResultBlockParam,
211+
BetaBashCodeExecutionToolResultBlock,
212+
BetaBashCodeExecutionToolResultBlockParam,
213+
BetaBashCodeExecutionToolResultError,
214+
BetaBashCodeExecutionToolResultErrorParam,
207215
BetaCacheControlEphemeral,
208216
BetaCacheCreation,
209217
BetaCitationCharLocation,
@@ -223,6 +231,7 @@ from anthropic.types.beta import (
223231
BetaCodeExecutionResultBlock,
224232
BetaCodeExecutionResultBlockParam,
225233
BetaCodeExecutionTool20250522,
234+
BetaCodeExecutionTool20250825,
226235
BetaCodeExecutionToolResultBlock,
227236
BetaCodeExecutionToolResultBlockContent,
228237
BetaCodeExecutionToolResultBlockParam,
@@ -275,6 +284,16 @@ from anthropic.types.beta import (
275284
BetaTextCitation,
276285
BetaTextCitationParam,
277286
BetaTextDelta,
287+
BetaTextEditorCodeExecutionCreateResultBlock,
288+
BetaTextEditorCodeExecutionCreateResultBlockParam,
289+
BetaTextEditorCodeExecutionStrReplaceResultBlock,
290+
BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
291+
BetaTextEditorCodeExecutionToolResultBlock,
292+
BetaTextEditorCodeExecutionToolResultBlockParam,
293+
BetaTextEditorCodeExecutionToolResultError,
294+
BetaTextEditorCodeExecutionToolResultErrorParam,
295+
BetaTextEditorCodeExecutionViewResultBlock,
296+
BetaTextEditorCodeExecutionViewResultBlockParam,
278297
BetaThinkingBlock,
279298
BetaThinkingBlockParam,
280299
BetaThinkingConfigDisabled,

src/anthropic/lib/streaming/_beta_messages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ async def get_final_text(self) -> str:
245245
f".get_final_text() can only be called when the API returns a `text` content block.\nThe API returned {','.join([b.type for b in message.content])} content block type(s) that you can access by calling get_final_message().content"
246246
)
247247

248-
249248
return "".join(text_blocks)
250249

251250
async def until_done(self) -> None:

src/anthropic/resources/beta/messages/messages.py

Lines changed: 8 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -177,30 +177,7 @@ def create(
177177
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
178178
```
179179
180-
Starting with Claude 3 models, you can also send image content blocks:
181-
182-
```json
183-
{
184-
"role": "user",
185-
"content": [
186-
{
187-
"type": "image",
188-
"source": {
189-
"type": "base64",
190-
"media_type": "image/jpeg",
191-
"data": "/9j/4AAQSkZJRg..."
192-
}
193-
},
194-
{ "type": "text", "text": "What is in this image?" }
195-
]
196-
}
197-
```
198-
199-
We currently support the `base64` source type for images, and the `image/jpeg`,
200-
`image/png`, `image/gif`, and `image/webp` media types.
201-
202-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
203-
more input examples.
180+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
204181
205182
Note that if you want to include a
206183
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -477,30 +454,7 @@ def create(
477454
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
478455
```
479456
480-
Starting with Claude 3 models, you can also send image content blocks:
481-
482-
```json
483-
{
484-
"role": "user",
485-
"content": [
486-
{
487-
"type": "image",
488-
"source": {
489-
"type": "base64",
490-
"media_type": "image/jpeg",
491-
"data": "/9j/4AAQSkZJRg..."
492-
}
493-
},
494-
{ "type": "text", "text": "What is in this image?" }
495-
]
496-
}
497-
```
498-
499-
We currently support the `base64` source type for images, and the `image/jpeg`,
500-
`image/png`, `image/gif`, and `image/webp` media types.
501-
502-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
503-
more input examples.
457+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
504458
505459
Note that if you want to include a
506460
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -777,30 +731,7 @@ def create(
777731
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
778732
```
779733
780-
Starting with Claude 3 models, you can also send image content blocks:
781-
782-
```json
783-
{
784-
"role": "user",
785-
"content": [
786-
{
787-
"type": "image",
788-
"source": {
789-
"type": "base64",
790-
"media_type": "image/jpeg",
791-
"data": "/9j/4AAQSkZJRg..."
792-
}
793-
},
794-
{ "type": "text", "text": "What is in this image?" }
795-
]
796-
}
797-
```
798-
799-
We currently support the `base64` source type for images, and the `image/jpeg`,
800-
`image/png`, `image/gif`, and `image/webp` media types.
801-
802-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
803-
more input examples.
734+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
804735
805736
Note that if you want to include a
806737
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -1208,30 +1139,7 @@ def count_tokens(
12081139
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
12091140
```
12101141
1211-
Starting with Claude 3 models, you can also send image content blocks:
1212-
1213-
```json
1214-
{
1215-
"role": "user",
1216-
"content": [
1217-
{
1218-
"type": "image",
1219-
"source": {
1220-
"type": "base64",
1221-
"media_type": "image/jpeg",
1222-
"data": "/9j/4AAQSkZJRg..."
1223-
}
1224-
},
1225-
{ "type": "text", "text": "What is in this image?" }
1226-
]
1227-
}
1228-
```
1229-
1230-
We currently support the `base64` source type for images, and the `image/jpeg`,
1231-
`image/png`, `image/gif`, and `image/webp` media types.
1232-
1233-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
1234-
more input examples.
1142+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
12351143
12361144
Note that if you want to include a
12371145
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -1510,30 +1418,7 @@ async def create(
15101418
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
15111419
```
15121420
1513-
Starting with Claude 3 models, you can also send image content blocks:
1514-
1515-
```json
1516-
{
1517-
"role": "user",
1518-
"content": [
1519-
{
1520-
"type": "image",
1521-
"source": {
1522-
"type": "base64",
1523-
"media_type": "image/jpeg",
1524-
"data": "/9j/4AAQSkZJRg..."
1525-
}
1526-
},
1527-
{ "type": "text", "text": "What is in this image?" }
1528-
]
1529-
}
1530-
```
1531-
1532-
We currently support the `base64` source type for images, and the `image/jpeg`,
1533-
`image/png`, `image/gif`, and `image/webp` media types.
1534-
1535-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
1536-
more input examples.
1421+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
15371422
15381423
Note that if you want to include a
15391424
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -1810,30 +1695,7 @@ async def create(
18101695
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
18111696
```
18121697
1813-
Starting with Claude 3 models, you can also send image content blocks:
1814-
1815-
```json
1816-
{
1817-
"role": "user",
1818-
"content": [
1819-
{
1820-
"type": "image",
1821-
"source": {
1822-
"type": "base64",
1823-
"media_type": "image/jpeg",
1824-
"data": "/9j/4AAQSkZJRg..."
1825-
}
1826-
},
1827-
{ "type": "text", "text": "What is in this image?" }
1828-
]
1829-
}
1830-
```
1831-
1832-
We currently support the `base64` source type for images, and the `image/jpeg`,
1833-
`image/png`, `image/gif`, and `image/webp` media types.
1834-
1835-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
1836-
more input examples.
1698+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
18371699
18381700
Note that if you want to include a
18391701
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -2110,30 +1972,7 @@ async def create(
21101972
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
21111973
```
21121974
2113-
Starting with Claude 3 models, you can also send image content blocks:
2114-
2115-
```json
2116-
{
2117-
"role": "user",
2118-
"content": [
2119-
{
2120-
"type": "image",
2121-
"source": {
2122-
"type": "base64",
2123-
"media_type": "image/jpeg",
2124-
"data": "/9j/4AAQSkZJRg..."
2125-
}
2126-
},
2127-
{ "type": "text", "text": "What is in this image?" }
2128-
]
2129-
}
2130-
```
2131-
2132-
We currently support the `base64` source type for images, and the `image/jpeg`,
2133-
`image/png`, `image/gif`, and `image/webp` media types.
2134-
2135-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
2136-
more input examples.
1975+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
21371976
21381977
Note that if you want to include a
21391978
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -2539,30 +2378,7 @@ async def count_tokens(
25392378
{ "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
25402379
```
25412380
2542-
Starting with Claude 3 models, you can also send image content blocks:
2543-
2544-
```json
2545-
{
2546-
"role": "user",
2547-
"content": [
2548-
{
2549-
"type": "image",
2550-
"source": {
2551-
"type": "base64",
2552-
"media_type": "image/jpeg",
2553-
"data": "/9j/4AAQSkZJRg..."
2554-
}
2555-
},
2556-
{ "type": "text", "text": "What is in this image?" }
2557-
]
2558-
}
2559-
```
2560-
2561-
We currently support the `base64` source type for images, and the `image/jpeg`,
2562-
`image/png`, `image/gif`, and `image/webp` media types.
2563-
2564-
See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
2565-
more input examples.
2381+
See [input examples](https://docs.anthropic.com/en/api/messages-examples).
25662382
25672383
Note that if you want to include a
25682384
[system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use

0 commit comments

Comments
 (0)