|
50 | 50 | from ...types.thinking_config_param import ThinkingConfigParam |
51 | 51 | from ...types.json_output_format_param import JSONOutputFormatParam |
52 | 52 | from ...types.raw_message_stream_event import RawMessageStreamEvent |
| 53 | +from ...types.cache_control_ephemeral_param import CacheControlEphemeralParam |
53 | 54 | from ...types.message_count_tokens_tool_param import MessageCountTokensToolParam |
54 | 55 |
|
55 | 56 | __all__ = ["Messages", "AsyncMessages"] |
@@ -105,6 +106,7 @@ def create( |
105 | 106 | max_tokens: int, |
106 | 107 | messages: Iterable[MessageParam], |
107 | 108 | model: ModelParam, |
| 109 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
108 | 110 | container: Optional[str] | Omit = omit, |
109 | 111 | inference_geo: Optional[str] | Omit = omit, |
110 | 112 | metadata: MetadataParam | Omit = omit, |
@@ -215,6 +217,9 @@ def create( |
215 | 217 | [models](https://docs.anthropic.com/en/docs/models-overview) for additional |
216 | 218 | details and options. |
217 | 219 |
|
| 220 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 221 | + cacheable block in the request. |
| 222 | +
|
218 | 223 | container: Container identifier for reuse across requests. |
219 | 224 |
|
220 | 225 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -384,6 +389,7 @@ def create( |
384 | 389 | messages: Iterable[MessageParam], |
385 | 390 | model: ModelParam, |
386 | 391 | stream: Literal[True], |
| 392 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
387 | 393 | container: Optional[str] | Omit = omit, |
388 | 394 | inference_geo: Optional[str] | Omit = omit, |
389 | 395 | metadata: MetadataParam | Omit = omit, |
@@ -497,6 +503,9 @@ def create( |
497 | 503 |
|
498 | 504 | See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. |
499 | 505 |
|
| 506 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 507 | + cacheable block in the request. |
| 508 | +
|
500 | 509 | container: Container identifier for reuse across requests. |
501 | 510 |
|
502 | 511 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -662,6 +671,7 @@ def create( |
662 | 671 | messages: Iterable[MessageParam], |
663 | 672 | model: ModelParam, |
664 | 673 | stream: bool, |
| 674 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
665 | 675 | container: Optional[str] | Omit = omit, |
666 | 676 | inference_geo: Optional[str] | Omit = omit, |
667 | 677 | metadata: MetadataParam | Omit = omit, |
@@ -775,6 +785,9 @@ def create( |
775 | 785 |
|
776 | 786 | See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. |
777 | 787 |
|
| 788 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 789 | + cacheable block in the request. |
| 790 | +
|
778 | 791 | container: Container identifier for reuse across requests. |
779 | 792 |
|
780 | 793 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -939,6 +952,7 @@ def create( |
939 | 952 | max_tokens: int, |
940 | 953 | messages: Iterable[MessageParam], |
941 | 954 | model: ModelParam, |
| 955 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
942 | 956 | container: Optional[str] | Omit = omit, |
943 | 957 | inference_geo: Optional[str] | Omit = omit, |
944 | 958 | metadata: MetadataParam | Omit = omit, |
@@ -986,6 +1000,7 @@ def create( |
986 | 1000 | "max_tokens": max_tokens, |
987 | 1001 | "messages": messages, |
988 | 1002 | "model": model, |
| 1003 | + "cache_control": cache_control, |
989 | 1004 | "container": container, |
990 | 1005 | "inference_geo": inference_geo, |
991 | 1006 | "metadata": metadata, |
@@ -1019,6 +1034,7 @@ def stream( |
1019 | 1034 | max_tokens: int, |
1020 | 1035 | messages: Iterable[MessageParam], |
1021 | 1036 | model: ModelParam, |
| 1037 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
1022 | 1038 | inference_geo: Optional[str] | Omit = omit, |
1023 | 1039 | metadata: MetadataParam | Omit = omit, |
1024 | 1040 | output_config: OutputConfigParam | Omit = omit, |
@@ -1097,6 +1113,7 @@ def stream( |
1097 | 1113 | "max_tokens": max_tokens, |
1098 | 1114 | "messages": messages, |
1099 | 1115 | "model": model, |
| 1116 | + "cache_control": cache_control, |
1100 | 1117 | "inference_geo": inference_geo, |
1101 | 1118 | "metadata": metadata, |
1102 | 1119 | "output_config": merged_output_config, |
@@ -1249,6 +1266,7 @@ def count_tokens( |
1249 | 1266 | *, |
1250 | 1267 | messages: Iterable[MessageParam], |
1251 | 1268 | model: ModelParam, |
| 1269 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
1252 | 1270 | output_config: OutputConfigParam | Omit = omit, |
1253 | 1271 | output_format: None | JSONOutputFormatParam | type | Omit = omit, |
1254 | 1272 | system: Union[str, Iterable[TextBlockParam]] | Omit = omit, |
@@ -1342,6 +1360,9 @@ def count_tokens( |
1342 | 1360 | [models](https://docs.anthropic.com/en/docs/models-overview) for additional |
1343 | 1361 | details and options. |
1344 | 1362 |
|
| 1363 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 1364 | + cacheable block in the request. |
| 1365 | +
|
1345 | 1366 | output_config: Configuration options for the model's output, such as the output format. |
1346 | 1367 |
|
1347 | 1368 |
|
@@ -1485,6 +1506,7 @@ def count_tokens( |
1485 | 1506 | "model": model, |
1486 | 1507 | "messages": messages, |
1487 | 1508 | "model": model, |
| 1509 | + "cache_control": cache_control, |
1488 | 1510 | "output_config": merged_output_config, |
1489 | 1511 | "system": system, |
1490 | 1512 | "thinking": thinking, |
@@ -1531,6 +1553,7 @@ async def create( |
1531 | 1553 | max_tokens: int, |
1532 | 1554 | messages: Iterable[MessageParam], |
1533 | 1555 | model: ModelParam, |
| 1556 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
1534 | 1557 | container: Optional[str] | Omit = omit, |
1535 | 1558 | inference_geo: Optional[str] | Omit = omit, |
1536 | 1559 | metadata: MetadataParam | Omit = omit, |
@@ -1641,6 +1664,9 @@ async def create( |
1641 | 1664 | [models](https://docs.anthropic.com/en/docs/models-overview) for additional |
1642 | 1665 | details and options. |
1643 | 1666 |
|
| 1667 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 1668 | + cacheable block in the request. |
| 1669 | +
|
1644 | 1670 | container: Container identifier for reuse across requests. |
1645 | 1671 |
|
1646 | 1672 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -1810,6 +1836,7 @@ async def create( |
1810 | 1836 | messages: Iterable[MessageParam], |
1811 | 1837 | model: ModelParam, |
1812 | 1838 | stream: Literal[True], |
| 1839 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
1813 | 1840 | container: Optional[str] | Omit = omit, |
1814 | 1841 | inference_geo: Optional[str] | Omit = omit, |
1815 | 1842 | metadata: MetadataParam | Omit = omit, |
@@ -1923,6 +1950,9 @@ async def create( |
1923 | 1950 |
|
1924 | 1951 | See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. |
1925 | 1952 |
|
| 1953 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 1954 | + cacheable block in the request. |
| 1955 | +
|
1926 | 1956 | container: Container identifier for reuse across requests. |
1927 | 1957 |
|
1928 | 1958 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -2088,6 +2118,7 @@ async def create( |
2088 | 2118 | messages: Iterable[MessageParam], |
2089 | 2119 | model: ModelParam, |
2090 | 2120 | stream: bool, |
| 2121 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
2091 | 2122 | container: Optional[str] | Omit = omit, |
2092 | 2123 | inference_geo: Optional[str] | Omit = omit, |
2093 | 2124 | metadata: MetadataParam | Omit = omit, |
@@ -2201,6 +2232,9 @@ async def create( |
2201 | 2232 |
|
2202 | 2233 | See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. |
2203 | 2234 |
|
| 2235 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 2236 | + cacheable block in the request. |
| 2237 | +
|
2204 | 2238 | container: Container identifier for reuse across requests. |
2205 | 2239 |
|
2206 | 2240 | inference_geo: Specifies the geographic region for inference processing. If not specified, the |
@@ -2365,6 +2399,7 @@ async def create( |
2365 | 2399 | max_tokens: int, |
2366 | 2400 | messages: Iterable[MessageParam], |
2367 | 2401 | model: ModelParam, |
| 2402 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
2368 | 2403 | container: Optional[str] | Omit = omit, |
2369 | 2404 | inference_geo: Optional[str] | Omit = omit, |
2370 | 2405 | metadata: MetadataParam | Omit = omit, |
@@ -2412,6 +2447,7 @@ async def create( |
2412 | 2447 | "max_tokens": max_tokens, |
2413 | 2448 | "messages": messages, |
2414 | 2449 | "model": model, |
| 2450 | + "cache_control": cache_control, |
2415 | 2451 | "container": container, |
2416 | 2452 | "inference_geo": inference_geo, |
2417 | 2453 | "metadata": metadata, |
@@ -2445,6 +2481,7 @@ def stream( |
2445 | 2481 | max_tokens: int, |
2446 | 2482 | messages: Iterable[MessageParam], |
2447 | 2483 | model: ModelParam, |
| 2484 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
2448 | 2485 | inference_geo: Optional[str] | Omit = omit, |
2449 | 2486 | metadata: MetadataParam | Omit = omit, |
2450 | 2487 | output_config: OutputConfigParam | Omit = omit, |
@@ -2522,6 +2559,7 @@ def stream( |
2522 | 2559 | "max_tokens": max_tokens, |
2523 | 2560 | "messages": messages, |
2524 | 2561 | "model": model, |
| 2562 | + "cache_control": cache_control, |
2525 | 2563 | "inference_geo": inference_geo, |
2526 | 2564 | "metadata": metadata, |
2527 | 2565 | "output_config": merged_output_config, |
@@ -2674,6 +2712,7 @@ async def count_tokens( |
2674 | 2712 | *, |
2675 | 2713 | messages: Iterable[MessageParam], |
2676 | 2714 | model: ModelParam, |
| 2715 | + cache_control: Optional[CacheControlEphemeralParam] | Omit = omit, |
2677 | 2716 | output_config: OutputConfigParam | Omit = omit, |
2678 | 2717 | output_format: None | JSONOutputFormatParam | type | Omit = omit, |
2679 | 2718 | system: Union[str, Iterable[TextBlockParam]] | Omit = omit, |
@@ -2767,6 +2806,9 @@ async def count_tokens( |
2767 | 2806 | [models](https://docs.anthropic.com/en/docs/models-overview) for additional |
2768 | 2807 | details and options. |
2769 | 2808 |
|
| 2809 | + cache_control: Top-level cache control automatically applies a cache_control marker to the last |
| 2810 | + cacheable block in the request. |
| 2811 | +
|
2770 | 2812 | output_config: Configuration options for the model's output, such as the output format. |
2771 | 2813 |
|
2772 | 2814 |
|
@@ -2910,6 +2952,7 @@ async def count_tokens( |
2910 | 2952 | "model": model, |
2911 | 2953 | "messages": messages, |
2912 | 2954 | "model": model, |
| 2955 | + "cache_control": cache_control, |
2913 | 2956 | "output_config": merged_output_config, |
2914 | 2957 | "system": system, |
2915 | 2958 | "thinking": thinking, |
|
0 commit comments