Upload folder using huggingface_hub (part 5)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_result_error_param.pyAdded+14
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block.pyAdded+13
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.pyAdded+14
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022.pyAdded+35
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022_param.pyAdded+36
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124.pyAdded+35
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124_param.pyAdded+36
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429.pyAdded+35
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429_param.pyAdded+36
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728.pyAdded+41
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728_param.pyAdded+42
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_union_param.pyAdded+66
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block.pyAdded+28
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block_param.pyAdded+31
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_caller.pyAdded+13
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_keep_param.pyAdded+11
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_trigger_param.pyAdded+11
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_toolset_tool_use_block.pyAdded+10
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel.pyAdded+35
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel_token.pyAdded+20
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network.pyAdded+12
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network_param.pyAdded+12
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_image_source_param.pyAdded+11
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_pdf_source_param.pyAdded+11
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_usage.pyAdded+81
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location.pyAdded+26
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location_param.pyAdded+26
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_message_param.pyAdded+13
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile.pyAdded+93
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_enrollment_url.pyAdded+21
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details.pyAdded+63
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details_params.pyAdded+64
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_trust_grant.pyAdded+14
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block.pyAdded+19
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block_param.pyAdded+20
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910.pyAdded+62
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910_param.pyAdded+64
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209.pyAdded+62
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209_param.pyAdded+64
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309.pyAdded+72
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309_param.pyAdded+74
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318.pyAdded+80
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318_param.pyAdded+82
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block.pyAdded+27
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block_param.pyAdded+30
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block.pyAdded+12
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.pyAdded+13
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_code.pyAdded+16
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all.pyAdded+14
- .venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all_param.pyAdded+14
1234567891011121314from __future__ import annotations
from typing import Optionalfrom typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaToolSearchToolResultErrorParam"]
class BetaToolSearchToolResultErrorParam(TypedDict, total=False): error_code: Required[Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]]
type: Required[Literal["tool_search_tool_result_error"]]
error_message: Optional[str]12345678910111213from typing import Listfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_tool_reference_block import BetaToolReferenceBlock
__all__ = ["BetaToolSearchToolSearchResultBlock"]
class BetaToolSearchToolSearchResultBlock(BaseModel): tool_references: List[BetaToolReferenceBlock]
type: Literal["tool_search_tool_search_result"]1234567891011121314from __future__ import annotations
from typing import Iterablefrom typing_extensions import Literal, Required, TypedDict
from .beta_tool_reference_block_param import BetaToolReferenceBlockParam
__all__ = ["BetaToolSearchToolSearchResultBlockParam"]
class BetaToolSearchToolSearchResultBlockParam(TypedDict, total=False): tool_references: Required[Iterable[BetaToolReferenceBlockParam]]
type: Required[Literal["tool_search_tool_search_result"]]1234567891011121314151617181920212223242526272829303132333435from typing import Dict, List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaToolTextEditor20241022"]
class BetaToolTextEditor20241022(BaseModel): name: Literal["str_replace_editor"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["text_editor_20241022"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Optional[List[Dict[str, object]]] = None
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""123456789101112131415161718192021222324252627282930313233343536from __future__ import annotations
from typing import Dict, List, Iterable, Optionalfrom typing_extensions import Literal, Required, TypedDict
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaToolTextEditor20241022Param"]
class BetaToolTextEditor20241022Param(TypedDict, total=False): name: Required[Literal["str_replace_editor"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["text_editor_20241022"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Iterable[Dict[str, object]]
strict: bool """When true, guarantees schema validation on tool names and inputs"""1234567891011121314151617181920212223242526272829303132333435from typing import Dict, List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaToolTextEditor20250124"]
class BetaToolTextEditor20250124(BaseModel): name: Literal["str_replace_editor"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["text_editor_20250124"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Optional[List[Dict[str, object]]] = None
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""123456789101112131415161718192021222324252627282930313233343536from __future__ import annotations
from typing import Dict, List, Iterable, Optionalfrom typing_extensions import Literal, Required, TypedDict
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaToolTextEditor20250124Param"]
class BetaToolTextEditor20250124Param(TypedDict, total=False): name: Required[Literal["str_replace_editor"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["text_editor_20250124"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Iterable[Dict[str, object]]
strict: bool """When true, guarantees schema validation on tool names and inputs"""1234567891011121314151617181920212223242526272829303132333435from typing import Dict, List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaToolTextEditor20250429"]
class BetaToolTextEditor20250429(BaseModel): name: Literal["str_replace_based_edit_tool"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["text_editor_20250429"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Optional[List[Dict[str, object]]] = None
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""123456789101112131415161718192021222324252627282930313233343536from __future__ import annotations
from typing import Dict, List, Iterable, Optionalfrom typing_extensions import Literal, Required, TypedDict
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaToolTextEditor20250429Param"]
class BetaToolTextEditor20250429Param(TypedDict, total=False): name: Required[Literal["str_replace_based_edit_tool"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["text_editor_20250429"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Iterable[Dict[str, object]]
strict: bool """When true, guarantees schema validation on tool names and inputs"""1234567891011121314151617181920212223242526272829303132333435363738394041from typing import Dict, List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaToolTextEditor20250728"]
class BetaToolTextEditor20250728(BaseModel): name: Literal["str_replace_based_edit_tool"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["text_editor_20250728"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Optional[List[Dict[str, object]]] = None
max_characters: Optional[int] = None """Maximum number of characters to display when viewing a file.
If not specified, defaults to displaying the full file. """
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""123456789101112131415161718192021222324252627282930313233343536373839404142from __future__ import annotations
from typing import Dict, List, Iterable, Optionalfrom typing_extensions import Literal, Required, TypedDict
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaToolTextEditor20250728Param"]
class BetaToolTextEditor20250728Param(TypedDict, total=False): name: Required[Literal["str_replace_based_edit_tool"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["text_editor_20250728"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
input_examples: Iterable[Dict[str, object]]
max_characters: Optional[int] """Maximum number of characters to display when viewing a file.
If not specified, defaults to displaying the full file. """
strict: bool """When true, guarantees schema validation on tool names and inputs"""123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566from __future__ import annotations
from typing import Unionfrom typing_extensions import TypeAlias
from .beta_tool_param import BetaToolParamfrom .beta_mcp_toolset_param import BetaMCPToolsetParamfrom .beta_tool_bash_20241022_param import BetaToolBash20241022Paramfrom .beta_tool_bash_20250124_param import BetaToolBash20250124Paramfrom .beta_memory_tool_20250818_param import BetaMemoryTool20250818Paramfrom .beta_advisor_tool_20260301_param import BetaAdvisorTool20260301Paramfrom .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Paramfrom .beta_web_fetch_tool_20260209_param import BetaWebFetchTool20260209Paramfrom .beta_web_fetch_tool_20260309_param import BetaWebFetchTool20260309Paramfrom .beta_web_fetch_tool_20260318_param import BetaWebFetchTool20260318Paramfrom .beta_browser_toolset_20260801_param import BetaBrowserToolset20260801Paramfrom .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Paramfrom .beta_web_search_tool_20260209_param import BetaWebSearchTool20260209Paramfrom .beta_web_search_tool_20260318_param import BetaWebSearchTool20260318Paramfrom .beta_computer_toolset_20260801_param import BetaComputerToolset20260801Paramfrom .beta_tool_text_editor_20241022_param import BetaToolTextEditor20241022Paramfrom .beta_tool_text_editor_20250124_param import BetaToolTextEditor20250124Paramfrom .beta_tool_text_editor_20250429_param import BetaToolTextEditor20250429Paramfrom .beta_tool_text_editor_20250728_param import BetaToolTextEditor20250728Paramfrom .beta_tool_computer_use_20241022_param import BetaToolComputerUse20241022Paramfrom .beta_tool_computer_use_20250124_param import BetaToolComputerUse20250124Paramfrom .beta_tool_computer_use_20251124_param import BetaToolComputerUse20251124Paramfrom .beta_code_execution_tool_20250522_param import BetaCodeExecutionTool20250522Paramfrom .beta_code_execution_tool_20250825_param import BetaCodeExecutionTool20250825Paramfrom .beta_code_execution_tool_20260120_param import BetaCodeExecutionTool20260120Paramfrom .beta_code_execution_tool_20260521_param import BetaCodeExecutionTool20260521Paramfrom .beta_tool_search_tool_bm25_20251119_param import BetaToolSearchToolBm25_20251119Paramfrom .beta_tool_search_tool_regex_20251119_param import BetaToolSearchToolRegex20251119Param
__all__ = ["BetaToolUnionParam"]
BetaToolUnionParam: TypeAlias = Union[ BetaToolParam, BetaToolBash20241022Param, BetaToolBash20250124Param, BetaCodeExecutionTool20250522Param, BetaCodeExecutionTool20250825Param, BetaCodeExecutionTool20260120Param, BetaCodeExecutionTool20260521Param, BetaBrowserToolset20260801Param, BetaToolComputerUse20241022Param, BetaMemoryTool20250818Param, BetaToolComputerUse20250124Param, BetaToolTextEditor20241022Param, BetaToolComputerUse20251124Param, BetaComputerToolset20260801Param, BetaToolTextEditor20250124Param, BetaToolTextEditor20250429Param, BetaToolTextEditor20250728Param, BetaWebSearchTool20250305Param, BetaWebFetchTool20250910Param, BetaWebSearchTool20260209Param, BetaWebFetchTool20260209Param, BetaWebFetchTool20260309Param, BetaWebSearchTool20260318Param, BetaWebFetchTool20260318Param, BetaAdvisorTool20260301Param, BetaToolSearchToolBm25_20251119Param, BetaToolSearchToolRegex20251119Param, BetaMCPToolsetParam,]12345678910111213141516171819202122232425262728from typing import Dict, Union, Optionalfrom typing_extensions import Literal, Annotated, TypeAlias
from ..._models import BaseModel, UnionDiscriminatorfrom .beta_direct_caller import BetaDirectCallerfrom .beta_server_tool_caller import BetaServerToolCallerfrom .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120
__all__ = ["BetaToolUseBlock", "Caller"]
Caller: TypeAlias = Annotated[ Union[BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120], UnionDiscriminator("type")]
class BetaToolUseBlock(BaseModel): id: str
input: Dict[str, object]
name: str
type: Literal["tool_use"]
caller: Optional[Caller] = None
toolset_name: Optional[str] = None """For a toolset member tool_use, the toolset family."""12345678910111213141516171819202122232425262728293031from __future__ import annotations
from typing import Dict, Union, Optionalfrom typing_extensions import Literal, Required, TypeAlias, TypedDict
from .beta_direct_caller_param import BetaDirectCallerParamfrom .beta_server_tool_caller_param import BetaServerToolCallerParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParamfrom .beta_server_tool_caller_20260120_param import BetaServerToolCaller20260120Param
__all__ = ["BetaToolUseBlockParam", "Caller"]
Caller: TypeAlias = Union[BetaDirectCallerParam, BetaServerToolCallerParam, BetaServerToolCaller20260120Param]
class BetaToolUseBlockParam(TypedDict, total=False): id: Required[str]
input: Required[Dict[str, object]]
name: Required[str]
type: Required[Literal["tool_use"]]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
caller: Caller
toolset_name: Optional[str] """For a toolset member tool_use, the toolset family this member belongs to."""12345678910111213from typing import Unionfrom typing_extensions import Annotated, TypeAlias
from ..._models import UnionDiscriminatorfrom .beta_direct_caller import BetaDirectCallerfrom .beta_server_tool_caller import BetaServerToolCallerfrom .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120
__all__ = ["BetaToolUseCaller"]
BetaToolUseCaller: TypeAlias = Annotated[ Union[BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120], UnionDiscriminator("type")]1234567891011from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaToolUsesKeepParam"]
class BetaToolUsesKeepParam(TypedDict, total=False): type: Required[Literal["tool_uses"]]
value: Required[int]1234567891011from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaToolUsesTriggerParam"]
class BetaToolUsesTriggerParam(TypedDict, total=False): type: Required[Literal["tool_uses"]]
value: Required[int]12345678910from typing import Unionfrom typing_extensions import TypeAlias
from .beta_tool_use_block import BetaToolUseBlockfrom .beta_browser_tool_use_block import BetaBrowserToolUseBlockfrom .beta_computer_tool_use_block import BetaComputerToolUseBlock
__all__ = ["BetaToolsetToolUseBlock"]
BetaToolsetToolUseBlock: TypeAlias = Union[BetaBrowserToolUseBlock, BetaComputerToolUseBlock, BetaToolUseBlock]1234567891011121314151617181920212223242526272829303132333435from typing import Optionalfrom datetime import datetimefrom typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaTunnel"]
class BetaTunnel(BaseModel): """An MCP tunnel."""
id: str """Unique identifier for the tunnel, prefixed with `tnl_`."""
archived_at: Optional[datetime] = None """RFC 3339 datetime string indicating when the tunnel was archived.
Null if it is not archived. """
created_at: datetime """RFC 3339 datetime string indicating when the tunnel was created."""
display_name: Optional[str] = None """Human-readable name for the tunnel (1-255 characters). Null if unset."""
domain: str """Anthropic-assigned hostname for the tunnel.
MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived. """
type: Literal["tunnel"]1234567891011121314151617181920from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaTunnelToken"]
class BetaTunnelToken(BaseModel): """A tunnel's connector token."""
id: str """Stable identifier for the current token value.
Changes when the token is rotated. """
tunnel_token: str """The connector token used to run the tunnel. Treat as a credential."""
type: Literal["tunnel_token"]123456789101112from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaUnrestrictedNetwork"]
class BetaUnrestrictedNetwork(BaseModel): """Unrestricted network access."""
type: Literal["unrestricted"] """Network policy type"""123456789101112from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaUnrestrictedNetworkParam"]
class BetaUnrestrictedNetworkParam(TypedDict, total=False): """Unrestricted network access."""
type: Required[Literal["unrestricted"]] """Network policy type"""1234567891011from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaURLImageSourceParam"]
class BetaURLImageSourceParam(TypedDict, total=False): type: Required[Literal["url"]]
url: Required[str]1234567891011from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaURLPDFSourceParam"]
class BetaURLPDFSourceParam(TypedDict, total=False): type: Required[Literal["url"]]
url: Required[str]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081from typing import Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_cache_creation import BetaCacheCreationfrom .beta_iterations_usage import BetaIterationsUsagefrom .beta_server_tool_usage import BetaServerToolUsagefrom .beta_fallback_credit_usage import BetaFallbackCreditUsagefrom .beta_output_tokens_details import BetaOutputTokensDetails
__all__ = ["BetaUsage"]
class BetaUsage(BaseModel): cache_creation: Optional[BetaCacheCreation] = None """Breakdown of cached tokens by TTL"""
cache_creation_input_tokens: Optional[int] = None """The number of input tokens used to create the cache entry."""
cache_read_input_tokens: Optional[int] = None """The number of input tokens read from the cache."""
fallback_credit: Optional[BetaFallbackCreditUsage] = None """Outcome of the `fallback_credit_token` presented on this request.
Present on every response to a non-batch request that carried a `fallback_credit_token`, in either redemption mode; absent otherwise (batch items accept and ignore the token and carry no outcome object). """
inference_geo: Optional[str] = None """The geographic region where inference was performed for this request."""
input_tokens: int """The number of input tokens which were used."""
iterations: Optional[BetaIterationsUsage] = None """Per-iteration token usage breakdown.
Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by `type`. For `message` entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:
- Calculate the context window size from the last `message` entry - Understand token accumulation across server-side tool use loops
A `compaction` entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a `compaction` entry, even when it is the last entry. A `compaction` entry's tokens are not included in the top-level `usage` fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each `compaction` entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results. """
output_tokens: int """The number of output tokens which were used."""
output_tokens_details: Optional[BetaOutputTokensDetails] = None """Breakdown of output tokens by category.
`output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you. """
server_tool_use: Optional[BetaServerToolUsage] = None """The number of server tool requests."""
service_tier: Optional[Literal["standard", "priority", "batch"]] = None """If the request used the priority, standard, or batch tier."""
speed: Optional[Literal["standard", "fast"]] = None """The inference speed mode used for this request."""1234567891011121314151617181920212223242526from typing import Optionalfrom typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaUserLocation"]
class BetaUserLocation(BaseModel): type: Literal["approximate"]
city: Optional[str] = None """The city of the user."""
country: Optional[str] = None """ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user. """
region: Optional[str] = None """The region of the user."""
timezone: Optional[str] = None """The [IANA timezone](https://nodatime.org/TimeZones) of the user."""1234567891011121314151617181920212223242526from __future__ import annotations
from typing import Optionalfrom typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaUserLocationParam"]
class BetaUserLocationParam(TypedDict, total=False): type: Required[Literal["approximate"]]
city: Optional[str] """The city of the user."""
country: Optional[str] """ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user. """
region: Optional[str] """The region of the user."""
timezone: Optional[str] """The [IANA timezone](https://nodatime.org/TimeZones) of the user."""12345678910111213from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
from .beta_message_content_param import BetaMessageContentParam
__all__ = ["BetaUserMessageParam"]
class BetaUserMessageParam(TypedDict, total=False): content: Required[BetaMessageContentParam]
role: Required[Literal["user"]]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293from typing import Dict, Optionalfrom datetime import datetimefrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_user_profile_trust_grant import BetaUserProfileTrustGrantfrom .beta_user_profile_external_user_details import BetaUserProfileExternalUserDetails
__all__ = ["BetaUserProfile"]
class BetaUserProfile(BaseModel): """ A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.
A Messages, Message Batches or token counting request can send a profile's `id` in the `anthropic-user-profile-id` header to attribute the request to that entity. """
id: str """Unique identifier for this user profile, prefixed `uprof_`."""
created_at: datetime """When this user profile was created, in RFC 3339 format."""
metadata: Dict[str, str] """Arbitrary key-value metadata.
Maximum 16 pairs, keys up to 64 chars, values up to 512 chars. """
name: Optional[str] = None """Real-world name of the entity this profile represents (company or individual).
For a company the platform resells Claude access to (`access_type` `passthrough`) this is that company's name. `null` until the platform supplies one. """
trust_grants: Dict[str, BetaUserProfileTrustGrant] """Trust grants for this profile, keyed by grant name.
Key omitted when no grant is active or in flight. """
type: Literal["user_profile"] """Object type. Always `user_profile`."""
updated_at: datetime """When this user profile was last modified, in RFC 3339 format.
It normally also updates shortly after Anthropic gives the profile an approval or withdraws one. Other changes to the statuses that Anthropic reports do not always update it, so read the status itself rather than watching this timestamp. """
access_type: Optional[Literal["application", "passthrough"]] = None """ How the platform uses the API for this entity: `application` (default) or `passthrough`. Absent under the legacy `user-profiles-2026-03-24` beta header.
- `application` - The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default. - `passthrough` - The user profile represents a company that the platform resells Claude access to. """
external_id: Optional[str] = None """Platform's own identifier for this user.
Not enforced unique. Legacy field, present only under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; without one of them, the value is `external_user_details.reference_id`. """
external_user_details: Optional[BetaUserProfileExternalUserDetails] = None """ Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Every field is present, `null` until the platform supplies a value. Absent under the legacy `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers, which serve `reference_id` as the top-level `external_id` and, under `user-profiles-2026-08-18`, `onboarded_at` as `external_user_onboarded_at`. """
external_user_onboarded_at: Optional[datetime] = None """ When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. Legacy field, present only under the `user-profiles-2026-08-18` beta header; without a legacy header, the value is `external_user_details.onboarded_at`. """123456789101112131415161718192021from datetime import datetimefrom typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaUserProfileEnrollmentURL"]
class BetaUserProfileEnrollmentURL(BaseModel): """ A URL to give to the entity that a user profile represents, so that the entity can enroll in a program. """
expires_at: datetime """When this enrollment URL expires, in RFC 3339 format."""
type: Literal["enrollment_url"] """Object type. Always `enrollment_url`."""
url: str """Enrollment URL to send to the end user. Valid until `expires_at`."""123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263from typing import Optionalfrom datetime import datetimefrom typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaUserProfileExternalUserDetails"]
class BetaUserProfileExternalUserDetails(BaseModel): """Details about the entity this profile represents, as the platform states them.
Anthropic does not verify them. Every field is present, `null` until the platform supplies a value. """
account_status: Optional[Literal["active", "suspended", "blocked"]] = None """ The status of the entity's account on the platform: `active`, `suspended` or `blocked`. `null` until the platform supplies one.
- `active` - The platform has neither restricted nor barred the account of the entity that the user profile represents. - `suspended` - The platform has restricted the account of the entity that the user profile represents and may restore it. - `blocked` - The platform has barred the account of the entity that the user profile represents. """
country: Optional[str] = None """ The country the platform associates with the entity, as an ISO 3166-1 alpha-2 code. `null` until the platform supplies one. """
email_hash: Optional[str] = None """The platform-computed hash of the entity's email address.
`null` until the platform supplies one. """
entity_type: Optional[Literal["individual", "business", "non_profit", "government"]] = None """ What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. `null` until the platform supplies one. """
name_hash: Optional[str] = None """The platform-computed hash of the entity's name.
`null` until the platform supplies one. """
onboarded_at: Optional[datetime] = None """ When the entity opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. """
reference_id: Optional[str] = None """The platform's own reference for the entity.
`null` until the platform supplies one. """12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364from __future__ import annotations
from typing import Union, Optionalfrom datetime import datetimefrom typing_extensions import Literal, TypedDict
__all__ = ["BetaUserProfileExternalUserDetailsParams"]
class BetaUserProfileExternalUserDetailsParams(TypedDict, total=False): account_status: Optional[Literal["active", "suspended", "blocked"]] """ The status of the entity's account on the platform: `active`, `suspended` or `blocked`.
- `active` - The platform has neither restricted nor barred the account of the entity that the user profile represents. - `suspended` - The platform has restricted the account of the entity that the user profile represents and may restore it. - `blocked` - The platform has barred the account of the entity that the user profile represents. """
country: Optional[str] """ The country of the entity (not of the platform), as the platform determines it: an ISO 3166-1 alpha-2 code in upper case, for example `US`. Only the form, two uppercase ASCII letters, is checked. """
email_hash: Optional[str] """A hash of the entity's email address, computed by the platform.
Anthropic treats it as an opaque string and does not prescribe the hash function. 1 to 255 characters. """
entity_type: Optional[Literal["individual", "business", "non_profit", "government"]] """ What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. """
name_hash: Optional[str] """A hash of the entity's name, computed by the platform.
Anthropic treats it as an opaque string and does not prescribe the hash function. 1 to 255 characters. """
onboarded_at: Union[str, datetime] """ When the entity opened its account with the platform, in RFC 3339 format: for an `application` profile, when the end-user signed up; for a `passthrough` profile, when the company became the platform's customer. Must be a complete timestamp no more than 1 minute in the future. """
reference_id: Optional[str] """ The platform's own reference for the entity, for example the key of the end-user's row in the platform's database. Not interpreted by Anthropic and not enforced unique. 1 to 255 characters. """1234567891011121314from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaUserProfileTrustGrant"]
class BetaUserProfileTrustGrant(BaseModel): """ The status of one trust grant on a user profile, listed in the profile's `trust_grants` map under the grant's name. """
status: Literal["active", "pending", "rejected"] """Status of the trust grant."""12345678910111213141516171819from typing import Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_document_block import BetaDocumentBlock
__all__ = ["BetaWebFetchBlock"]
class BetaWebFetchBlock(BaseModel): content: BetaDocumentBlock
retrieved_at: Optional[str] = None """ISO 8601 timestamp when the content was retrieved"""
type: Literal["web_fetch_result"]
url: str """Fetched content URL"""1234567891011121314151617181920from __future__ import annotations
from typing import Optionalfrom typing_extensions import Literal, Required, TypedDict
from .beta_request_document_block_param import BetaRequestDocumentBlockParam
__all__ = ["BetaWebFetchBlockParam"]
class BetaWebFetchBlockParam(TypedDict, total=False): content: Required[BetaRequestDocumentBlockParam]
type: Required[Literal["web_fetch_result"]]
url: Required[str] """Fetched content URL"""
retrieved_at: Optional[str] """ISO 8601 timestamp when the content was retrieved"""1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162from typing import List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_web_fetch_url_sources import BetaWebFetchURLSourcesfrom .beta_citations_config_param import BetaCitationsConfigParamfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaWebFetchTool20250910"]
class BetaWebFetchTool20250910(BaseModel): name: Literal["web_fetch"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["web_fetch_20250910"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
allowed_domains: Optional[List[str]] = None """List of domains to allow fetching from"""
blocked_domains: Optional[List[str]] = None """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParam] = None """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] = None """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] = None """Maximum number of times the tool can be used in the API request."""
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSources] = None """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364from __future__ import annotations
from typing import List, Optionalfrom typing_extensions import Literal, Required, TypedDict
from ..._types import SequenceNotStrfrom .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParamfrom .beta_citations_config_param_param import BetaCitationsConfigParamParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaWebFetchTool20250910Param"]
class BetaWebFetchTool20250910Param(TypedDict, total=False): name: Required[Literal["web_fetch"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["web_fetch_20250910"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
allowed_domains: Optional[SequenceNotStr[str]] """List of domains to allow fetching from"""
blocked_domains: Optional[SequenceNotStr[str]] """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParamParam] """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] """Maximum number of times the tool can be used in the API request."""
strict: bool """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSourcesParam] """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162from typing import List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_web_fetch_url_sources import BetaWebFetchURLSourcesfrom .beta_citations_config_param import BetaCitationsConfigParamfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaWebFetchTool20260209"]
class BetaWebFetchTool20260209(BaseModel): name: Literal["web_fetch"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["web_fetch_20260209"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
allowed_domains: Optional[List[str]] = None """List of domains to allow fetching from"""
blocked_domains: Optional[List[str]] = None """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParam] = None """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] = None """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] = None """Maximum number of times the tool can be used in the API request."""
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSources] = None """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364from __future__ import annotations
from typing import List, Optionalfrom typing_extensions import Literal, Required, TypedDict
from ..._types import SequenceNotStrfrom .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParamfrom .beta_citations_config_param_param import BetaCitationsConfigParamParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaWebFetchTool20260209Param"]
class BetaWebFetchTool20260209Param(TypedDict, total=False): name: Required[Literal["web_fetch"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["web_fetch_20260209"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
allowed_domains: Optional[SequenceNotStr[str]] """List of domains to allow fetching from"""
blocked_domains: Optional[SequenceNotStr[str]] """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParamParam] """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] """Maximum number of times the tool can be used in the API request."""
strict: bool """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSourcesParam] """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172from typing import List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_web_fetch_url_sources import BetaWebFetchURLSourcesfrom .beta_citations_config_param import BetaCitationsConfigParamfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaWebFetchTool20260309"]
class BetaWebFetchTool20260309(BaseModel): """Web fetch tool with use_cache parameter for bypassing cached content."""
name: Literal["web_fetch"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["web_fetch_20260309"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
allowed_domains: Optional[List[str]] = None """List of domains to allow fetching from"""
blocked_domains: Optional[List[str]] = None """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParam] = None """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] = None """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] = None """Maximum number of times the tool can be used in the API request."""
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSources] = None """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """
use_cache: Optional[bool] = None """Whether to use cached content.
Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources. """1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374from __future__ import annotations
from typing import List, Optionalfrom typing_extensions import Literal, Required, TypedDict
from ..._types import SequenceNotStrfrom .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParamfrom .beta_citations_config_param_param import BetaCitationsConfigParamParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaWebFetchTool20260309Param"]
class BetaWebFetchTool20260309Param(TypedDict, total=False): """Web fetch tool with use_cache parameter for bypassing cached content."""
name: Required[Literal["web_fetch"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["web_fetch_20260309"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
allowed_domains: Optional[SequenceNotStr[str]] """List of domains to allow fetching from"""
blocked_domains: Optional[SequenceNotStr[str]] """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParamParam] """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] """Maximum number of times the tool can be used in the API request."""
strict: bool """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSourcesParam] """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """
use_cache: bool """Whether to use cached content.
Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources. """1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980from typing import List, Optionalfrom typing_extensions import Literal
from ..._models import BaseModelfrom .beta_web_fetch_url_sources import BetaWebFetchURLSourcesfrom .beta_citations_config_param import BetaCitationsConfigParamfrom .beta_cache_control_ephemeral import BetaCacheControlEphemeral
__all__ = ["BetaWebFetchTool20260318"]
class BetaWebFetchTool20260318(BaseModel): name: Literal["web_fetch"] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Literal["web_fetch_20260318"]
allowed_callers: Optional[ List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] ] = None
allowed_domains: Optional[List[str]] = None """List of domains to allow fetching from"""
blocked_domains: Optional[List[str]] = None """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeral] = None """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParam] = None """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: Optional[bool] = None """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] = None """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] = None """Maximum number of times the tool can be used in the API request."""
response_inclusion: Optional[Literal["full", "excluded"]] = None """ How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn. """
strict: Optional[bool] = None """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSources] = None """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """
use_cache: Optional[bool] = None """Whether to use cached content.
Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources. """12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182from __future__ import annotations
from typing import List, Optionalfrom typing_extensions import Literal, Required, TypedDict
from ..._types import SequenceNotStrfrom .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParamfrom .beta_citations_config_param_param import BetaCitationsConfigParamParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
__all__ = ["BetaWebFetchTool20260318Param"]
class BetaWebFetchTool20260318Param(TypedDict, total=False): name: Required[Literal["web_fetch"]] """Name of the tool.
This is how the tool will be called by the model and in `tool_use` blocks. """
type: Required[Literal["web_fetch_20260318"]]
allowed_callers: List[ Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] ]
allowed_domains: Optional[SequenceNotStr[str]] """List of domains to allow fetching from"""
blocked_domains: Optional[SequenceNotStr[str]] """List of domains to block fetching from"""
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
citations: Optional[BetaCitationsConfigParamParam] """Citations configuration for fetched documents.
Citations are disabled by default. """
defer_loading: bool """If true, tool will not be included in initial system prompt.
Only loaded when returned via tool_reference from tool search. """
max_content_tokens: Optional[int] """Maximum number of tokens used by including web page text content in the context.
The limit is approximate and does not apply to binary content such as PDFs. """
max_uses: Optional[int] """Maximum number of times the tool can be used in the API request."""
response_inclusion: Literal["full", "excluded"] """ How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn. """
strict: bool """When true, guarantees schema validation on tool names and inputs"""
url_sources: Optional[BetaWebFetchURLSourcesParam] """Which sources contribute to the set of URLs the tool may fetch.
Omitted means every source. """
use_cache: bool """Whether to use cached content.
Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources. """123456789101112131415161718192021222324252627from typing import Union, Optionalfrom typing_extensions import Literal, Annotated, TypeAlias
from ..._models import BaseModel, UnionDiscriminatorfrom .beta_direct_caller import BetaDirectCallerfrom .beta_web_fetch_block import BetaWebFetchBlockfrom .beta_server_tool_caller import BetaServerToolCallerfrom .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120from .beta_web_fetch_tool_result_error_block import BetaWebFetchToolResultErrorBlock
__all__ = ["BetaWebFetchToolResultBlock", "Content", "Caller"]
Content: TypeAlias = Union[BetaWebFetchToolResultErrorBlock, BetaWebFetchBlock]
Caller: TypeAlias = Annotated[ Union[BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120], UnionDiscriminator("type")]
class BetaWebFetchToolResultBlock(BaseModel): content: Content
tool_use_id: str
type: Literal["web_fetch_tool_result"]
caller: Optional[Caller] = None123456789101112131415161718192021222324252627282930from __future__ import annotations
from typing import Union, Optionalfrom typing_extensions import Literal, Required, TypeAlias, TypedDict
from .beta_direct_caller_param import BetaDirectCallerParamfrom .beta_web_fetch_block_param import BetaWebFetchBlockParamfrom .beta_server_tool_caller_param import BetaServerToolCallerParamfrom .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParamfrom .beta_server_tool_caller_20260120_param import BetaServerToolCaller20260120Paramfrom .beta_web_fetch_tool_result_error_block_param import BetaWebFetchToolResultErrorBlockParam
__all__ = ["BetaWebFetchToolResultBlockParam", "Content", "Caller"]
Content: TypeAlias = Union[BetaWebFetchToolResultErrorBlockParam, BetaWebFetchBlockParam]
Caller: TypeAlias = Union[BetaDirectCallerParam, BetaServerToolCallerParam, BetaServerToolCaller20260120Param]
class BetaWebFetchToolResultBlockParam(TypedDict, total=False): content: Required[Content]
tool_use_id: Required[str]
type: Required[Literal["web_fetch_tool_result"]]
cache_control: Optional[BetaCacheControlEphemeralParam] """Create a cache control breakpoint at this content block."""
caller: Caller123456789101112from typing_extensions import Literal
from ..._models import BaseModelfrom .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode
__all__ = ["BetaWebFetchToolResultErrorBlock"]
class BetaWebFetchToolResultErrorBlock(BaseModel): error_code: BetaWebFetchToolResultErrorCode
type: Literal["web_fetch_tool_result_error"]12345678910111213from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
from .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode
__all__ = ["BetaWebFetchToolResultErrorBlockParam"]
class BetaWebFetchToolResultErrorBlockParam(TypedDict, total=False): error_code: Required[BetaWebFetchToolResultErrorCode]
type: Required[Literal["web_fetch_tool_result_error"]]12345678910111213141516from typing_extensions import Literal, TypeAlias
__all__ = ["BetaWebFetchToolResultErrorCode"]
BetaWebFetchToolResultErrorCode: TypeAlias = Literal[ "invalid_tool_input", "url_too_long", "url_not_allowed", "url_not_in_prior_context", "url_not_accessible", "unsupported_content_type", "too_many_requests", "max_uses_exceeded", "unavailable", "content_too_large",]1234567891011121314from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["BetaWebFetchURLSourceAll"]
class BetaWebFetchURLSourceAll(BaseModel): """ The ``url_sources`` variant under which a source contributes in full: every result of the tool filter's source, or all user input. """
type: Literal["all"]1234567891011121314from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["BetaWebFetchURLSourceAllParam"]
class BetaWebFetchURLSourceAllParam(TypedDict, total=False): """ The ``url_sources`` variant under which a source contributes in full: every result of the tool filter's source, or all user input. """
type: Required[Literal["all"]].venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_result_error_param.pyAdded+14
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block.pyAdded+13
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.pyAdded+14
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022.pyAdded+35
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022_param.pyAdded+36
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124.pyAdded+35
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124_param.pyAdded+36
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429.pyAdded+35
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429_param.pyAdded+36
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728.pyAdded+41
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728_param.pyAdded+42
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_union_param.pyAdded+66
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block.pyAdded+28
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block_param.pyAdded+31
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_caller.pyAdded+13
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_keep_param.pyAdded+11
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_trigger_param.pyAdded+11
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_toolset_tool_use_block.pyAdded+10
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel.pyAdded+35
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel_token.pyAdded+20
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network.pyAdded+12
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network_param.pyAdded+12
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_image_source_param.pyAdded+11
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_pdf_source_param.pyAdded+11
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_usage.pyAdded+81
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location.pyAdded+26
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location_param.pyAdded+26
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_message_param.pyAdded+13
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile.pyAdded+93
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_enrollment_url.pyAdded+21
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details.pyAdded+63
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details_params.pyAdded+64
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_trust_grant.pyAdded+14
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block.pyAdded+19
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block_param.pyAdded+20
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910.pyAdded+62
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910_param.pyAdded+64
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209.pyAdded+62
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209_param.pyAdded+64
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309.pyAdded+72
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309_param.pyAdded+74
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318.pyAdded+80
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318_param.pyAdded+82
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block.pyAdded+27
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block_param.pyAdded+30
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block.pyAdded+12
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.pyAdded+13
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_code.pyAdded+16
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all.pyAdded+14
.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all_param.pyAdded+14