anthropic 0.70.0__py3-none-any.whl → 0.71.1__py3-none-any.whl

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.
Files changed (50) hide show
  1. anthropic/_base_client.py +6 -2
  2. anthropic/_version.py +1 -1
  3. anthropic/lib/__init__.py +1 -0
  4. anthropic/lib/_files.py +42 -0
  5. anthropic/pagination.py +117 -1
  6. anthropic/resources/beta/__init__.py +14 -0
  7. anthropic/resources/beta/beta.py +32 -0
  8. anthropic/resources/beta/messages/messages.py +140 -122
  9. anthropic/resources/beta/skills/__init__.py +33 -0
  10. anthropic/resources/beta/skills/skills.py +680 -0
  11. anthropic/resources/beta/skills/versions.py +658 -0
  12. anthropic/resources/completions.py +36 -42
  13. anthropic/resources/messages/messages.py +92 -98
  14. anthropic/types/anthropic_beta_param.py +1 -0
  15. anthropic/types/beta/__init__.py +9 -0
  16. anthropic/types/beta/beta_container.py +5 -0
  17. anthropic/types/beta/beta_container_params.py +18 -0
  18. anthropic/types/beta/beta_message.py +4 -1
  19. anthropic/types/beta/beta_raw_message_delta_event.py +1 -1
  20. anthropic/types/beta/beta_skill.py +18 -0
  21. anthropic/types/beta/beta_skill_params.py +18 -0
  22. anthropic/types/beta/beta_thinking_config_enabled_param.py +1 -1
  23. anthropic/types/beta/message_count_tokens_params.py +14 -10
  24. anthropic/types/beta/message_create_params.py +25 -19
  25. anthropic/types/beta/messages/batch_create_params.py +1 -0
  26. anthropic/types/beta/skill_create_params.py +31 -0
  27. anthropic/types/beta/skill_create_response.py +49 -0
  28. anthropic/types/beta/skill_delete_response.py +19 -0
  29. anthropic/types/beta/skill_list_params.py +38 -0
  30. anthropic/types/beta/skill_list_response.py +49 -0
  31. anthropic/types/beta/skill_retrieve_response.py +49 -0
  32. anthropic/types/beta/skills/__init__.py +10 -0
  33. anthropic/types/beta/skills/version_create_params.py +24 -0
  34. anthropic/types/beta/skills/version_create_response.py +49 -0
  35. anthropic/types/beta/skills/version_delete_response.py +19 -0
  36. anthropic/types/beta/skills/version_list_params.py +25 -0
  37. anthropic/types/beta/skills/version_list_response.py +49 -0
  38. anthropic/types/beta/skills/version_retrieve_response.py +49 -0
  39. anthropic/types/completion_create_params.py +5 -6
  40. anthropic/types/message_count_tokens_params.py +9 -9
  41. anthropic/types/message_create_params.py +13 -15
  42. anthropic/types/messages/batch_create_params.py +1 -0
  43. anthropic/types/model.py +0 -3
  44. anthropic/types/model_param.py +0 -3
  45. anthropic/types/stop_reason.py +1 -3
  46. anthropic/types/thinking_config_enabled_param.py +1 -1
  47. {anthropic-0.70.0.dist-info → anthropic-0.71.1.dist-info}/METADATA +2 -2
  48. {anthropic-0.70.0.dist-info → anthropic-0.71.1.dist-info}/RECORD +50 -30
  49. {anthropic-0.70.0.dist-info → anthropic-0.71.1.dist-info}/WHEEL +0 -0
  50. {anthropic-0.70.0.dist-info → anthropic-0.71.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ...._models import BaseModel
4
+
5
+ __all__ = ["VersionCreateResponse"]
6
+
7
+
8
+ class VersionCreateResponse(BaseModel):
9
+ id: str
10
+ """Unique identifier for the skill version.
11
+
12
+ The format and length of IDs may change over time.
13
+ """
14
+
15
+ created_at: str
16
+ """ISO 8601 timestamp of when the skill version was created."""
17
+
18
+ description: str
19
+ """Description of the skill version.
20
+
21
+ This is extracted from the SKILL.md file in the skill upload.
22
+ """
23
+
24
+ directory: str
25
+ """Directory name of the skill version.
26
+
27
+ This is the top-level directory name that was extracted from the uploaded files.
28
+ """
29
+
30
+ name: str
31
+ """Human-readable name of the skill version.
32
+
33
+ This is extracted from the SKILL.md file in the skill upload.
34
+ """
35
+
36
+ skill_id: str
37
+ """Identifier for the skill that this version belongs to."""
38
+
39
+ type: str
40
+ """Object type.
41
+
42
+ For Skill Versions, this is always `"skill_version"`.
43
+ """
44
+
45
+ version: str
46
+ """Version identifier for the skill.
47
+
48
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
49
+ """
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ...._models import BaseModel
4
+
5
+ __all__ = ["VersionDeleteResponse"]
6
+
7
+
8
+ class VersionDeleteResponse(BaseModel):
9
+ id: str
10
+ """Version identifier for the skill.
11
+
12
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
13
+ """
14
+
15
+ type: str
16
+ """Deleted object type.
17
+
18
+ For Skill Versions, this is always `"skill_version_deleted"`.
19
+ """
@@ -0,0 +1,25 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List, Optional
6
+ from typing_extensions import Annotated, TypedDict
7
+
8
+ from ...._utils import PropertyInfo
9
+ from ...anthropic_beta_param import AnthropicBetaParam
10
+
11
+ __all__ = ["VersionListParams"]
12
+
13
+
14
+ class VersionListParams(TypedDict, total=False):
15
+ limit: Optional[int]
16
+ """Number of items to return per page.
17
+
18
+ Defaults to `20`. Ranges from `1` to `1000`.
19
+ """
20
+
21
+ page: Optional[str]
22
+ """Optionally set to the `next_page` token from the previous response."""
23
+
24
+ betas: Annotated[List[AnthropicBetaParam], PropertyInfo(alias="anthropic-beta")]
25
+ """Optional header to specify the beta version(s) you want to use."""
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ...._models import BaseModel
4
+
5
+ __all__ = ["VersionListResponse"]
6
+
7
+
8
+ class VersionListResponse(BaseModel):
9
+ id: str
10
+ """Unique identifier for the skill version.
11
+
12
+ The format and length of IDs may change over time.
13
+ """
14
+
15
+ created_at: str
16
+ """ISO 8601 timestamp of when the skill version was created."""
17
+
18
+ description: str
19
+ """Description of the skill version.
20
+
21
+ This is extracted from the SKILL.md file in the skill upload.
22
+ """
23
+
24
+ directory: str
25
+ """Directory name of the skill version.
26
+
27
+ This is the top-level directory name that was extracted from the uploaded files.
28
+ """
29
+
30
+ name: str
31
+ """Human-readable name of the skill version.
32
+
33
+ This is extracted from the SKILL.md file in the skill upload.
34
+ """
35
+
36
+ skill_id: str
37
+ """Identifier for the skill that this version belongs to."""
38
+
39
+ type: str
40
+ """Object type.
41
+
42
+ For Skill Versions, this is always `"skill_version"`.
43
+ """
44
+
45
+ version: str
46
+ """Version identifier for the skill.
47
+
48
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
49
+ """
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ...._models import BaseModel
4
+
5
+ __all__ = ["VersionRetrieveResponse"]
6
+
7
+
8
+ class VersionRetrieveResponse(BaseModel):
9
+ id: str
10
+ """Unique identifier for the skill version.
11
+
12
+ The format and length of IDs may change over time.
13
+ """
14
+
15
+ created_at: str
16
+ """ISO 8601 timestamp of when the skill version was created."""
17
+
18
+ description: str
19
+ """Description of the skill version.
20
+
21
+ This is extracted from the SKILL.md file in the skill upload.
22
+ """
23
+
24
+ directory: str
25
+ """Directory name of the skill version.
26
+
27
+ This is the top-level directory name that was extracted from the uploaded files.
28
+ """
29
+
30
+ name: str
31
+ """Human-readable name of the skill version.
32
+
33
+ This is extracted from the SKILL.md file in the skill upload.
34
+ """
35
+
36
+ skill_id: str
37
+ """Identifier for the skill that this version belongs to."""
38
+
39
+ type: str
40
+ """Object type.
41
+
42
+ For Skill Versions, this is always `"skill_version"`.
43
+ """
44
+
45
+ version: str
46
+ """Version identifier for the skill.
47
+
48
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
49
+ """
@@ -48,10 +48,9 @@ class CompletionCreateParamsBase(TypedDict, total=False):
48
48
  "\n\nHuman: {userQuestion}\n\nAssistant:"
49
49
  ```
50
50
 
51
- See [prompt validation](https://docs.anthropic.com/en/api/prompt-validation) and
52
- our guide to
53
- [prompt design](https://docs.anthropic.com/en/docs/intro-to-prompting) for more
54
- details.
51
+ See [prompt validation](https://docs.claude.com/en/api/prompt-validation) and
52
+ our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting)
53
+ for more details.
55
54
  """
56
55
 
57
56
  metadata: MetadataParam
@@ -110,7 +109,7 @@ class CompletionCreateParamsNonStreaming(CompletionCreateParamsBase, total=False
110
109
  stream: Literal[False]
111
110
  """Whether to incrementally stream the response using server-sent events.
112
111
 
113
- See [streaming](https://docs.anthropic.com/en/api/streaming) for details.
112
+ See [streaming](https://docs.claude.com/en/api/streaming) for details.
114
113
  """
115
114
 
116
115
 
@@ -118,7 +117,7 @@ class CompletionCreateParamsStreaming(CompletionCreateParamsBase):
118
117
  stream: Required[Literal[True]]
119
118
  """Whether to incrementally stream the response using server-sent events.
120
119
 
121
- See [streaming](https://docs.anthropic.com/en/api/streaming) for details.
120
+ See [streaming](https://docs.claude.com/en/api/streaming) for details.
122
121
  """
123
122
 
124
123
 
@@ -74,12 +74,12 @@ class MessageCountTokensParams(TypedDict, total=False):
74
74
  { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
75
75
  ```
76
76
 
77
- See [input examples](https://docs.anthropic.com/en/api/messages-examples).
77
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
78
78
 
79
79
  Note that if you want to include a
80
- [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
81
- the top-level `system` parameter — there is no `"system"` role for input
82
- messages in the Messages API.
80
+ [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
81
+ top-level `system` parameter — there is no `"system"` role for input messages in
82
+ the Messages API.
83
83
 
84
84
  There is a limit of 100,000 messages in a single request.
85
85
  """
@@ -96,7 +96,7 @@ class MessageCountTokensParams(TypedDict, total=False):
96
96
 
97
97
  A system prompt is a way of providing context and instructions to Claude, such
98
98
  as specifying a particular goal or role. See our
99
- [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
99
+ [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
100
100
  """
101
101
 
102
102
  thinking: ThinkingConfigParam
@@ -107,7 +107,7 @@ class MessageCountTokensParams(TypedDict, total=False):
107
107
  tokens and counts towards your `max_tokens` limit.
108
108
 
109
109
  See
110
- [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
110
+ [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
111
111
  for details.
112
112
  """
113
113
 
@@ -128,9 +128,9 @@ class MessageCountTokensParams(TypedDict, total=False):
128
128
 
129
129
  There are two types of tools: **client tools** and **server tools**. The
130
130
  behavior described below applies to client tools. For
131
- [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
131
+ [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
132
132
  see their individual documentation as each has its own behavior (e.g., the
133
- [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
133
+ [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
134
134
 
135
135
  Each tool definition includes:
136
136
 
@@ -193,5 +193,5 @@ class MessageCountTokensParams(TypedDict, total=False):
193
193
  functions, or more generally whenever you want the model to produce a particular
194
194
  JSON structure of output.
195
195
 
196
- See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
196
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
197
197
  """
@@ -37,7 +37,7 @@ class MessageCreateParamsBase(TypedDict, total=False):
37
37
  only specifies the absolute maximum number of tokens to generate.
38
38
 
39
39
  Different models have different maximum values for this parameter. See
40
- [models](https://docs.anthropic.com/en/docs/models-overview) for details.
40
+ [models](https://docs.claude.com/en/docs/models-overview) for details.
41
41
  """
42
42
 
43
43
  messages: Required[Iterable[MessageParam]]
@@ -98,12 +98,12 @@ class MessageCreateParamsBase(TypedDict, total=False):
98
98
  { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
99
99
  ```
100
100
 
101
- See [input examples](https://docs.anthropic.com/en/api/messages-examples).
101
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
102
102
 
103
103
  Note that if you want to include a
104
- [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
105
- the top-level `system` parameter — there is no `"system"` role for input
106
- messages in the Messages API.
104
+ [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
105
+ top-level `system` parameter — there is no `"system"` role for input messages in
106
+ the Messages API.
107
107
 
108
108
  There is a limit of 100,000 messages in a single request.
109
109
  """
@@ -124,7 +124,7 @@ class MessageCreateParamsBase(TypedDict, total=False):
124
124
  for this request.
125
125
 
126
126
  Anthropic offers different levels of service for your API requests. See
127
- [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
127
+ [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
128
128
  """
129
129
 
130
130
  stop_sequences: SequenceNotStr[str]
@@ -144,7 +144,7 @@ class MessageCreateParamsBase(TypedDict, total=False):
144
144
 
145
145
  A system prompt is a way of providing context and instructions to Claude, such
146
146
  as specifying a particular goal or role. See our
147
- [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
147
+ [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
148
148
  """
149
149
 
150
150
  temperature: float
@@ -166,7 +166,7 @@ class MessageCreateParamsBase(TypedDict, total=False):
166
166
  tokens and counts towards your `max_tokens` limit.
167
167
 
168
168
  See
169
- [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
169
+ [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
170
170
  for details.
171
171
  """
172
172
 
@@ -187,9 +187,9 @@ class MessageCreateParamsBase(TypedDict, total=False):
187
187
 
188
188
  There are two types of tools: **client tools** and **server tools**. The
189
189
  behavior described below applies to client tools. For
190
- [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
190
+ [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
191
191
  see their individual documentation as each has its own behavior (e.g., the
192
- [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
192
+ [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
193
193
 
194
194
  Each tool definition includes:
195
195
 
@@ -252,7 +252,7 @@ class MessageCreateParamsBase(TypedDict, total=False):
252
252
  functions, or more generally whenever you want the model to produce a particular
253
253
  JSON structure of output.
254
254
 
255
- See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
255
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
256
256
  """
257
257
 
258
258
  top_k: int
@@ -298,8 +298,7 @@ class MessageCreateParamsNonStreaming(MessageCreateParamsBase, total=False):
298
298
  stream: Literal[False]
299
299
  """Whether to incrementally stream the response using server-sent events.
300
300
 
301
- See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
302
- details.
301
+ See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
303
302
  """
304
303
 
305
304
 
@@ -307,8 +306,7 @@ class MessageCreateParamsStreaming(MessageCreateParamsBase):
307
306
  stream: Required[Literal[True]]
308
307
  """Whether to incrementally stream the response using server-sent events.
309
308
 
310
- See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
311
- details.
309
+ See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
312
310
  """
313
311
 
314
312
 
@@ -18,6 +18,7 @@ class BatchCreateParams(TypedDict, total=False):
18
18
  """
19
19
 
20
20
 
21
+
21
22
  class Request(TypedDict, total=False):
22
23
  custom_id: Required[str]
23
24
  """Developer-provided ID created for each request in a Message Batch.
anthropic/types/model.py CHANGED
@@ -18,9 +18,6 @@ Model: TypeAlias = Union[
18
18
  "claude-4-sonnet-20250514",
19
19
  "claude-sonnet-4-5",
20
20
  "claude-sonnet-4-5-20250929",
21
- "claude-3-5-sonnet-latest",
22
- "claude-3-5-sonnet-20241022",
23
- "claude-3-5-sonnet-20240620",
24
21
  "claude-opus-4-0",
25
22
  "claude-opus-4-20250514",
26
23
  "claude-4-opus-20250514",
@@ -20,9 +20,6 @@ ModelParam: TypeAlias = Union[
20
20
  "claude-4-sonnet-20250514",
21
21
  "claude-sonnet-4-5",
22
22
  "claude-sonnet-4-5-20250929",
23
- "claude-3-5-sonnet-latest",
24
- "claude-3-5-sonnet-20241022",
25
- "claude-3-5-sonnet-20240620",
26
23
  "claude-opus-4-0",
27
24
  "claude-opus-4-20250514",
28
25
  "claude-4-opus-20250514",
@@ -4,6 +4,4 @@ from typing_extensions import Literal, TypeAlias
4
4
 
5
5
  __all__ = ["StopReason"]
6
6
 
7
- StopReason: TypeAlias = Literal[
8
- "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal", "model_context_window_exceeded"
9
- ]
7
+ StopReason: TypeAlias = Literal["end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal"]
@@ -17,7 +17,7 @@ class ThinkingConfigEnabledParam(TypedDict, total=False):
17
17
  Must be ≥1024 and less than `max_tokens`.
18
18
 
19
19
  See
20
- [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
20
+ [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
21
21
  for details.
22
22
  """
23
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: anthropic
3
- Version: 0.70.0
3
+ Version: 0.71.1
4
4
  Summary: The official Python library for the anthropic API
5
5
  Project-URL: Homepage, https://github.com/anthropics/anthropic-sdk-python
6
6
  Project-URL: Repository, https://github.com/anthropics/anthropic-sdk-python
@@ -32,7 +32,7 @@ Requires-Dist: sniffio
32
32
  Requires-Dist: typing-extensions<5,>=4.10
33
33
  Provides-Extra: aiohttp
34
34
  Requires-Dist: aiohttp; extra == 'aiohttp'
35
- Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
35
+ Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
36
36
  Provides-Extra: bedrock
37
37
  Requires-Dist: boto3>=1.28.57; extra == 'bedrock'
38
38
  Requires-Dist: botocore>=1.31.57; extra == 'bedrock'