anthropic 0.66.0__py3-none-any.whl → 0.67.0__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.
- anthropic/_base_client.py +3 -3
- anthropic/_compat.py +48 -48
- anthropic/_models.py +41 -41
- anthropic/_utils/__init__.py +8 -2
- anthropic/_utils/_compat.py +45 -0
- anthropic/_utils/_datetime_parse.py +136 -0
- anthropic/_utils/_transform.py +5 -1
- anthropic/_utils/_typing.py +1 -1
- anthropic/_utils/_utils.py +0 -1
- anthropic/_version.py +1 -1
- anthropic/types/beta/__init__.py +14 -0
- anthropic/types/beta/beta_base64_pdf_source.py +15 -0
- anthropic/types/beta/beta_citation_config.py +9 -0
- anthropic/types/beta/beta_content_block.py +2 -0
- anthropic/types/beta/beta_content_block_param.py +4 -0
- anthropic/types/beta/beta_document_block.py +26 -0
- anthropic/types/beta/beta_plain_text_source.py +15 -0
- anthropic/types/beta/beta_raw_content_block_start_event.py +2 -0
- anthropic/types/beta/beta_request_document_block_param.py +1 -1
- anthropic/types/beta/beta_server_tool_usage.py +3 -0
- anthropic/types/beta/beta_server_tool_use_block.py +1 -1
- anthropic/types/beta/beta_server_tool_use_block_param.py +3 -1
- anthropic/types/beta/beta_tool_union_param.py +2 -0
- anthropic/types/beta/beta_web_fetch_block.py +21 -0
- anthropic/types/beta/beta_web_fetch_block_param.py +22 -0
- anthropic/types/beta/beta_web_fetch_tool_20250910_param.py +46 -0
- anthropic/types/beta/beta_web_fetch_tool_result_block.py +20 -0
- anthropic/types/beta/beta_web_fetch_tool_result_block_param.py +25 -0
- anthropic/types/beta/beta_web_fetch_tool_result_error_block.py +14 -0
- anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py +15 -0
- anthropic/types/beta/beta_web_fetch_tool_result_error_code.py +16 -0
- anthropic/types/beta/message_count_tokens_params.py +2 -0
- anthropic/types/document_block_param.py +1 -1
- {anthropic-0.66.0.dist-info → anthropic-0.67.0.dist-info}/METADATA +1 -1
- {anthropic-0.66.0.dist-info → anthropic-0.67.0.dist-info}/RECORD +37 -23
- {anthropic-0.66.0.dist-info → anthropic-0.67.0.dist-info}/WHEEL +0 -0
- {anthropic-0.66.0.dist-info → anthropic-0.67.0.dist-info}/licenses/LICENSE +0 -0
anthropic/types/beta/__init__.py
CHANGED
|
@@ -19,17 +19,22 @@ from .beta_message_param import BetaMessageParam as BetaMessageParam
|
|
|
19
19
|
from .beta_text_citation import BetaTextCitation as BetaTextCitation
|
|
20
20
|
from .file_upload_params import FileUploadParams as FileUploadParams
|
|
21
21
|
from .beta_cache_creation import BetaCacheCreation as BetaCacheCreation
|
|
22
|
+
from .beta_document_block import BetaDocumentBlock as BetaDocumentBlock
|
|
22
23
|
from .beta_metadata_param import BetaMetadataParam as BetaMetadataParam
|
|
23
24
|
from .beta_thinking_block import BetaThinkingBlock as BetaThinkingBlock
|
|
24
25
|
from .beta_thinking_delta import BetaThinkingDelta as BetaThinkingDelta
|
|
25
26
|
from .beta_tool_use_block import BetaToolUseBlock as BetaToolUseBlock
|
|
27
|
+
from .beta_citation_config import BetaCitationConfig as BetaCitationConfig
|
|
26
28
|
from .beta_citations_delta import BetaCitationsDelta as BetaCitationsDelta
|
|
27
29
|
from .beta_signature_delta import BetaSignatureDelta as BetaSignatureDelta
|
|
30
|
+
from .beta_web_fetch_block import BetaWebFetchBlock as BetaWebFetchBlock
|
|
28
31
|
from .beta_input_json_delta import BetaInputJSONDelta as BetaInputJSONDelta
|
|
29
32
|
from .beta_text_block_param import BetaTextBlockParam as BetaTextBlockParam
|
|
30
33
|
from .beta_tool_union_param import BetaToolUnionParam as BetaToolUnionParam
|
|
31
34
|
from .message_create_params import MessageCreateParams as MessageCreateParams
|
|
35
|
+
from .beta_base64_pdf_source import BetaBase64PDFSource as BetaBase64PDFSource
|
|
32
36
|
from .beta_image_block_param import BetaImageBlockParam as BetaImageBlockParam
|
|
37
|
+
from .beta_plain_text_source import BetaPlainTextSource as BetaPlainTextSource
|
|
33
38
|
from .beta_server_tool_usage import BetaServerToolUsage as BetaServerToolUsage
|
|
34
39
|
from .beta_tool_choice_param import BetaToolChoiceParam as BetaToolChoiceParam
|
|
35
40
|
from .beta_mcp_tool_use_block import BetaMCPToolUseBlock as BetaMCPToolUseBlock
|
|
@@ -44,6 +49,7 @@ from .beta_mcp_tool_result_block import BetaMCPToolResultBlock as BetaMCPToolRes
|
|
|
44
49
|
from .beta_server_tool_use_block import BetaServerToolUseBlock as BetaServerToolUseBlock
|
|
45
50
|
from .beta_thinking_config_param import BetaThinkingConfigParam as BetaThinkingConfigParam
|
|
46
51
|
from .beta_tool_choice_any_param import BetaToolChoiceAnyParam as BetaToolChoiceAnyParam
|
|
52
|
+
from .beta_web_fetch_block_param import BetaWebFetchBlockParam as BetaWebFetchBlockParam
|
|
47
53
|
from .beta_base64_pdf_block_param import BetaBase64PDFBlockParam as BetaBase64PDFBlockParam
|
|
48
54
|
from .beta_citation_char_location import BetaCitationCharLocation as BetaCitationCharLocation
|
|
49
55
|
from .beta_citation_page_location import BetaCitationPageLocation as BetaCitationPageLocation
|
|
@@ -75,6 +81,7 @@ from .beta_file_document_source_param import BetaFileDocumentSourceParam as Beta
|
|
|
75
81
|
from .beta_code_execution_output_block import BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock
|
|
76
82
|
from .beta_code_execution_result_block import BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock
|
|
77
83
|
from .beta_server_tool_use_block_param import BetaServerToolUseBlockParam as BetaServerToolUseBlockParam
|
|
84
|
+
from .beta_web_fetch_tool_result_block import BetaWebFetchToolResultBlock as BetaWebFetchToolResultBlock
|
|
78
85
|
from .beta_citation_char_location_param import BetaCitationCharLocationParam as BetaCitationCharLocationParam
|
|
79
86
|
from .beta_citation_page_location_param import BetaCitationPageLocationParam as BetaCitationPageLocationParam
|
|
80
87
|
from .beta_container_upload_block_param import BetaContainerUploadBlockParam as BetaContainerUploadBlockParam
|
|
@@ -87,6 +94,7 @@ from .beta_raw_content_block_delta_event import BetaRawContentBlockDeltaEvent as
|
|
|
87
94
|
from .beta_raw_content_block_start_event import BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent
|
|
88
95
|
from .beta_redacted_thinking_block_param import BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam
|
|
89
96
|
from .beta_thinking_config_enabled_param import BetaThinkingConfigEnabledParam as BetaThinkingConfigEnabledParam
|
|
97
|
+
from .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Param as BetaWebFetchTool20250910Param
|
|
90
98
|
from .beta_web_search_result_block_param import BetaWebSearchResultBlockParam as BetaWebSearchResultBlockParam
|
|
91
99
|
from .beta_thinking_config_disabled_param import BetaThinkingConfigDisabledParam as BetaThinkingConfigDisabledParam
|
|
92
100
|
from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param as BetaWebSearchTool20250305Param
|
|
@@ -102,12 +110,15 @@ from .beta_code_execution_tool_result_block import BetaCodeExecutionToolResultBl
|
|
|
102
110
|
from .beta_code_execution_tool_result_error import BetaCodeExecutionToolResultError as BetaCodeExecutionToolResultError
|
|
103
111
|
from .beta_tool_computer_use_20241022_param import BetaToolComputerUse20241022Param as BetaToolComputerUse20241022Param
|
|
104
112
|
from .beta_tool_computer_use_20250124_param import BetaToolComputerUse20250124Param as BetaToolComputerUse20250124Param
|
|
113
|
+
from .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode as BetaWebFetchToolResultErrorCode
|
|
105
114
|
from .beta_code_execution_output_block_param import (
|
|
106
115
|
BetaCodeExecutionOutputBlockParam as BetaCodeExecutionOutputBlockParam,
|
|
107
116
|
)
|
|
108
117
|
from .beta_code_execution_result_block_param import (
|
|
109
118
|
BetaCodeExecutionResultBlockParam as BetaCodeExecutionResultBlockParam,
|
|
110
119
|
)
|
|
120
|
+
from .beta_web_fetch_tool_result_block_param import BetaWebFetchToolResultBlockParam as BetaWebFetchToolResultBlockParam
|
|
121
|
+
from .beta_web_fetch_tool_result_error_block import BetaWebFetchToolResultErrorBlock as BetaWebFetchToolResultErrorBlock
|
|
111
122
|
from .beta_web_search_tool_result_error_code import BetaWebSearchToolResultErrorCode as BetaWebSearchToolResultErrorCode
|
|
112
123
|
from .beta_code_execution_tool_20250522_param import (
|
|
113
124
|
BetaCodeExecutionTool20250522Param as BetaCodeExecutionTool20250522Param,
|
|
@@ -163,6 +174,9 @@ from .beta_code_execution_tool_result_error_param import (
|
|
|
163
174
|
from .beta_request_mcp_server_url_definition_param import (
|
|
164
175
|
BetaRequestMCPServerURLDefinitionParam as BetaRequestMCPServerURLDefinitionParam,
|
|
165
176
|
)
|
|
177
|
+
from .beta_web_fetch_tool_result_error_block_param import (
|
|
178
|
+
BetaWebFetchToolResultErrorBlockParam as BetaWebFetchToolResultErrorBlockParam,
|
|
179
|
+
)
|
|
166
180
|
from .beta_code_execution_tool_result_block_content import (
|
|
167
181
|
BetaCodeExecutionToolResultBlockContent as BetaCodeExecutionToolResultBlockContent,
|
|
168
182
|
)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["BetaBase64PDFSource"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BetaBase64PDFSource(BaseModel):
|
|
11
|
+
data: str
|
|
12
|
+
|
|
13
|
+
media_type: Literal["application/pdf"]
|
|
14
|
+
|
|
15
|
+
type: Literal["base64"]
|
|
@@ -12,6 +12,7 @@ from .beta_mcp_tool_result_block import BetaMCPToolResultBlock
|
|
|
12
12
|
from .beta_server_tool_use_block import BetaServerToolUseBlock
|
|
13
13
|
from .beta_container_upload_block import BetaContainerUploadBlock
|
|
14
14
|
from .beta_redacted_thinking_block import BetaRedactedThinkingBlock
|
|
15
|
+
from .beta_web_fetch_tool_result_block import BetaWebFetchToolResultBlock
|
|
15
16
|
from .beta_web_search_tool_result_block import BetaWebSearchToolResultBlock
|
|
16
17
|
from .beta_code_execution_tool_result_block import BetaCodeExecutionToolResultBlock
|
|
17
18
|
from .beta_bash_code_execution_tool_result_block import BetaBashCodeExecutionToolResultBlock
|
|
@@ -27,6 +28,7 @@ BetaContentBlock: TypeAlias = Annotated[
|
|
|
27
28
|
BetaToolUseBlock,
|
|
28
29
|
BetaServerToolUseBlock,
|
|
29
30
|
BetaWebSearchToolResultBlock,
|
|
31
|
+
BetaWebFetchToolResultBlock,
|
|
30
32
|
BetaCodeExecutionToolResultBlock,
|
|
31
33
|
BetaBashCodeExecutionToolResultBlock,
|
|
32
34
|
BetaTextEditorCodeExecutionToolResultBlock,
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Union
|
|
6
6
|
from typing_extensions import TypeAlias
|
|
7
7
|
|
|
8
|
+
from .beta_content_block import BetaContentBlock
|
|
8
9
|
from .beta_text_block_param import BetaTextBlockParam
|
|
9
10
|
from .beta_image_block_param import BetaImageBlockParam
|
|
10
11
|
from .beta_thinking_block_param import BetaThinkingBlockParam
|
|
@@ -16,6 +17,7 @@ from .beta_server_tool_use_block_param import BetaServerToolUseBlockParam
|
|
|
16
17
|
from .beta_container_upload_block_param import BetaContainerUploadBlockParam
|
|
17
18
|
from .beta_request_document_block_param import BetaRequestDocumentBlockParam
|
|
18
19
|
from .beta_redacted_thinking_block_param import BetaRedactedThinkingBlockParam
|
|
20
|
+
from .beta_web_fetch_tool_result_block_param import BetaWebFetchToolResultBlockParam
|
|
19
21
|
from .beta_web_search_tool_result_block_param import BetaWebSearchToolResultBlockParam
|
|
20
22
|
from .beta_request_mcp_tool_result_block_param import BetaRequestMCPToolResultBlockParam
|
|
21
23
|
from .beta_code_execution_tool_result_block_param import BetaCodeExecutionToolResultBlockParam
|
|
@@ -35,10 +37,12 @@ BetaContentBlockParam: TypeAlias = Union[
|
|
|
35
37
|
BetaToolResultBlockParam,
|
|
36
38
|
BetaServerToolUseBlockParam,
|
|
37
39
|
BetaWebSearchToolResultBlockParam,
|
|
40
|
+
BetaWebFetchToolResultBlockParam,
|
|
38
41
|
BetaCodeExecutionToolResultBlockParam,
|
|
39
42
|
BetaBashCodeExecutionToolResultBlockParam,
|
|
40
43
|
BetaTextEditorCodeExecutionToolResultBlockParam,
|
|
41
44
|
BetaMCPToolUseBlockParam,
|
|
42
45
|
BetaRequestMCPToolResultBlockParam,
|
|
43
46
|
BetaContainerUploadBlockParam,
|
|
47
|
+
BetaContentBlock,
|
|
44
48
|
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Union, Optional
|
|
4
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
5
|
+
|
|
6
|
+
from ..._utils import PropertyInfo
|
|
7
|
+
from ..._models import BaseModel
|
|
8
|
+
from .beta_citation_config import BetaCitationConfig
|
|
9
|
+
from .beta_base64_pdf_source import BetaBase64PDFSource
|
|
10
|
+
from .beta_plain_text_source import BetaPlainTextSource
|
|
11
|
+
|
|
12
|
+
__all__ = ["BetaDocumentBlock", "Source"]
|
|
13
|
+
|
|
14
|
+
Source: TypeAlias = Annotated[Union[BetaBase64PDFSource, BetaPlainTextSource], PropertyInfo(discriminator="type")]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BetaDocumentBlock(BaseModel):
|
|
18
|
+
citations: Optional[BetaCitationConfig] = None
|
|
19
|
+
"""Citation configuration for the document"""
|
|
20
|
+
|
|
21
|
+
source: Source
|
|
22
|
+
|
|
23
|
+
title: Optional[str] = None
|
|
24
|
+
"""The title of the document"""
|
|
25
|
+
|
|
26
|
+
type: Literal["document"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["BetaPlainTextSource"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BetaPlainTextSource(BaseModel):
|
|
11
|
+
data: str
|
|
12
|
+
|
|
13
|
+
media_type: Literal["text/plain"]
|
|
14
|
+
|
|
15
|
+
type: Literal["text"]
|
|
@@ -13,6 +13,7 @@ from .beta_mcp_tool_result_block import BetaMCPToolResultBlock
|
|
|
13
13
|
from .beta_server_tool_use_block import BetaServerToolUseBlock
|
|
14
14
|
from .beta_container_upload_block import BetaContainerUploadBlock
|
|
15
15
|
from .beta_redacted_thinking_block import BetaRedactedThinkingBlock
|
|
16
|
+
from .beta_web_fetch_tool_result_block import BetaWebFetchToolResultBlock
|
|
16
17
|
from .beta_web_search_tool_result_block import BetaWebSearchToolResultBlock
|
|
17
18
|
from .beta_code_execution_tool_result_block import BetaCodeExecutionToolResultBlock
|
|
18
19
|
from .beta_bash_code_execution_tool_result_block import BetaBashCodeExecutionToolResultBlock
|
|
@@ -28,6 +29,7 @@ ContentBlock: TypeAlias = Annotated[
|
|
|
28
29
|
BetaToolUseBlock,
|
|
29
30
|
BetaServerToolUseBlock,
|
|
30
31
|
BetaWebSearchToolResultBlock,
|
|
32
|
+
BetaWebFetchToolResultBlock,
|
|
31
33
|
BetaCodeExecutionToolResultBlock,
|
|
32
34
|
BetaBashCodeExecutionToolResultBlock,
|
|
33
35
|
BetaTextEditorCodeExecutionToolResultBlock,
|
|
@@ -32,7 +32,7 @@ class BetaRequestDocumentBlockParam(TypedDict, total=False):
|
|
|
32
32
|
cache_control: Optional[BetaCacheControlEphemeralParam]
|
|
33
33
|
"""Create a cache control breakpoint at this content block."""
|
|
34
34
|
|
|
35
|
-
citations: BetaCitationsConfigParam
|
|
35
|
+
citations: Optional[BetaCitationsConfigParam]
|
|
36
36
|
|
|
37
37
|
context: Optional[str]
|
|
38
38
|
|
|
@@ -12,6 +12,6 @@ class BetaServerToolUseBlock(BaseModel):
|
|
|
12
12
|
|
|
13
13
|
input: object
|
|
14
14
|
|
|
15
|
-
name: Literal["web_search", "code_execution", "bash_code_execution", "text_editor_code_execution"]
|
|
15
|
+
name: Literal["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution"]
|
|
16
16
|
|
|
17
17
|
type: Literal["server_tool_use"]
|
|
@@ -15,7 +15,9 @@ class BetaServerToolUseBlockParam(TypedDict, total=False):
|
|
|
15
15
|
|
|
16
16
|
input: Required[object]
|
|
17
17
|
|
|
18
|
-
name: Required[
|
|
18
|
+
name: Required[
|
|
19
|
+
Literal["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution"]
|
|
20
|
+
]
|
|
19
21
|
|
|
20
22
|
type: Required[Literal["server_tool_use"]]
|
|
21
23
|
|
|
@@ -8,6 +8,7 @@ from typing_extensions import TypeAlias
|
|
|
8
8
|
from .beta_tool_param import BetaToolParam
|
|
9
9
|
from .beta_tool_bash_20241022_param import BetaToolBash20241022Param
|
|
10
10
|
from .beta_tool_bash_20250124_param import BetaToolBash20250124Param
|
|
11
|
+
from .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Param
|
|
11
12
|
from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param
|
|
12
13
|
from .beta_tool_text_editor_20241022_param import BetaToolTextEditor20241022Param
|
|
13
14
|
from .beta_tool_text_editor_20250124_param import BetaToolTextEditor20250124Param
|
|
@@ -33,4 +34,5 @@ BetaToolUnionParam: TypeAlias = Union[
|
|
|
33
34
|
BetaToolTextEditor20250429Param,
|
|
34
35
|
BetaToolTextEditor20250728Param,
|
|
35
36
|
BetaWebSearchTool20250305Param,
|
|
37
|
+
BetaWebFetchTool20250910Param,
|
|
36
38
|
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from ..._models import BaseModel
|
|
7
|
+
from .beta_document_block import BetaDocumentBlock
|
|
8
|
+
|
|
9
|
+
__all__ = ["BetaWebFetchBlock"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BetaWebFetchBlock(BaseModel):
|
|
13
|
+
content: BetaDocumentBlock
|
|
14
|
+
|
|
15
|
+
retrieved_at: Optional[str] = None
|
|
16
|
+
"""ISO 8601 timestamp when the content was retrieved"""
|
|
17
|
+
|
|
18
|
+
type: Literal["web_fetch_result"]
|
|
19
|
+
|
|
20
|
+
url: str
|
|
21
|
+
"""Fetched content URL"""
|
|
@@ -0,0 +1,22 @@
|
|
|
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 Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .beta_request_document_block_param import BetaRequestDocumentBlockParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["BetaWebFetchBlockParam"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BetaWebFetchBlockParam(TypedDict, total=False):
|
|
14
|
+
content: Required[BetaRequestDocumentBlockParam]
|
|
15
|
+
|
|
16
|
+
type: Required[Literal["web_fetch_result"]]
|
|
17
|
+
|
|
18
|
+
url: Required[str]
|
|
19
|
+
"""Fetched content URL"""
|
|
20
|
+
|
|
21
|
+
retrieved_at: Optional[str]
|
|
22
|
+
"""ISO 8601 timestamp when the content was retrieved"""
|
|
@@ -0,0 +1,46 @@
|
|
|
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 Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
from .beta_citations_config_param import BetaCitationsConfigParam
|
|
10
|
+
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
|
|
11
|
+
|
|
12
|
+
__all__ = ["BetaWebFetchTool20250910Param"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BetaWebFetchTool20250910Param(TypedDict, total=False):
|
|
16
|
+
name: Required[Literal["web_fetch"]]
|
|
17
|
+
"""Name of the tool.
|
|
18
|
+
|
|
19
|
+
This is how the tool will be called by the model and in `tool_use` blocks.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
type: Required[Literal["web_fetch_20250910"]]
|
|
23
|
+
|
|
24
|
+
allowed_domains: Optional[SequenceNotStr[str]]
|
|
25
|
+
"""List of domains to allow fetching from"""
|
|
26
|
+
|
|
27
|
+
blocked_domains: Optional[SequenceNotStr[str]]
|
|
28
|
+
"""List of domains to block fetching from"""
|
|
29
|
+
|
|
30
|
+
cache_control: Optional[BetaCacheControlEphemeralParam]
|
|
31
|
+
"""Create a cache control breakpoint at this content block."""
|
|
32
|
+
|
|
33
|
+
citations: Optional[BetaCitationsConfigParam]
|
|
34
|
+
"""Citations configuration for fetched documents.
|
|
35
|
+
|
|
36
|
+
Citations are disabled by default.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
max_content_tokens: Optional[int]
|
|
40
|
+
"""Maximum number of tokens used by including web page text content in the context.
|
|
41
|
+
|
|
42
|
+
The limit is approximate and does not apply to binary content such as PDFs.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
max_uses: Optional[int]
|
|
46
|
+
"""Maximum number of times the tool can be used in the API request."""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Union
|
|
4
|
+
from typing_extensions import Literal, TypeAlias
|
|
5
|
+
|
|
6
|
+
from ..._models import BaseModel
|
|
7
|
+
from .beta_web_fetch_block import BetaWebFetchBlock
|
|
8
|
+
from .beta_web_fetch_tool_result_error_block import BetaWebFetchToolResultErrorBlock
|
|
9
|
+
|
|
10
|
+
__all__ = ["BetaWebFetchToolResultBlock", "Content"]
|
|
11
|
+
|
|
12
|
+
Content: TypeAlias = Union[BetaWebFetchToolResultErrorBlock, BetaWebFetchBlock]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BetaWebFetchToolResultBlock(BaseModel):
|
|
16
|
+
content: Content
|
|
17
|
+
|
|
18
|
+
tool_use_id: str
|
|
19
|
+
|
|
20
|
+
type: Literal["web_fetch_tool_result"]
|
|
@@ -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 Union, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from .beta_web_fetch_block_param import BetaWebFetchBlockParam
|
|
9
|
+
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
|
|
10
|
+
from .beta_web_fetch_tool_result_error_block_param import BetaWebFetchToolResultErrorBlockParam
|
|
11
|
+
|
|
12
|
+
__all__ = ["BetaWebFetchToolResultBlockParam", "Content"]
|
|
13
|
+
|
|
14
|
+
Content: TypeAlias = Union[BetaWebFetchToolResultErrorBlockParam, BetaWebFetchBlockParam]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BetaWebFetchToolResultBlockParam(TypedDict, total=False):
|
|
18
|
+
content: Required[Content]
|
|
19
|
+
|
|
20
|
+
tool_use_id: Required[str]
|
|
21
|
+
|
|
22
|
+
type: Required[Literal["web_fetch_tool_result"]]
|
|
23
|
+
|
|
24
|
+
cache_control: Optional[BetaCacheControlEphemeralParam]
|
|
25
|
+
"""Create a cache control breakpoint at this content block."""
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
from .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode
|
|
7
|
+
|
|
8
|
+
__all__ = ["BetaWebFetchToolResultErrorBlock"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BetaWebFetchToolResultErrorBlock(BaseModel):
|
|
12
|
+
error_code: BetaWebFetchToolResultErrorCode
|
|
13
|
+
|
|
14
|
+
type: Literal["web_fetch_tool_result_error"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
|
+
|
|
7
|
+
from .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode
|
|
8
|
+
|
|
9
|
+
__all__ = ["BetaWebFetchToolResultErrorBlockParam"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BetaWebFetchToolResultErrorBlockParam(TypedDict, total=False):
|
|
13
|
+
error_code: Required[BetaWebFetchToolResultErrorCode]
|
|
14
|
+
|
|
15
|
+
type: Required[Literal["web_fetch_tool_result_error"]]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal, TypeAlias
|
|
4
|
+
|
|
5
|
+
__all__ = ["BetaWebFetchToolResultErrorCode"]
|
|
6
|
+
|
|
7
|
+
BetaWebFetchToolResultErrorCode: TypeAlias = Literal[
|
|
8
|
+
"invalid_tool_input",
|
|
9
|
+
"url_too_long",
|
|
10
|
+
"url_not_allowed",
|
|
11
|
+
"url_not_accessible",
|
|
12
|
+
"unsupported_content_type",
|
|
13
|
+
"too_many_requests",
|
|
14
|
+
"max_uses_exceeded",
|
|
15
|
+
"unavailable",
|
|
16
|
+
]
|
|
@@ -15,6 +15,7 @@ from .beta_tool_choice_param import BetaToolChoiceParam
|
|
|
15
15
|
from .beta_thinking_config_param import BetaThinkingConfigParam
|
|
16
16
|
from .beta_tool_bash_20241022_param import BetaToolBash20241022Param
|
|
17
17
|
from .beta_tool_bash_20250124_param import BetaToolBash20250124Param
|
|
18
|
+
from .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Param
|
|
18
19
|
from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param
|
|
19
20
|
from .beta_tool_text_editor_20241022_param import BetaToolTextEditor20241022Param
|
|
20
21
|
from .beta_tool_text_editor_20250124_param import BetaToolTextEditor20250124Param
|
|
@@ -230,4 +231,5 @@ Tool: TypeAlias = Union[
|
|
|
230
231
|
BetaToolTextEditor20250429Param,
|
|
231
232
|
BetaToolTextEditor20250728Param,
|
|
232
233
|
BetaWebSearchTool20250305Param,
|
|
234
|
+
BetaWebFetchTool20250910Param,
|
|
233
235
|
]
|
|
@@ -25,7 +25,7 @@ class DocumentBlockParam(TypedDict, total=False):
|
|
|
25
25
|
cache_control: Optional[CacheControlEphemeralParam]
|
|
26
26
|
"""Create a cache control breakpoint at this content block."""
|
|
27
27
|
|
|
28
|
-
citations: CitationsConfigParam
|
|
28
|
+
citations: Optional[CitationsConfigParam]
|
|
29
29
|
|
|
30
30
|
context: Optional[str]
|
|
31
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: anthropic
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.67.0
|
|
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
|