diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_result_error_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_result_error_param.py new file mode 100644 index 0000000000000000000000000000000000000000..31ab435134a0ae1ba4f38b2471c3b0083e130720 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_result_error_param.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing import Optional +from 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] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block.py new file mode 100644 index 0000000000000000000000000000000000000000..e49eafb23a542f37d11d4d2ecdef434bb7c84300 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block.py @@ -0,0 +1,13 @@ +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_tool_reference_block import BetaToolReferenceBlock + +__all__ = ["BetaToolSearchToolSearchResultBlock"] + + +class BetaToolSearchToolSearchResultBlock(BaseModel): + tool_references: List[BetaToolReferenceBlock] + + type: Literal["tool_search_tool_search_result"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..aa28155c48799d0e240c9ccb39f0d5e4c482c932 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing import Iterable +from 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"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022.py new file mode 100644 index 0000000000000000000000000000000000000000..2fa6ac5e5fa5c540b6f067b496fc8d440d7e39a2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022.py @@ -0,0 +1,35 @@ +from typing import Dict, List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8af2a2388127696c58963ac628267b8adfccecd6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20241022_param.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +from typing import Dict, List, Iterable, Optional +from 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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124.py new file mode 100644 index 0000000000000000000000000000000000000000..7604f16d65a15398011a8caa87ccd4a6c80c491c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124.py @@ -0,0 +1,35 @@ +from typing import Dict, List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7d2c1f89fff79e94906415a62fb651b77718ac63 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250124_param.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +from typing import Dict, List, Iterable, Optional +from 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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429.py new file mode 100644 index 0000000000000000000000000000000000000000..fb2ed5dd08c95d70e6e7e5a3d9f7dee107058648 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429.py @@ -0,0 +1,35 @@ +from typing import Dict, List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429_param.py new file mode 100644 index 0000000000000000000000000000000000000000..33e2c7310c2defaa5cb57a1873ef4b3c97d932f0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250429_param.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +from typing import Dict, List, Iterable, Optional +from 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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728.py new file mode 100644 index 0000000000000000000000000000000000000000..236016ce29eb5f4429a546a42b7fc9facfd78655 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728.py @@ -0,0 +1,41 @@ +from typing import Dict, List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728_param.py new file mode 100644 index 0000000000000000000000000000000000000000..16bede5fe912eeb1a227151dec7c2cb7f542d878 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_text_editor_20250728_param.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import Dict, List, Iterable, Optional +from 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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_union_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_union_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8a82fb5a4048935e4c0fef28351500e99687bd18 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_union_param.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .beta_tool_param import BetaToolParam +from .beta_mcp_toolset_param import BetaMCPToolsetParam +from .beta_tool_bash_20241022_param import BetaToolBash20241022Param +from .beta_tool_bash_20250124_param import BetaToolBash20250124Param +from .beta_memory_tool_20250818_param import BetaMemoryTool20250818Param +from .beta_advisor_tool_20260301_param import BetaAdvisorTool20260301Param +from .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Param +from .beta_web_fetch_tool_20260209_param import BetaWebFetchTool20260209Param +from .beta_web_fetch_tool_20260309_param import BetaWebFetchTool20260309Param +from .beta_web_fetch_tool_20260318_param import BetaWebFetchTool20260318Param +from .beta_browser_toolset_20260801_param import BetaBrowserToolset20260801Param +from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param +from .beta_web_search_tool_20260209_param import BetaWebSearchTool20260209Param +from .beta_web_search_tool_20260318_param import BetaWebSearchTool20260318Param +from .beta_computer_toolset_20260801_param import BetaComputerToolset20260801Param +from .beta_tool_text_editor_20241022_param import BetaToolTextEditor20241022Param +from .beta_tool_text_editor_20250124_param import BetaToolTextEditor20250124Param +from .beta_tool_text_editor_20250429_param import BetaToolTextEditor20250429Param +from .beta_tool_text_editor_20250728_param import BetaToolTextEditor20250728Param +from .beta_tool_computer_use_20241022_param import BetaToolComputerUse20241022Param +from .beta_tool_computer_use_20250124_param import BetaToolComputerUse20250124Param +from .beta_tool_computer_use_20251124_param import BetaToolComputerUse20251124Param +from .beta_code_execution_tool_20250522_param import BetaCodeExecutionTool20250522Param +from .beta_code_execution_tool_20250825_param import BetaCodeExecutionTool20250825Param +from .beta_code_execution_tool_20260120_param import BetaCodeExecutionTool20260120Param +from .beta_code_execution_tool_20260521_param import BetaCodeExecutionTool20260521Param +from .beta_tool_search_tool_bm25_20251119_param import BetaToolSearchToolBm25_20251119Param +from .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, +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block.py new file mode 100644 index 0000000000000000000000000000000000000000..9a0ebf638357c1d395ea73494a57ab959daed9f0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block.py @@ -0,0 +1,28 @@ +from typing import Dict, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._models import BaseModel, UnionDiscriminator +from .beta_direct_caller import BetaDirectCaller +from .beta_server_tool_caller import BetaServerToolCaller +from .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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..80ec5f1d08ccb5f934bcf277ba1f485696cdbac6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_block_param.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .beta_direct_caller_param import BetaDirectCallerParam +from .beta_server_tool_caller_param import BetaServerToolCallerParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam +from .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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_caller.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_caller.py new file mode 100644 index 0000000000000000000000000000000000000000..0d58549db318bbe9c626ed61c385959cc90eafc2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_use_caller.py @@ -0,0 +1,13 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._models import UnionDiscriminator +from .beta_direct_caller import BetaDirectCaller +from .beta_server_tool_caller import BetaServerToolCaller +from .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120 + +__all__ = ["BetaToolUseCaller"] + +BetaToolUseCaller: TypeAlias = Annotated[ + Union[BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120], UnionDiscriminator("type") +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_keep_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_keep_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4041c829d67e434dc0b7884f7eea18e5c0552411 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_keep_param.py @@ -0,0 +1,11 @@ +from __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] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_trigger_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_trigger_param.py new file mode 100644 index 0000000000000000000000000000000000000000..d88993b5708d9791152731b7954a66e33da41648 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tool_uses_trigger_param.py @@ -0,0 +1,11 @@ +from __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] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_toolset_tool_use_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_toolset_tool_use_block.py new file mode 100644 index 0000000000000000000000000000000000000000..83ff8abf14819f281dafa59d4f49e2f4a72b9949 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_toolset_tool_use_block.py @@ -0,0 +1,10 @@ +from typing import Union +from typing_extensions import TypeAlias + +from .beta_tool_use_block import BetaToolUseBlock +from .beta_browser_tool_use_block import BetaBrowserToolUseBlock +from .beta_computer_tool_use_block import BetaComputerToolUseBlock + +__all__ = ["BetaToolsetToolUseBlock"] + +BetaToolsetToolUseBlock: TypeAlias = Union[BetaBrowserToolUseBlock, BetaComputerToolUseBlock, BetaToolUseBlock] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel.py new file mode 100644 index 0000000000000000000000000000000000000000..07aef4fd2fe1d0d7094296e355c1a6792c5cd5ae --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel.py @@ -0,0 +1,35 @@ +from typing import Optional +from datetime import datetime +from 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"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel_token.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel_token.py new file mode 100644 index 0000000000000000000000000000000000000000..4ae7828e4f6eeb451c993702fa326a064b5f3da0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_tunnel_token.py @@ -0,0 +1,20 @@ +from 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"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network.py new file mode 100644 index 0000000000000000000000000000000000000000..f9823a8916e50cce3c56716504cfd0ac5dd81a84 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaUnrestrictedNetwork"] + + +class BetaUnrestrictedNetwork(BaseModel): + """Unrestricted network access.""" + + type: Literal["unrestricted"] + """Network policy type""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network_param.py new file mode 100644 index 0000000000000000000000000000000000000000..edc84d8b60c5dc79871349dbdcf92d6e44f2ae9b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_unrestricted_network_param.py @@ -0,0 +1,12 @@ +from __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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_image_source_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_image_source_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cdf575b96c5993037688e30878bff7a477a35d2e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_image_source_param.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaURLImageSourceParam"] + + +class BetaURLImageSourceParam(TypedDict, total=False): + type: Required[Literal["url"]] + + url: Required[str] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_pdf_source_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_pdf_source_param.py new file mode 100644 index 0000000000000000000000000000000000000000..ee9b04e2c9d7d2e21a2f2649bb6135f5ff5222e8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_url_pdf_source_param.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaURLPDFSourceParam"] + + +class BetaURLPDFSourceParam(TypedDict, total=False): + type: Required[Literal["url"]] + + url: Required[str] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_usage.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_usage.py new file mode 100644 index 0000000000000000000000000000000000000000..658416f80076a9e76fa9e3afe4975ad4864057ba --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_usage.py @@ -0,0 +1,81 @@ +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_cache_creation import BetaCacheCreation +from .beta_iterations_usage import BetaIterationsUsage +from .beta_server_tool_usage import BetaServerToolUsage +from .beta_fallback_credit_usage import BetaFallbackCreditUsage +from .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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location.py new file mode 100644 index 0000000000000000000000000000000000000000..b87bda91d34f80e008d67fd79e4df894e936777e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location.py @@ -0,0 +1,26 @@ +from typing import Optional +from 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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a70317fc183f935942b4582d7de0c20f6e4af643 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_location_param.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +from typing import Optional +from 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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_message_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_message_param.py new file mode 100644 index 0000000000000000000000000000000000000000..561a55e538c585bea1827cb73f382914cc29f131 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_message_param.py @@ -0,0 +1,13 @@ +from __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"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..eedc86c0b26e35c85c4e1d96fb58e6b2c6e85f42 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile.py @@ -0,0 +1,93 @@ +from typing import Dict, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_user_profile_trust_grant import BetaUserProfileTrustGrant +from .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`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_enrollment_url.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_enrollment_url.py new file mode 100644 index 0000000000000000000000000000000000000000..95337ecb6da14480701246913ca0ef3ff9b20ac8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_enrollment_url.py @@ -0,0 +1,21 @@ +from datetime import datetime +from 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`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details.py new file mode 100644 index 0000000000000000000000000000000000000000..aae58476858e8c14b536dec26c1397648e407aac --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details.py @@ -0,0 +1,63 @@ +from typing import Optional +from datetime import datetime +from 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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details_params.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce350fd1fed1aaa57eae059d519072f70c94e5d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_external_user_details_params.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from typing import Union, Optional +from datetime import datetime +from 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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_trust_grant.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_trust_grant.py new file mode 100644 index 0000000000000000000000000000000000000000..79831f35822e076027781ae93f66f7123c1cc70b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_user_profile_trust_grant.py @@ -0,0 +1,14 @@ +from 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.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block.py new file mode 100644 index 0000000000000000000000000000000000000000..aeb8de690cb92a342a222d799c4d5cb13e6460f5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block.py @@ -0,0 +1,19 @@ +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..57916986d8ec80c2eced3c3af153bb382fe9c8c3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_block_param.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from typing import Optional +from 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""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910.py new file mode 100644 index 0000000000000000000000000000000000000000..12aaefc0ff108e755430cb3e8ed34484754e3448 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910.py @@ -0,0 +1,62 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_sources import BetaWebFetchURLSources +from .beta_citations_config_param import BetaCitationsConfigParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3bac51b139a0b2e22ee5716dd33f8082af99 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParam +from .beta_citations_config_param_param import BetaCitationsConfigParamParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209.py new file mode 100644 index 0000000000000000000000000000000000000000..1cc1465ef568ad4f26b3e08a6828b2b3b932fafd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209.py @@ -0,0 +1,62 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_sources import BetaWebFetchURLSources +from .beta_citations_config_param import BetaCitationsConfigParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209_param.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b884c3071389a6ce13841d04fabc2a0ddc910b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260209_param.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParam +from .beta_citations_config_param_param import BetaCitationsConfigParamParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309.py new file mode 100644 index 0000000000000000000000000000000000000000..51fc6f630710e67bd083638c805a4ef943161f0f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309.py @@ -0,0 +1,72 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_sources import BetaWebFetchURLSources +from .beta_citations_config_param import BetaCitationsConfigParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309_param.py new file mode 100644 index 0000000000000000000000000000000000000000..cb10f1415a3e42a3129b267129a40212dd6c9266 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260309_param.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParam +from .beta_citations_config_param_param import BetaCitationsConfigParamParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318.py new file mode 100644 index 0000000000000000000000000000000000000000..4342e63e469150867766647d1f4cb0298a83f97e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318.py @@ -0,0 +1,80 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_sources import BetaWebFetchURLSources +from .beta_citations_config_param import BetaCitationsConfigParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318_param.py new file mode 100644 index 0000000000000000000000000000000000000000..3bfb7fc4137087d5e84a2c2aac96b942326faf2d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_20260318_param.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_web_fetch_url_sources_param import BetaWebFetchURLSourcesParam +from .beta_citations_config_param_param import BetaCitationsConfigParamParam +from .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. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block.py new file mode 100644 index 0000000000000000000000000000000000000000..460a4a43d9b09c6e6d8c40a7190cc9faddf0a3a0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block.py @@ -0,0 +1,27 @@ +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._models import BaseModel, UnionDiscriminator +from .beta_direct_caller import BetaDirectCaller +from .beta_web_fetch_block import BetaWebFetchBlock +from .beta_server_tool_caller import BetaServerToolCaller +from .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120 +from .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] = None diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..939d75a24bd37c233c0083fe3fe96f51bcd07152 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .beta_direct_caller_param import BetaDirectCallerParam +from .beta_web_fetch_block_param import BetaWebFetchBlockParam +from .beta_server_tool_caller_param import BetaServerToolCallerParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam +from .beta_server_tool_caller_20260120_param import BetaServerToolCaller20260120Param +from .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: Caller diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py new file mode 100644 index 0000000000000000000000000000000000000000..eb74ca4902f3932400e4a526c4eaa0ce0bbe0d77 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_tool_result_error_code import BetaWebFetchToolResultErrorCode + +__all__ = ["BetaWebFetchToolResultErrorBlock"] + + +class BetaWebFetchToolResultErrorBlock(BaseModel): + error_code: BetaWebFetchToolResultErrorCode + + type: Literal["web_fetch_tool_result_error"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..01a3255a7a27312b47a133415ce018df0e187c6b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py @@ -0,0 +1,13 @@ +from __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"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py new file mode 100644 index 0000000000000000000000000000000000000000..abd5cf4d7816075c235024140422d2bd28a66409 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py @@ -0,0 +1,16 @@ +from 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", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all.py new file mode 100644 index 0000000000000000000000000000000000000000..d930109a5750a9559f11ef12ee4cfe46d4213122 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all.py @@ -0,0 +1,14 @@ +from 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"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all_param.py new file mode 100644 index 0000000000000000000000000000000000000000..48b83f9ff00159ea59b583600ddf542683697667 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_all_param.py @@ -0,0 +1,14 @@ +from __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"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except.py new file mode 100644 index 0000000000000000000000000000000000000000..c3ed0647d013c96c70fa596e65982cb25ff29386 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except.py @@ -0,0 +1,18 @@ +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_source_tool_reference import BetaWebFetchURLSourceToolReference + +__all__ = ["BetaWebFetchURLSourceExcept"] + + +class BetaWebFetchURLSourceExcept(BaseModel): + """ + The tool filter variant under which every result but the named + tools' contributes. + """ + + tools: List[BetaWebFetchURLSourceToolReference] + + type: Literal["except"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except_param.py new file mode 100644 index 0000000000000000000000000000000000000000..3a5291efe7361eb22de71a100a7fda19a5b145ea --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_except_param.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +from .beta_web_fetch_url_source_tool_reference_param import BetaWebFetchURLSourceToolReferenceParam + +__all__ = ["BetaWebFetchURLSourceExceptParam"] + + +class BetaWebFetchURLSourceExceptParam(TypedDict, total=False): + """ + The tool filter variant under which every result but the named + tools' contributes. + """ + + tools: Required[Iterable[BetaWebFetchURLSourceToolReferenceParam]] + + type: Required[Literal["except"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none.py new file mode 100644 index 0000000000000000000000000000000000000000..b9e35c4da0cb4e52ed396c60f92b433320a9e5b9 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebFetchURLSourceNone"] + + +class BetaWebFetchURLSourceNone(BaseModel): + """ + The ``url_sources`` variant under which a source contributes nothing: + no result of the tool filter's source, or no user input. + """ + + type: Literal["none"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none_param.py new file mode 100644 index 0000000000000000000000000000000000000000..7725c8f4d480868c67cb82718bf409a4725c739b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_none_param.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaWebFetchURLSourceNoneParam"] + + +class BetaWebFetchURLSourceNoneParam(TypedDict, total=False): + """ + The ``url_sources`` variant under which a source contributes nothing: + no result of the tool filter's source, or no user input. + """ + + type: Required[Literal["none"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only.py new file mode 100644 index 0000000000000000000000000000000000000000..a12d0ffb2918cbab14a4a2d9b87c442c83368f83 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only.py @@ -0,0 +1,18 @@ +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_fetch_url_source_tool_reference import BetaWebFetchURLSourceToolReference + +__all__ = ["BetaWebFetchURLSourceOnly"] + + +class BetaWebFetchURLSourceOnly(BaseModel): + """ + The tool filter variant under which only the named tools' results + contribute. + """ + + tools: List[BetaWebFetchURLSourceToolReference] + + type: Literal["only"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only_param.py new file mode 100644 index 0000000000000000000000000000000000000000..76c3225e8eebbf1179f52e401d48983700383f68 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_only_param.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +from .beta_web_fetch_url_source_tool_reference_param import BetaWebFetchURLSourceToolReferenceParam + +__all__ = ["BetaWebFetchURLSourceOnlyParam"] + + +class BetaWebFetchURLSourceOnlyParam(TypedDict, total=False): + """ + The tool filter variant under which only the named tools' results + contribute. + """ + + tools: Required[Iterable[BetaWebFetchURLSourceToolReferenceParam]] + + type: Required[Literal["only"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..a08d85b24c3263015a49e7ff7b407382c8cca2e1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebFetchURLSourceToolReference"] + + +class BetaWebFetchURLSourceToolReference(BaseModel): + """ + One entry of a tool filter's ``tools``: it must name a tool declared + in this request's ``tools[]``. + """ + + name: str + + type: Literal["tool_reference"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8770d1146d69761cd9ae56af7b2e0ad109fdb5b5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_source_tool_reference_param.py @@ -0,0 +1,16 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaWebFetchURLSourceToolReferenceParam"] + + +class BetaWebFetchURLSourceToolReferenceParam(TypedDict, total=False): + """ + One entry of a tool filter's ``tools``: it must name a tool declared + in this request's ``tools[]``. + """ + + name: Required[str] + + type: Required[Literal["tool_reference"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources.py new file mode 100644 index 0000000000000000000000000000000000000000..8d49b18997b562112ab5b0c7b59090905ae085ec --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources.py @@ -0,0 +1,48 @@ +from typing import Union, Optional +from typing_extensions import Annotated, TypeAlias + +from ..._models import BaseModel, UnionDiscriminator +from .beta_web_fetch_url_source_all import BetaWebFetchURLSourceAll +from .beta_web_fetch_url_source_none import BetaWebFetchURLSourceNone +from .beta_web_fetch_url_source_only import BetaWebFetchURLSourceOnly +from .beta_web_fetch_url_source_except import BetaWebFetchURLSourceExcept + +__all__ = ["BetaWebFetchURLSources", "ClientToolResults", "ServerToolResults", "UserInput"] + +ClientToolResults: TypeAlias = Annotated[ + Union[BetaWebFetchURLSourceAll, BetaWebFetchURLSourceNone, BetaWebFetchURLSourceOnly, BetaWebFetchURLSourceExcept], + UnionDiscriminator("type"), +] + +ServerToolResults: TypeAlias = Annotated[ + Union[BetaWebFetchURLSourceAll, BetaWebFetchURLSourceNone, BetaWebFetchURLSourceOnly, BetaWebFetchURLSourceExcept], + UnionDiscriminator("type"), +] + +UserInput: TypeAlias = Annotated[Union[BetaWebFetchURLSourceAll, BetaWebFetchURLSourceNone], UnionDiscriminator("type")] + + +class BetaWebFetchURLSources(BaseModel): + """Which sources contribute to the set of URLs web fetch may fetch. + + Each key is a tagged variant: ``user_input`` is ``all`` or ``none``; the + two tool filters are ``all``, ``none``, ``only`` (only the named tools' + results) or ``except`` (every result but the named tools'). A named tool + must be declared in this request's ``tools[]``. + """ + + client_tool_results: Optional[ClientToolResults] = None + """ + Which client tools' results contribute fetchable URLs: "all", "none", or an only + or except list of client tool names from tools[]. + """ + + server_tool_results: Optional[ServerToolResults] = None + """ + Which server tools' results contribute fetchable URLs: "all", "none", or an only + or except list of server tool names from tools[]; only web_search and web_fetch + results ever contribute. + """ + + user_input: Optional[UserInput] = None + """Whether URLs in user messages are fetchable: "all" or "none".""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources_param.py new file mode 100644 index 0000000000000000000000000000000000000000..794f45364085a56954fe513da5a36a470379eb68 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_fetch_url_sources_param.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias, TypedDict + +from .beta_web_fetch_url_source_all_param import BetaWebFetchURLSourceAllParam +from .beta_web_fetch_url_source_none_param import BetaWebFetchURLSourceNoneParam +from .beta_web_fetch_url_source_only_param import BetaWebFetchURLSourceOnlyParam +from .beta_web_fetch_url_source_except_param import BetaWebFetchURLSourceExceptParam + +__all__ = ["BetaWebFetchURLSourcesParam", "ClientToolResults", "ServerToolResults", "UserInput"] + +ClientToolResults: TypeAlias = Union[ + BetaWebFetchURLSourceAllParam, + BetaWebFetchURLSourceNoneParam, + BetaWebFetchURLSourceOnlyParam, + BetaWebFetchURLSourceExceptParam, +] + +ServerToolResults: TypeAlias = Union[ + BetaWebFetchURLSourceAllParam, + BetaWebFetchURLSourceNoneParam, + BetaWebFetchURLSourceOnlyParam, + BetaWebFetchURLSourceExceptParam, +] + +UserInput: TypeAlias = Union[BetaWebFetchURLSourceAllParam, BetaWebFetchURLSourceNoneParam] + + +class BetaWebFetchURLSourcesParam(TypedDict, total=False): + """Which sources contribute to the set of URLs web fetch may fetch. + + Each key is a tagged variant: ``user_input`` is ``all`` or ``none``; the + two tool filters are ``all``, ``none``, ``only`` (only the named tools' + results) or ``except`` (every result but the named tools'). A named tool + must be declared in this request's ``tools[]``. + """ + + client_tool_results: ClientToolResults + """ + Which client tools' results contribute fetchable URLs: "all", "none", or an only + or except list of client tool names from tools[]. + """ + + server_tool_results: ServerToolResults + """ + Which server tools' results contribute fetchable URLs: "all", "none", or an only + or except list of server tool names from tools[]; only web_search and web_fetch + results ever contribute. + """ + + user_input: UserInput + """Whether URLs in user messages are fetchable: "all" or "none".""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block.py new file mode 100644 index 0000000000000000000000000000000000000000..598068b8f8faf802f3bb925cda1930ec31b388b1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block.py @@ -0,0 +1,18 @@ +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebSearchResultBlock"] + + +class BetaWebSearchResultBlock(BaseModel): + encrypted_content: str + + page_age: Optional[str] = None + + title: str + + type: Literal["web_search_result"] + + url: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2e006b98e897ccf2d4bdcf4a40bba3735c3513d8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_result_block_param.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaWebSearchResultBlockParam"] + + +class BetaWebSearchResultBlockParam(TypedDict, total=False): + encrypted_content: Required[str] + + title: Required[str] + + type: Required[Literal["web_search_result"]] + + url: Required[str] + + page_age: Optional[str] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305.py new file mode 100644 index 0000000000000000000000000000000000000000..92f61bbd99963f5e0ce03b7ea0386aea53d76fc3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305.py @@ -0,0 +1,55 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_user_location import BetaUserLocation +from .beta_cache_control_ephemeral import BetaCacheControlEphemeral + +__all__ = ["BetaWebSearchTool20250305"] + + +class BetaWebSearchTool20250305(BaseModel): + name: Literal["web_search"] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Literal["web_search_20250305"] + + allowed_callers: Optional[ + List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] + ] = None + + allowed_domains: Optional[List[str]] = None + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[List[str]] = None + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocation] = None + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305_param.py new file mode 100644 index 0000000000000000000000000000000000000000..0577fecfd4a08d9267e5feeca12c7848c1656827 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20250305_param.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_user_location_param import BetaUserLocationParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam + +__all__ = ["BetaWebSearchTool20250305Param"] + + +class BetaWebSearchTool20250305Param(TypedDict, total=False): + name: Required[Literal["web_search"]] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Required[Literal["web_search_20250305"]] + + allowed_callers: List[ + Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] + ] + + allowed_domains: Optional[SequenceNotStr[str]] + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[SequenceNotStr[str]] + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocationParam] + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209.py new file mode 100644 index 0000000000000000000000000000000000000000..2150b974150e3856c836cff8ac7f0b6c49d74b80 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209.py @@ -0,0 +1,55 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_user_location import BetaUserLocation +from .beta_cache_control_ephemeral import BetaCacheControlEphemeral + +__all__ = ["BetaWebSearchTool20260209"] + + +class BetaWebSearchTool20260209(BaseModel): + name: Literal["web_search"] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Literal["web_search_20260209"] + + allowed_callers: Optional[ + List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] + ] = None + + allowed_domains: Optional[List[str]] = None + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[List[str]] = None + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocation] = None + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209_param.py new file mode 100644 index 0000000000000000000000000000000000000000..670cb19139991d4526eac1ea9e6808775668f334 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260209_param.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_user_location_param import BetaUserLocationParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam + +__all__ = ["BetaWebSearchTool20260209Param"] + + +class BetaWebSearchTool20260209Param(TypedDict, total=False): + name: Required[Literal["web_search"]] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Required[Literal["web_search_20260209"]] + + allowed_callers: List[ + Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] + ] + + allowed_domains: Optional[SequenceNotStr[str]] + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[SequenceNotStr[str]] + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocationParam] + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318.py new file mode 100644 index 0000000000000000000000000000000000000000..00c001c9a8c2e0ceba67314c0b539c4d842a4e8d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318.py @@ -0,0 +1,65 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_user_location import BetaUserLocation +from .beta_cache_control_ephemeral import BetaCacheControlEphemeral + +__all__ = ["BetaWebSearchTool20260318"] + + +class BetaWebSearchTool20260318(BaseModel): + name: Literal["web_search"] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Literal["web_search_20260318"] + + allowed_callers: Optional[ + List[Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"]] + ] = None + + allowed_domains: Optional[List[str]] = None + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[List[str]] = None + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocation] = None + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318_param.py new file mode 100644 index 0000000000000000000000000000000000000000..453b4fe5feccdac8f849ce082ffa7e6e5767f4f4 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_20260318_param.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr +from .beta_user_location_param import BetaUserLocationParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam + +__all__ = ["BetaWebSearchTool20260318Param"] + + +class BetaWebSearchTool20260318Param(TypedDict, total=False): + name: Required[Literal["web_search"]] + """Name of the tool. + + This is how the tool will be called by the model and in `tool_use` blocks. + """ + + type: Required[Literal["web_search_20260318"]] + + allowed_callers: List[ + Literal["direct", "code_execution_20250825", "code_execution_20260120", "code_execution_20260521"] + ] + + allowed_domains: Optional[SequenceNotStr[str]] + """If provided, only these domains will be included in results. + + Cannot be used alongside `blocked_domains`. + """ + + blocked_domains: Optional[SequenceNotStr[str]] + """If provided, these domains will never appear in results. + + Cannot be used alongside `allowed_domains`. + """ + + 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. + """ + + 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""" + + user_location: Optional[BetaUserLocationParam] + """Parameters for the user's location. + + Used to provide more relevant search results. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_request_error_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_request_error_param.py new file mode 100644 index 0000000000000000000000000000000000000000..000a70066ac470b077e1e41ad87e12f5ee8121dd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_request_error_param.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from .beta_web_search_tool_result_error_code import BetaWebSearchToolResultErrorCode + +__all__ = ["BetaWebSearchToolRequestErrorParam"] + + +class BetaWebSearchToolRequestErrorParam(TypedDict, total=False): + error_code: Required[BetaWebSearchToolResultErrorCode] + + type: Required[Literal["web_search_tool_result_error"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block.py new file mode 100644 index 0000000000000000000000000000000000000000..5418f28dbedda6f3d35ec744d24a05cee35d3aca --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block.py @@ -0,0 +1,24 @@ +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._models import BaseModel, UnionDiscriminator +from .beta_direct_caller import BetaDirectCaller +from .beta_server_tool_caller import BetaServerToolCaller +from .beta_server_tool_caller_20260120 import BetaServerToolCaller20260120 +from .beta_web_search_tool_result_block_content import BetaWebSearchToolResultBlockContent + +__all__ = ["BetaWebSearchToolResultBlock", "Caller"] + +Caller: TypeAlias = Annotated[ + Union[BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120], UnionDiscriminator("type") +] + + +class BetaWebSearchToolResultBlock(BaseModel): + content: BetaWebSearchToolResultBlockContent + + tool_use_id: str + + type: Literal["web_search_tool_result"] + + caller: Optional[Caller] = None diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_content.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_content.py new file mode 100644 index 0000000000000000000000000000000000000000..30e5ee5eaabac0b244c5c3b8b3438dcd8ace94bb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_content.py @@ -0,0 +1,9 @@ +from typing import List, Union +from typing_extensions import TypeAlias + +from .beta_web_search_result_block import BetaWebSearchResultBlock +from .beta_web_search_tool_result_error import BetaWebSearchToolResultError + +__all__ = ["BetaWebSearchToolResultBlockContent"] + +BetaWebSearchToolResultBlockContent: TypeAlias = Union[BetaWebSearchToolResultError, List[BetaWebSearchResultBlock]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..60ab8491de5d063872e68de139a55f45bcdf4441 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .beta_direct_caller_param import BetaDirectCallerParam +from .beta_server_tool_caller_param import BetaServerToolCallerParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam +from .beta_server_tool_caller_20260120_param import BetaServerToolCaller20260120Param +from .beta_web_search_tool_result_block_param_content_param import BetaWebSearchToolResultBlockParamContentParam + +__all__ = ["BetaWebSearchToolResultBlockParam", "Caller"] + +Caller: TypeAlias = Union[BetaDirectCallerParam, BetaServerToolCallerParam, BetaServerToolCaller20260120Param] + + +class BetaWebSearchToolResultBlockParam(TypedDict, total=False): + content: Required[BetaWebSearchToolResultBlockParamContentParam] + + tool_use_id: Required[str] + + type: Required[Literal["web_search_tool_result"]] + + cache_control: Optional[BetaCacheControlEphemeralParam] + """Create a cache control breakpoint at this content block.""" + + caller: Caller diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a49aec41c1ff6612d4eb6c862b81a332ff986e4f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import TypeAlias + +from .beta_web_search_result_block_param import BetaWebSearchResultBlockParam +from .beta_web_search_tool_request_error_param import BetaWebSearchToolRequestErrorParam + +__all__ = ["BetaWebSearchToolResultBlockParamContentParam"] + +BetaWebSearchToolResultBlockParamContentParam: TypeAlias = Union[ + Iterable[BetaWebSearchResultBlockParam], BetaWebSearchToolRequestErrorParam +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error.py new file mode 100644 index 0000000000000000000000000000000000000000..31bb9eb8fc4662afd5a146138324ca2b51dd08e1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_web_search_tool_result_error_code import BetaWebSearchToolResultErrorCode + +__all__ = ["BetaWebSearchToolResultError"] + + +class BetaWebSearchToolResultError(BaseModel): + error_code: BetaWebSearchToolResultErrorCode + + type: Literal["web_search_tool_result_error"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error_code.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error_code.py new file mode 100644 index 0000000000000000000000000000000000000000..4cc2020ffdd3e0aff7bc9b618dc7b6afec5fb385 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_web_search_tool_result_error_code.py @@ -0,0 +1,7 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaWebSearchToolResultErrorCode"] + +BetaWebSearchToolResultErrorCode: TypeAlias = Literal[ + "invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long", "request_too_large" +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..4fc3154cb4e08abb01547f8a49f6b51f1e46acf4 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookAgentArchivedEventData"] + + +class BetaWebhookAgentArchivedEventData(BaseModel): + id: str + """ID of the agent that triggered the event.""" + + organization_id: str + + type: Literal["agent.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..6d19f3da2a04acfd03fdedf5838017d885cc1ef6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookAgentCreatedEventData"] + + +class BetaWebhookAgentCreatedEventData(BaseModel): + id: str + """ID of the agent that triggered the event.""" + + organization_id: str + + type: Literal["agent.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..6aa452fe4eaad3a4005b3100f7842bc9910f6ea5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookAgentDeletedEventData"] + + +class BetaWebhookAgentDeletedEventData(BaseModel): + id: str + """ID of the agent that triggered the event.""" + + organization_id: str + + type: Literal["agent.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_updated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_updated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..8bd2d713bb0cf84197053489147f99a9b60c6ae7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_agent_updated_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookAgentUpdatedEventData"] + + +class BetaWebhookAgentUpdatedEventData(BaseModel): + id: str + """ID of the agent that triggered the event.""" + + organization_id: str + + type: Literal["agent.updated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..3320b63c1a9f8658c1ebcaa4f81956d394c484a0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentArchivedEventData"] + + +class BetaWebhookDeploymentArchivedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..c1682955c2d352879fe6e9c1edcf733ae56af2e1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentCreatedEventData"] + + +class BetaWebhookDeploymentCreatedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..26f39718fb664bae47349119b4153c5ca48cae1f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentDeletedEventData"] + + +class BetaWebhookDeploymentDeletedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_paused_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_paused_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..1bbe60a49e5bfdd3245bf047c4a8c5d6ee781beb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_paused_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentPausedEventData"] + + +class BetaWebhookDeploymentPausedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.paused"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_failed_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_failed_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..e0b13e92027c565cd64a85c6bb395308aad98d6c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_failed_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentRunFailedEventData"] + + +class BetaWebhookDeploymentRunFailedEventData(BaseModel): + id: str + """ID of the deployment run that triggered the event.""" + + organization_id: str + + type: Literal["deployment_run.failed"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_started_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_started_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..0b0a007cc5a92db2a91b47dde1f49b87c321af51 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_started_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentRunStartedEventData"] + + +class BetaWebhookDeploymentRunStartedEventData(BaseModel): + id: str + """ID of the deployment run that triggered the event.""" + + organization_id: str + + type: Literal["deployment_run.started"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_succeeded_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_succeeded_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..f5a23344cf581a549a978e7542f521f80d83327b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_run_succeeded_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentRunSucceededEventData"] + + +class BetaWebhookDeploymentRunSucceededEventData(BaseModel): + id: str + """ID of the deployment run that triggered the event.""" + + organization_id: str + + type: Literal["deployment_run.succeeded"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_unpaused_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_unpaused_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..410877e697be7e621083ac03e8cafbcd3ce5d0d3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_unpaused_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentUnpausedEventData"] + + +class BetaWebhookDeploymentUnpausedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.unpaused"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_updated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_updated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..74e78f12c51df339b3d7ab93d9823bbfbc4bdf44 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_deployment_updated_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookDeploymentUpdatedEventData"] + + +class BetaWebhookDeploymentUpdatedEventData(BaseModel): + id: str + """ID of the deployment that triggered the event.""" + + organization_id: str + + type: Literal["deployment.updated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..0bcee943a6b3f105072ae054de8ee13cb2c559ba --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookEnvironmentArchivedEventData"] + + +class BetaWebhookEnvironmentArchivedEventData(BaseModel): + id: str + """ID of the environment that triggered the event.""" + + organization_id: str + + type: Literal["environment.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..eda53fd8e1c5f14139b5afd98a6da60f39811456 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookEnvironmentCreatedEventData"] + + +class BetaWebhookEnvironmentCreatedEventData(BaseModel): + id: str + """ID of the environment that triggered the event.""" + + organization_id: str + + type: Literal["environment.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..98bfea8670887651248e2bf22ba756483f824245 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookEnvironmentDeletedEventData"] + + +class BetaWebhookEnvironmentDeletedEventData(BaseModel): + id: str + """ID of the environment that triggered the event.""" + + organization_id: str + + type: Literal["environment.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_updated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_updated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..99882a410648d05057fe3a782e381b0fb79b34d7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_environment_updated_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookEnvironmentUpdatedEventData"] + + +class BetaWebhookEnvironmentUpdatedEventData(BaseModel): + id: str + """ID of the environment that triggered the event.""" + + organization_id: str + + type: Literal["environment.updated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c902a2409540f242e04c5dee044bb1c5e48fbc4b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event.py @@ -0,0 +1,20 @@ +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .beta_webhook_event_data import BetaWebhookEventData + +__all__ = ["BetaWebhookEvent"] + + +class BetaWebhookEvent(BaseModel): + id: str + """Unique event identifier for idempotency.""" + + created_at: datetime + """RFC 3339 timestamp when the event occurred.""" + + data: BetaWebhookEventData + + type: Literal["event"] + """Object type. Always `event` for webhook payloads.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..fab17edcf60438e0cad28c575a79229a877f632f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_event_data.py @@ -0,0 +1,108 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._models import UnionDiscriminator +from .beta_webhook_agent_created_event_data import BetaWebhookAgentCreatedEventData +from .beta_webhook_agent_deleted_event_data import BetaWebhookAgentDeletedEventData +from .beta_webhook_agent_updated_event_data import BetaWebhookAgentUpdatedEventData +from .beta_webhook_session_idled_event_data import BetaWebhookSessionIdledEventData +from .beta_webhook_vault_created_event_data import BetaWebhookVaultCreatedEventData +from .beta_webhook_vault_deleted_event_data import BetaWebhookVaultDeletedEventData +from .beta_webhook_agent_archived_event_data import BetaWebhookAgentArchivedEventData +from .beta_webhook_vault_archived_event_data import BetaWebhookVaultArchivedEventData +from .beta_webhook_session_created_event_data import BetaWebhookSessionCreatedEventData +from .beta_webhook_session_deleted_event_data import BetaWebhookSessionDeletedEventData +from .beta_webhook_session_pending_event_data import BetaWebhookSessionPendingEventData +from .beta_webhook_session_running_event_data import BetaWebhookSessionRunningEventData +from .beta_webhook_session_updated_event_data import BetaWebhookSessionUpdatedEventData +from .beta_webhook_session_archived_event_data import BetaWebhookSessionArchivedEventData +from .beta_webhook_deployment_paused_event_data import BetaWebhookDeploymentPausedEventData +from .beta_webhook_deployment_created_event_data import BetaWebhookDeploymentCreatedEventData +from .beta_webhook_deployment_deleted_event_data import BetaWebhookDeploymentDeletedEventData +from .beta_webhook_deployment_updated_event_data import BetaWebhookDeploymentUpdatedEventData +from .beta_webhook_deployment_archived_event_data import BetaWebhookDeploymentArchivedEventData +from .beta_webhook_deployment_unpaused_event_data import BetaWebhookDeploymentUnpausedEventData +from .beta_webhook_environment_created_event_data import BetaWebhookEnvironmentCreatedEventData +from .beta_webhook_environment_deleted_event_data import BetaWebhookEnvironmentDeletedEventData +from .beta_webhook_environment_updated_event_data import BetaWebhookEnvironmentUpdatedEventData +from .beta_webhook_environment_archived_event_data import BetaWebhookEnvironmentArchivedEventData +from .beta_webhook_memory_store_created_event_data import BetaWebhookMemoryStoreCreatedEventData +from .beta_webhook_memory_store_deleted_event_data import BetaWebhookMemoryStoreDeletedEventData +from .beta_webhook_session_status_idled_event_data import BetaWebhookSessionStatusIdledEventData +from .beta_webhook_session_thread_idled_event_data import BetaWebhookSessionThreadIdledEventData +from .beta_webhook_deployment_run_failed_event_data import BetaWebhookDeploymentRunFailedEventData +from .beta_webhook_memory_store_archived_event_data import BetaWebhookMemoryStoreArchivedEventData +from .beta_webhook_deployment_run_started_event_data import BetaWebhookDeploymentRunStartedEventData +from .beta_webhook_session_budget_reached_event_data import BetaWebhookSessionBudgetReachedEventData +from .beta_webhook_session_thread_created_event_data import BetaWebhookSessionThreadCreatedEventData +from .beta_webhook_session_requires_action_event_data import BetaWebhookSessionRequiresActionEventData +from .beta_webhook_deployment_run_succeeded_event_data import BetaWebhookDeploymentRunSucceededEventData +from .beta_webhook_vault_credential_created_event_data import BetaWebhookVaultCredentialCreatedEventData +from .beta_webhook_vault_credential_deleted_event_data import BetaWebhookVaultCredentialDeletedEventData +from .beta_webhook_session_status_terminated_event_data import BetaWebhookSessionStatusTerminatedEventData +from .beta_webhook_session_thread_terminated_event_data import BetaWebhookSessionThreadTerminatedEventData +from .beta_webhook_vault_credential_archived_event_data import BetaWebhookVaultCredentialArchivedEventData +from .beta_webhook_session_status_rescheduled_event_data import BetaWebhookSessionStatusRescheduledEventData +from .beta_webhook_session_status_run_started_event_data import BetaWebhookSessionStatusRunStartedEventData +from .beta_webhook_vault_credential_refresh_failed_event_data import BetaWebhookVaultCredentialRefreshFailedEventData +from .beta_webhook_session_outcome_evaluation_ended_event_data import BetaWebhookSessionOutcomeEvaluationEndedEventData +from .beta_webhook_user_profile_enforcement_action_opened_event_data import ( + BetaWebhookUserProfileEnforcementActionOpenedEventData, +) +from .beta_webhook_user_profile_enforcement_action_resolved_event_data import ( + BetaWebhookUserProfileEnforcementActionResolvedEventData, +) + +__all__ = ["BetaWebhookEventData"] + +BetaWebhookEventData: TypeAlias = Annotated[ + Union[ + BetaWebhookSessionCreatedEventData, + BetaWebhookSessionPendingEventData, + BetaWebhookSessionRunningEventData, + BetaWebhookSessionIdledEventData, + BetaWebhookSessionRequiresActionEventData, + BetaWebhookSessionArchivedEventData, + BetaWebhookSessionDeletedEventData, + BetaWebhookSessionStatusRescheduledEventData, + BetaWebhookSessionStatusRunStartedEventData, + BetaWebhookSessionStatusIdledEventData, + BetaWebhookSessionStatusTerminatedEventData, + BetaWebhookSessionThreadCreatedEventData, + BetaWebhookSessionThreadIdledEventData, + BetaWebhookSessionThreadTerminatedEventData, + BetaWebhookSessionOutcomeEvaluationEndedEventData, + BetaWebhookVaultCreatedEventData, + BetaWebhookVaultArchivedEventData, + BetaWebhookVaultDeletedEventData, + BetaWebhookVaultCredentialCreatedEventData, + BetaWebhookVaultCredentialArchivedEventData, + BetaWebhookVaultCredentialDeletedEventData, + BetaWebhookVaultCredentialRefreshFailedEventData, + BetaWebhookSessionUpdatedEventData, + BetaWebhookAgentCreatedEventData, + BetaWebhookAgentArchivedEventData, + BetaWebhookAgentDeletedEventData, + BetaWebhookDeploymentPausedEventData, + BetaWebhookDeploymentRunFailedEventData, + BetaWebhookDeploymentCreatedEventData, + BetaWebhookDeploymentUpdatedEventData, + BetaWebhookDeploymentUnpausedEventData, + BetaWebhookAgentUpdatedEventData, + BetaWebhookDeploymentArchivedEventData, + BetaWebhookDeploymentRunStartedEventData, + BetaWebhookDeploymentDeletedEventData, + BetaWebhookDeploymentRunSucceededEventData, + BetaWebhookEnvironmentCreatedEventData, + BetaWebhookEnvironmentUpdatedEventData, + BetaWebhookEnvironmentArchivedEventData, + BetaWebhookEnvironmentDeletedEventData, + BetaWebhookMemoryStoreCreatedEventData, + BetaWebhookMemoryStoreArchivedEventData, + BetaWebhookMemoryStoreDeletedEventData, + BetaWebhookSessionBudgetReachedEventData, + BetaWebhookUserProfileEnforcementActionOpenedEventData, + BetaWebhookUserProfileEnforcementActionResolvedEventData, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..f08120f649ee52092480e3ec179477efe683ed07 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookMemoryStoreArchivedEventData"] + + +class BetaWebhookMemoryStoreArchivedEventData(BaseModel): + id: str + """ID of the memory store that triggered the event.""" + + organization_id: str + + type: Literal["memory_store.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..992db20ec7064a4bbe31af80b70dc1123f39db03 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookMemoryStoreCreatedEventData"] + + +class BetaWebhookMemoryStoreCreatedEventData(BaseModel): + id: str + """ID of the memory store that triggered the event.""" + + organization_id: str + + type: Literal["memory_store.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..4a7c20c401bc7bba242c3946ec27bcc7fbf65c1a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_memory_store_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookMemoryStoreDeletedEventData"] + + +class BetaWebhookMemoryStoreDeletedEventData(BaseModel): + id: str + """ID of the memory store that triggered the event.""" + + organization_id: str + + type: Literal["memory_store.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..30d28a7c835d938cb80c31249a2ee48b48788638 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionArchivedEventData"] + + +class BetaWebhookSessionArchivedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_budget_reached_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_budget_reached_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..01cfa6805d85d2ea5f7e6a6f2be4b046eaaf5e31 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_budget_reached_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionBudgetReachedEventData"] + + +class BetaWebhookSessionBudgetReachedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.budget_reached"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..cfb198280fc89a8271efd219a296c9f8c2ed016a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionCreatedEventData"] + + +class BetaWebhookSessionCreatedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..3af980789eaa600e0252a83d4078bc2b28e35d49 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionDeletedEventData"] + + +class BetaWebhookSessionDeletedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_idled_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_idled_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..dd451041c5d0a517abf41c5c78b9cc272d30a5ca --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_idled_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionIdledEventData"] + + +class BetaWebhookSessionIdledEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.idled"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_outcome_evaluation_ended_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_outcome_evaluation_ended_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..591918f2921545576cff199b03a828820fea37b8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_outcome_evaluation_ended_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionOutcomeEvaluationEndedEventData"] + + +class BetaWebhookSessionOutcomeEvaluationEndedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.outcome_evaluation_ended"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_pending_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_pending_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..7d54be974221f3c1f84f544905622235cdd55479 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_pending_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionPendingEventData"] + + +class BetaWebhookSessionPendingEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.pending"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_requires_action_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_requires_action_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..d514b367624750e724fb053bdf70d70d896bd50a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_requires_action_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionRequiresActionEventData"] + + +class BetaWebhookSessionRequiresActionEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.requires_action"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_running_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_running_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..1b2dcba1b3da021f4dab0928ae6315a7fa412426 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_running_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionRunningEventData"] + + +class BetaWebhookSessionRunningEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.running"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_idled_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_idled_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..bc6d26f101a54f32dbac37df66a8c0cfdb0fe574 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_idled_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionStatusIdledEventData"] + + +class BetaWebhookSessionStatusIdledEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.status_idled"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_rescheduled_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_rescheduled_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..2f41998cfa4c459bb1c506028da37a8c8832c69d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_rescheduled_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionStatusRescheduledEventData"] + + +class BetaWebhookSessionStatusRescheduledEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.status_rescheduled"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_run_started_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_run_started_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..a23bffabc7947b235d88c97b90cc3137afd668f8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_run_started_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionStatusRunStartedEventData"] + + +class BetaWebhookSessionStatusRunStartedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.status_run_started"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_terminated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_terminated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..accd2b07c01c50ee10ded770505de190f516af4e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_status_terminated_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionStatusTerminatedEventData"] + + +class BetaWebhookSessionStatusTerminatedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.status_terminated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..ecff0addfbbeb1358ab4b08f7c9b4a07c9a24ff0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_created_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionThreadCreatedEventData"] + + +class BetaWebhookSessionThreadCreatedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + session_thread_id: str + """ID of the session thread this event refers to.""" + + type: Literal["session.thread_created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_idled_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_idled_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..2e185cb79d9fc91e0c310ade571d7cd30c8a6818 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_idled_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionThreadIdledEventData"] + + +class BetaWebhookSessionThreadIdledEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + session_thread_id: str + """ID of the session thread this event refers to.""" + + type: Literal["session.thread_idled"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_terminated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_terminated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..82b8a4f38a9d907ade9a443c22a4d5dbe0590753 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_thread_terminated_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionThreadTerminatedEventData"] + + +class BetaWebhookSessionThreadTerminatedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + session_thread_id: str + """ID of the session thread this event refers to.""" + + type: Literal["session.thread_terminated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_updated_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_updated_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..b422e258a1b7123f7ee2d9750b923db4cba350a0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_session_updated_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookSessionUpdatedEventData"] + + +class BetaWebhookSessionUpdatedEventData(BaseModel): + id: str + """ID of the session that triggered the event.""" + + organization_id: str + + type: Literal["session.updated"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..e069a573c57a2dd99e16f8d7ba27f36e68023319 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookUserProfileEnforcementActionOpenedEventData"] + + +class BetaWebhookUserProfileEnforcementActionOpenedEventData(BaseModel): + id: str + """ID of the user profile the enforcement action is on.""" + + enforcement_action_id: str + """ID (`enac_...`) of the enforcement action that was opened or resolved.""" + + organization_id: str + + type: Literal["user_profile.enforcement_action_opened"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..192fdd2f3aa763dcf687e8a5f55b78a3ee52b7e1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookUserProfileEnforcementActionResolvedEventData"] + + +class BetaWebhookUserProfileEnforcementActionResolvedEventData(BaseModel): + id: str + """ID of the user profile the enforcement action is on.""" + + enforcement_action_id: str + """ID (`enac_...`) of the enforcement action that was opened or resolved.""" + + organization_id: str + + type: Literal["user_profile.enforcement_action_resolved"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..5af308b5daf6c27ec92bd3c57c596492b734ce91 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_archived_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultArchivedEventData"] + + +class BetaWebhookVaultArchivedEventData(BaseModel): + id: str + """ID of the vault that triggered the event.""" + + organization_id: str + + type: Literal["vault.archived"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..eea82976f1a8a09d0743c1939e76c94c18910417 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_created_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultCreatedEventData"] + + +class BetaWebhookVaultCreatedEventData(BaseModel): + id: str + """ID of the vault that triggered the event.""" + + organization_id: str + + type: Literal["vault.created"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_archived_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_archived_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..571c132f504b805d52f8e35f53387e8c6d13edb2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_archived_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultCredentialArchivedEventData"] + + +class BetaWebhookVaultCredentialArchivedEventData(BaseModel): + id: str + """ID of the vault credential that triggered the event.""" + + organization_id: str + + type: Literal["vault_credential.archived"] + + vault_id: str + """ID of the vault that owns this credential.""" + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_created_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_created_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..bd95c86bb8c89072ef2ea18497a941b5ac0392e0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_created_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultCredentialCreatedEventData"] + + +class BetaWebhookVaultCredentialCreatedEventData(BaseModel): + id: str + """ID of the vault credential that triggered the event.""" + + organization_id: str + + type: Literal["vault_credential.created"] + + vault_id: str + """ID of the vault that owns this credential.""" + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..c396ba4a6fecb8fc39ca44dbee44a5b756efc1f6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_deleted_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultCredentialDeletedEventData"] + + +class BetaWebhookVaultCredentialDeletedEventData(BaseModel): + id: str + """ID of the vault credential that triggered the event.""" + + organization_id: str + + type: Literal["vault_credential.deleted"] + + vault_id: str + """ID of the vault that owns this credential.""" + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_refresh_failed_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_refresh_failed_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..23b44f798bc469dcfc7917c681a496bf8784e486 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_credential_refresh_failed_event_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultCredentialRefreshFailedEventData"] + + +class BetaWebhookVaultCredentialRefreshFailedEventData(BaseModel): + id: str + """ID of the vault credential that triggered the event.""" + + organization_id: str + + type: Literal["vault_credential.refresh_failed"] + + vault_id: str + """ID of the vault that owns this credential.""" + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_deleted_event_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_deleted_event_data.py new file mode 100644 index 0000000000000000000000000000000000000000..7df59805905970b5fbb8fa8acad976020295d380 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/beta_webhook_vault_deleted_event_data.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BetaWebhookVaultDeletedEventData"] + + +class BetaWebhookVaultDeletedEventData(BaseModel): + id: str + """ID of the vault that triggered the event.""" + + organization_id: str + + type: Literal["vault.deleted"] + + workspace_id: str diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..eca43627e8bdc56959fc1511f543c9a6a08ee193 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_create_params.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_agent_params import BetaManagedAgentsAgentParams +from .beta_managed_agents_schedule_params import BetaManagedAgentsScheduleParams +from .beta_managed_agents_budget_limit_param import BetaManagedAgentsBudgetLimitParam +from .beta_managed_agents_file_resource_params import BetaManagedAgentsFileResourceParams +from .beta_managed_agents_memory_store_resource_param import BetaManagedAgentsMemoryStoreResourceParam +from .beta_managed_agents_deployment_initial_event_params import BetaManagedAgentsDeploymentInitialEventParams +from .beta_managed_agents_github_repository_resource_params import BetaManagedAgentsGitHubRepositoryResourceParams + +__all__ = ["DeploymentCreateParams", "Agent", "Resource"] + + +class DeploymentCreateParams(TypedDict, total=False): + agent: Required[Agent] + """Agent to deploy. + + Accepts the `agent` ID string, which pins the latest version, or an `agent` + object with both id and version specified. The agent must exist and not be + archived. + """ + + environment_id: Required[str] + """ + ID of the `environment` defining the container configuration for sessions + created from this deployment. + """ + + initial_events: Required[Iterable[BetaManagedAgentsDeploymentInitialEventParams]] + """Events to send to each session immediately after creation. + + At least 1, maximum 50. + """ + + name: Required[str] + """Human-readable name for the deployment.""" + + budget: Optional[BetaManagedAgentsBudgetLimitParam] + """ + Enforced spend ceiling stamped onto each session created from this deployment, + copied at session-creation time. Omit to leave sessions uncapped. The deployment + agent's model must have a public list price, or the request is rejected; a + multiagent roster is re-validated in full when each fire copies the cap, which + fails closed the same way. + """ + + description: Optional[str] + """Description of what the deployment does.""" + + metadata: Dict[str, str] + """Arbitrary key-value metadata. + + Maximum 16 pairs, keys up to 64 chars, values up to 512 chars. + """ + + resources: Iterable[Resource] + """Resources (e.g. + + repositories, files) to mount into each session's container. Maximum 500. + """ + + schedule: Optional[BetaManagedAgentsScheduleParams] + """Optional recurring cron schedule. + + When present, the deployment fires automatically. Both expression and timezone + are required when schedule is set. + """ + + vault_ids: SequenceNotStr[str] + """ + Vault IDs for stored credentials the agent can use during sessions created from + this deployment. Maximum 50. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Agent: TypeAlias = Union[str, BetaManagedAgentsAgentParams] + +Resource: TypeAlias = Union[ + BetaManagedAgentsGitHubRepositoryResourceParams, + BetaManagedAgentsFileResourceParams, + BetaManagedAgentsMemoryStoreResourceParam, +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..5be2b21ff44552994dd0abe08f8cb22c4f2ff56f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_list_params.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_deployment_status import BetaManagedAgentsDeploymentStatus + +__all__ = ["DeploymentListParams"] + + +class DeploymentListParams(TypedDict, total=False): + agent_id: str + """Filter by agent ID.""" + + created_at_gte: Union[str, datetime] + """Return deployments created at or after this time (inclusive).""" + + created_at_lte: Union[str, datetime] + """Return deployments created at or before this time (inclusive).""" + + include_archived: bool + """When true, includes archived deployments. Default: false (exclude archived).""" + + limit: int + """Maximum results per page. Default 20, maximum 100.""" + + page: str + """Opaque pagination cursor.""" + + status: BetaManagedAgentsDeploymentStatus + """Filter by status: `active` or `paused`. + + Omit for both. To include archived deployments, use `include_archived` instead; + the two cannot be combined. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_run_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_run_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..d55cc8c4af9145d84dfdd55451d73735f19be991 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_run_list_params.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_trigger_type import BetaManagedAgentsTriggerType + +__all__ = ["DeploymentRunListParams"] + + +class DeploymentRunListParams(TypedDict, total=False): + created_at_gt: Union[str, datetime] + """Return runs created strictly after this time (exclusive).""" + + created_at_gte: Union[str, datetime] + """Return runs created at or after this time (inclusive).""" + + created_at_lt: Union[str, datetime] + """Return runs created strictly before this time (exclusive).""" + + created_at_lte: Union[str, datetime] + """Return runs created at or before this time (inclusive).""" + + deployment_id: str + """Filter to a specific deployment. + + Omit to list across all deployments in the workspace. Filtering by a + non-existent `deployment_id` returns 200 with empty data. + """ + + has_error: bool + """ + Filter: true for runs with non-null `error`, false for runs with non-null + `session_id`. Omit for all. + """ + + limit: int + """Maximum results per page. Default 20, maximum 1000.""" + + page: str + """Opaque pagination cursor. + + Pass `next_page` from the previous response. Invalid or expired cursors + return 400. + """ + + trigger_type: BetaManagedAgentsTriggerType + """Filter runs by what triggered them. Omit to return all runs.""" + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..0c5fae21be37cf26cf5a75a287105d22703ec462 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/deployment_update_params.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_agent_params import BetaManagedAgentsAgentParams +from .beta_managed_agents_schedule_params import BetaManagedAgentsScheduleParams +from .beta_managed_agents_budget_limit_param import BetaManagedAgentsBudgetLimitParam +from .beta_managed_agents_file_resource_params import BetaManagedAgentsFileResourceParams +from .beta_managed_agents_memory_store_resource_param import BetaManagedAgentsMemoryStoreResourceParam +from .beta_managed_agents_deployment_initial_event_params import BetaManagedAgentsDeploymentInitialEventParams +from .beta_managed_agents_github_repository_resource_params import BetaManagedAgentsGitHubRepositoryResourceParams + +__all__ = ["DeploymentUpdateParams", "Agent", "Resource"] + + +class DeploymentUpdateParams(TypedDict, total=False): + agent: Agent + """Agent to deploy. + + Accepts the `agent` ID string, which re-pins to the latest version, or an + `agent` object with both id and version specified. Omit to preserve. Cannot be + cleared. + """ + + budget: Optional[BetaManagedAgentsBudgetLimitParam] + """Spend ceiling for future sessions. + + Full replacement. Omit to preserve; send null to clear (sessions created + afterwards are uncapped). The deployment agent's model must have a public list + price, or the request is rejected; a multiagent roster is re-validated in full + when each fire copies the cap, which fails closed the same way. + """ + + description: Optional[str] + """Description. Omit to preserve; send empty string or null to clear.""" + + environment_id: str + """ID of the `environment` where sessions run. + + Omit to preserve. Cannot be cleared. + """ + + initial_events: Iterable[BetaManagedAgentsDeploymentInitialEventParams] + """Initial events. + + Full replacement. Omit to preserve. Cannot be cleared. At least 1, maximum 50. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """Metadata patch. + + Set a key to a string to upsert it, or to null to delete it. Omit the field to + preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values + up to 512 chars. + """ + + name: str + """Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.""" + + resources: Optional[Iterable[Resource]] + """Session resources. + + Full replacement. Omit to preserve; send empty array or null to clear. + Maximum 500. + """ + + schedule: Optional[BetaManagedAgentsScheduleParams] + """Cron schedule. + + Full replacement. Omit to preserve; send null to clear (revert to manual-only). + """ + + vault_ids: Optional[SequenceNotStr[str]] + """Vault IDs. + + Full replacement. Omit to preserve; send empty array or null to clear. + Maximum 50. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Agent: TypeAlias = Union[str, BetaManagedAgentsAgentParams] + +Resource: TypeAlias = Union[ + BetaManagedAgentsGitHubRepositoryResourceParams, + BetaManagedAgentsFileResourceParams, + BetaManagedAgentsMemoryStoreResourceParam, +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..2d54bee0bac88df3c3a0647920d803437d017588 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_create_params.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from typing import List, Union, Iterable, Optional +from typing_extensions import Required, TypeAlias, TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_dream_input_param import BetaDreamInputParam +from .beta_output_behavior_param import BetaOutputBehaviorParam +from .beta_dream_model_config_param import BetaDreamModelConfigParam + +__all__ = ["DreamCreateParams", "Model"] + + +class DreamCreateParams(TypedDict, total=False): + inputs: Required[Iterable[BetaDreamInputParam]] + """ + The memory store and sessions for the dream to read, as exactly one + `memory_store` entry and exactly one `sessions` entry. + """ + + model: Required[Model] + """ + The model that runs a dream, given as a model ID or as an object with `id` and + `speed`. + + In the object form, `speed` can only be `standard`. + + The + [Availability section of the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#feature-availability) + lists the supported models. + """ + + instructions: Optional[str] + """ + Guidance that steers how the dream reads the sessions and organizes the output + memory store, from 1 to 4,096 characters. + + See the + [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#steer-with-instructions) + for what kinds of instructions work well. + """ + + output_behavior: BetaOutputBehaviorParam + """Which memory store a dream writes its result to. + + Defaults to `create_new` when left out of a create request. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `dreaming-2026-04-21` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Model: TypeAlias = Union[str, BetaDreamModelConfigParam] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a8c4509f34d3e5db28e4d3ce38613027ac0e6be5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/dream_list_params.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import TypedDict + +from .beta_dream_status import BetaDreamStatus +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["DreamListParams"] + + +class DreamListParams(TypedDict, total=False): + created_at_gt: Union[str, datetime] + """Return only dreams created after this time (exclusive), in RFC 3339.""" + + created_at_lt: Union[str, datetime] + """Return only dreams created before this time (exclusive), in RFC 3339.""" + + include_archived: bool + """Whether to include archived dreams. Defaults to `false`.""" + + limit: int + """The maximum number of dreams to return, from 1 to 100. Defaults to 20.""" + + page: str + """ + The cursor for the page to return, taken from `next_page` in a previous + response. + + Leave it out to get the first page. + """ + + statuses: List[BetaDreamStatus] + """Return only dreams that have one of these statuses. + + Repeat the parameter to give more than one status. Leave it out to return dreams + of every status. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `dreaming-2026-04-21` in this + header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..131a9c06572d9a80069f62536d78fb2a396ca285 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_create_params.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_cloud_config_params import BetaCloudConfigParams +from .beta_self_hosted_config_params import BetaSelfHostedConfigParams + +__all__ = ["EnvironmentCreateParams", "Config"] + + +class EnvironmentCreateParams(TypedDict, total=False): + name: Required[str] + """Human-readable name for the environment""" + + config: Optional[Config] + """Environment configuration""" + + description: Optional[str] + """Optional description of the environment""" + + metadata: Dict[str, str] + """User-provided metadata key-value pairs""" + + scope: Optional[Literal["organization", "account"]] + """The visibility scope for this environment. + + 'organization' makes the environment visible to all accounts. 'account' + restricts visibility to the owning account only. API organizations support only + 'organization'; 'account' is rejected. If not specified, defaults based on + organization type. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Config: TypeAlias = Union[BetaCloudConfigParams, BetaSelfHostedConfigParams] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..cfb86235b731d312019c4b440b6d86b0b3b11a15 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_list_params.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["EnvironmentListParams"] + + +class EnvironmentListParams(TypedDict, total=False): + include_archived: bool + """Include archived environments in the response""" + + limit: int + """Maximum number of environments to return""" + + page: Optional[str] + """Opaque cursor from previous response for pagination. + + Pass the `next_page` value from the previous response. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..0abb67c85d47b8cfbe8f78dae0c7be9e68891721 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environment_update_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias, TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_cloud_config_params import BetaCloudConfigParams +from .beta_self_hosted_config_params import BetaSelfHostedConfigParams + +__all__ = ["EnvironmentUpdateParams", "Config"] + + +class EnvironmentUpdateParams(TypedDict, total=False): + config: Optional[Config] + """Updated environment configuration""" + + description: Optional[str] + """Updated description of the environment. + + Omit to preserve; null clears to null; an empty string is stored as an empty + string. + """ + + metadata: Dict[str, Optional[str]] + """User-provided metadata key-value pairs. + + Set a value to null or empty string to delete the key. + """ + + name: Optional[str] + """Updated name for the environment""" + + scope: Optional[Literal["organization", "account"]] + """The visibility scope for this environment. + + 'organization' makes the environment visible to all accounts. 'account' + restricts visibility to the owning account only. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Config: TypeAlias = Union[BetaCloudConfigParams, BetaSelfHostedConfigParams] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..20ecb5a1b3eac0fc0907cdf9cf3636ef4097ec8f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/__init__.py @@ -0,0 +1,21 @@ +from __future__ import annotations + +from .work_list_params import WorkListParams as WorkListParams +from .work_poll_params import WorkPollParams as WorkPollParams +from .work_stop_params import WorkStopParams as WorkStopParams +from .work_update_params import WorkUpdateParams as WorkUpdateParams +from .beta_self_hosted_work import BetaSelfHostedWork as BetaSelfHostedWork +from .beta_work_lease_state import BetaWorkLeaseState as BetaWorkLeaseState +from .work_heartbeat_params import WorkHeartbeatParams as WorkHeartbeatParams +from .beta_session_work_data import BetaSessionWorkData as BetaSessionWorkData +from .beta_self_hosted_work_queue_stats import BetaSelfHostedWorkQueueStats as BetaSelfHostedWorkQueueStats +from .beta_self_hosted_work_list_response import BetaSelfHostedWorkListResponse as BetaSelfHostedWorkListResponse +from .beta_heartbeat_precondition_failed_error import ( + BetaHeartbeatPreconditionFailedError as BetaHeartbeatPreconditionFailedError, +) +from .beta_self_hosted_work_heartbeat_response import ( + BetaSelfHostedWorkHeartbeatResponse as BetaSelfHostedWorkHeartbeatResponse, +) +from .beta_heartbeat_precondition_failed_error_details import ( + BetaHeartbeatPreconditionFailedErrorDetails as BetaHeartbeatPreconditionFailedErrorDetails, +) diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error.py new file mode 100644 index 0000000000000000000000000000000000000000..69fe1a92050f07a57719d284428b721948bbf02a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PreconditionFailedError +from .beta_heartbeat_precondition_failed_error_details import BetaHeartbeatPreconditionFailedErrorDetails + +__all__ = ["BetaHeartbeatPreconditionFailedError"] + + +class BetaHeartbeatPreconditionFailedError(PreconditionFailedError): + """ + `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease. + """ + + error_code: Literal["heartbeat_precondition_failed"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaHeartbeatPreconditionFailedErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..bc119d3055b945d6e0c15588db23b040df98bb84 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_heartbeat_precondition_failed_error_details.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_work_lease_state import BetaWorkLeaseState + +__all__ = ["BetaHeartbeatPreconditionFailedErrorDetails"] + + +class BetaHeartbeatPreconditionFailedErrorDetails(BaseModel): + """ + `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease. + """ + + current_state: BetaWorkLeaseState + """The lease as the server holds it.""" + + error_code: Literal["heartbeat_precondition_failed"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work.py new file mode 100644 index 0000000000000000000000000000000000000000..3b65fbb8fa3e3bc776108b87531f59689d59cbe0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work.py @@ -0,0 +1,61 @@ +from typing import Dict, Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_session_work_data import BetaSessionWorkData + +__all__ = ["BetaSelfHostedWork"] + + +class BetaSelfHostedWork(BaseModel): + """Work resource representing a unit of work in a self-hosted environment. + + Work items are queued when sessions are created or when long-dormant sessions + receive new messages. The environment worker polls for work to execute in a + self-hosted sandbox. + """ + + id: str + """Work identifier (e.g., 'work_...')""" + + acknowledged_at: Optional[str] = None + """ + RFC 3339 timestamp when the work item was acknowledged and assigned to a + self-hosted sandbox + """ + + created_at: str + """RFC 3339 timestamp when work was created""" + + data: BetaSessionWorkData + """The actual work to be performed""" + + environment_id: str + """Environment identifier this work belongs to (e.g., `env_...`)""" + + latest_heartbeat_at: Optional[str] = None + """RFC 3339 timestamp of the most recent heartbeat""" + + metadata: Dict[str, str] + """User-provided metadata key-value pairs associated with this work item""" + + secret: Optional[str] = None + """Credential payload used by the environment worker to execute this work item. + + May be populated when polling for work; null on all other retrieval paths. + """ + + started_at: Optional[str] = None + """RFC 3339 timestamp when work execution started""" + + state: Literal["queued", "starting", "active", "stopping", "stopped"] + """Current state of the work item""" + + stop_requested_at: Optional[str] = None + """RFC 3339 timestamp when stop was requested""" + + stopped_at: Optional[str] = None + """RFC 3339 timestamp when work execution stopped""" + + type: Literal["work"] + """The type of object (always 'work')""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_heartbeat_response.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_heartbeat_response.py new file mode 100644 index 0000000000000000000000000000000000000000..b394a2ceb26eb1fef13a1fe8c7276254522ab216 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_heartbeat_response.py @@ -0,0 +1,27 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaSelfHostedWorkHeartbeatResponse"] + + +class BetaSelfHostedWorkHeartbeatResponse(BaseModel): + """Response after recording a heartbeat for a work item.""" + + last_heartbeat: str + """ + RFC 3339 timestamp of the most recent heartbeat recorded for this work item, or + an empty string if none has been recorded + """ + + lease_extended: bool + """Whether the heartbeat succeeded in extending the lease""" + + state: Literal["queued", "starting", "active", "stopping", "stopped"] + """Current state of the work item (active/stopping/stopped)""" + + ttl_seconds: int + """Effective TTL applied to the lease""" + + type: Literal["work_heartbeat"] + """The type of response""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_list_response.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_list_response.py new file mode 100644 index 0000000000000000000000000000000000000000..10302c31113bd2f2fbbcc9c68f802f7f000fa712 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_list_response.py @@ -0,0 +1,16 @@ +from typing import List, Optional + +from ...._models import BaseModel +from .beta_self_hosted_work import BetaSelfHostedWork + +__all__ = ["BetaSelfHostedWorkListResponse"] + + +class BetaSelfHostedWorkListResponse(BaseModel): + """Response when listing work items with cursor-based pagination.""" + + data: List[BetaSelfHostedWork] + """List of work items""" + + next_page: Optional[str] = None + """Opaque cursor for fetching the next page of results""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_queue_stats.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_queue_stats.py new file mode 100644 index 0000000000000000000000000000000000000000..82bcf58a4cbfbc697620b8692f56d7b186c8c07a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_self_hosted_work_queue_stats.py @@ -0,0 +1,31 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaSelfHostedWorkQueueStats"] + + +class BetaSelfHostedWorkQueueStats(BaseModel): + """Statistics about the work queue for an environment.""" + + depth: int + """Number of work items waiting to be picked up""" + + oldest_queued_at: Optional[str] = None + """ + RFC 3339 timestamp of oldest item in the work stream (includes both queued and + pending items), null if stream empty + """ + + pending: int + """Number of work items being processed (polled but not acknowledged)""" + + type: Literal["work_queue_stats"] + """The type of object""" + + workers_polling: Optional[int] = None + """Number of workers that have polled for work in the last 30 seconds. + + Requires worker_id to be sent with poll requests. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_session_work_data.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_session_work_data.py new file mode 100644 index 0000000000000000000000000000000000000000..82740b07ede7b55b89819cd621da31811a468f36 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_session_work_data.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaSessionWorkData"] + + +class BetaSessionWorkData(BaseModel): + """Work data for session work items. + + This resource type is used when work represents a session that needs to be executed + in a self-hosted environment. + """ + + id: str + """Session identifier (e.g., 'session_...')""" + + type: Literal["session"] + """Type of work data""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_work_lease_state.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_work_lease_state.py new file mode 100644 index 0000000000000000000000000000000000000000..ecaca9150ed6bde4235a8c0de0ca34d10472d150 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/beta_work_lease_state.py @@ -0,0 +1,22 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaWorkLeaseState"] + + +class BetaWorkLeaseState(BaseModel): + """A work item's lease as the server holds it.""" + + last_heartbeat: Optional[str] = None + """RFC 3339 timestamp of the stored heartbeat, or null if there has been none""" + + lease_extended: bool + """Always false: a refused heartbeat does not extend the lease""" + + state: Literal["queued", "starting", "active", "stopping", "stopped"] + """Current state of the work item""" + + ttl_seconds: int + """TTL of the lease""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_heartbeat_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_heartbeat_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b7e32b4df76038a0f02cbc02c3cb5db63e3f341c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_heartbeat_params.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["WorkHeartbeatParams"] + + +class WorkHeartbeatParams(TypedDict, total=False): + environment_id: Required[str] + + desired_ttl_seconds: Optional[int] + """Desired TTL in seconds""" + + expected_last_heartbeat: Optional[str] + """Expected last_heartbeat for conditional update (optimistic concurrency). + + Use literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For + subsequent heartbeats, echo the server's previous last_heartbeat value exactly. + Returns 412 Precondition Failed if the actual value doesn't match. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a5410784f02780dbb80f41add7189cb7c66bca94 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_list_params.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["WorkListParams"] + + +class WorkListParams(TypedDict, total=False): + limit: int + """Maximum number of work items to return""" + + page: Optional[str] + """Opaque cursor from previous response for pagination""" + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_poll_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_poll_params.py new file mode 100644 index 0000000000000000000000000000000000000000..1d8552ec9d28e2a84fa099f4a6dc9a93b2af1d5b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_poll_params.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["WorkPollParams"] + + +class WorkPollParams(TypedDict, total=False): + block_ms: Optional[int] + """How long to wait for work to arrive before returning. + + Must be 1-999 in milliseconds. Defaults to non-blocking (returns immediately if + no work is available). + """ + + reclaim_older_than_ms: Optional[int] + """Reclaim unacknowledged work items older than this many milliseconds. + + If omitted, uses the default (5000ms). + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + anthropic_worker_id: str + """ + Unique identifier for the specific worker polling, used to track aggregated + environment-level work metrics in Console + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_stop_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_stop_params.py new file mode 100644 index 0000000000000000000000000000000000000000..e822d166e2d82680429c262046c5688bae82d2ec --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_stop_params.py @@ -0,0 +1,28 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["WorkStopParams"] + + +class WorkStopParams(TypedDict, total=False): + environment_id: Required[str] + + force: bool + """If true, immediately stop work without graceful shutdown""" + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..59d3073a5efe739a2ae476aa35e701d4967ed9cc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/environments/work_update_params.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from typing import Dict, List, Optional +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["WorkUpdateParams"] + + +class WorkUpdateParams(TypedDict, total=False): + environment_id: Required[str] + + metadata: Required[Dict[str, Optional[str]]] + """Metadata patch. + + Set a key to a string to upsert it, or to null to delete it. Omit the field to + preserve existing metadata. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..1ffc9ff7786f65560debc695da6dfdba81929ad1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_list_params.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import TypedDict + +from ..._types import SequenceNotStr +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["FileListParams"] + + +class FileListParams(TypedDict, total=False): + ids: Optional[SequenceNotStr[str]] + """Restrict the result set to Files whose `id` is in this list. + + At most 100 entries (after de-duplication). Mutually exclusive with `page` and + `limit`. When supplied, the response is always a single page (`next_page` is + null). IDs that do not resolve to a visible File — including deleted Files — are + silently omitted. + """ + + limit: int + """Number of items to return per page. + + Defaults to `20`. Ranges from `1` to `1000`. + """ + + page: Optional[str] + """Opaque page cursor returned in a prior list response's `next_page`. + + Prefixed `page_`. + """ + + scope_id: str + """Filter by scope ID. + + Only returns files associated with the specified scope (e.g., a session ID). + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_upload_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_upload_params.py new file mode 100644 index 0000000000000000000000000000000000000000..d4cfbc6242df03cd7ac345e45af682f69555366d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/file_upload_params.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ..._types import FileTypes +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["FileUploadParams"] + + +class FileUploadParams(TypedDict, total=False): + file: Required[FileTypes] + """The file to upload. + + Only the final path component of the part's `filename` is kept; an absent or + empty `filename` is replaced with `unnamed` plus the extension for the file's + stored `mime_type`, when known. + """ + + expires_in_seconds: int + """ + Seconds from upload until the file expires and its bytes become permanently + unavailable. Must be between 3600 (one hour) and 7776000 (ninety days). + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..76cf80b73089bb0f2664463c9d783aed614711a5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_create_params.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from typing import Dict, List +from typing_extensions import Required, TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["MemoryStoreCreateParams"] + + +class MemoryStoreCreateParams(TypedDict, total=False): + name: Required[str] + """ + The name of the memory store, 1 to 255 characters long, without control + characters. Names don't have to be unique in a workspace. + + In a session, the store's directory under `/mnt/memory/` is based on this name. + The name is lowercased and every run of characters other than ASCII letters and + digits becomes one hyphen. The session's memory store resource gives the exact + path in `mount_path`. + + See the + [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#how-the-agent-accesses-memory) + to learn more about how agents access memory stores. + """ + + description: str + """Free-text description of what the store contains, up to 1,024 characters. + + Included in the agent's system prompt when the store is attached, so word it to + be useful to the agent. + """ + + metadata: Dict[str, str] + """Key-value pairs for your own use, such as the end user that the store belongs + to. + + The agent doesn't see them. + + A store has at most 16 pairs. Keys are 1 to 64 characters long and values at + most 512 characters. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b77f76abc8c760c08a851977270da873bf13c87a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_list_params.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["MemoryStoreListParams"] + + +class MemoryStoreListParams(TypedDict, total=False): + created_at_gte: Union[str, datetime] + """Return only memory stores created at or after this time (inclusive).""" + + created_at_lte: Union[str, datetime] + """Return only memory stores created at or before this time (inclusive).""" + + include_archived: bool + """When `true`, archived stores are included in the results. + + Defaults to `false` (archived stores are excluded). + """ + + limit: int + """Maximum number of stores to return per page. + + Must be between 1 and 100. Defaults to 20 when omitted. + """ + + page: str + """The `next_page` value from a previous response, to get the next page. + + Omit it to get the first page. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..6a8aceddbcb2f96aabbf7aa7dac7aaad457a196f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_store_update_params.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from typing import Dict, List, Optional +from typing_extensions import TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["MemoryStoreUpdateParams"] + + +class MemoryStoreUpdateParams(TypedDict, total=False): + description: Optional[str] + """New description for the store, up to 1,024 characters. + + Pass an empty string to clear it. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """Changes to apply to the memory store's metadata. + + Keys you leave out keep their values. + + Set a key to a string to add or replace it, or to `null` to remove it. After the + change, the metadata can hold at most 16 key-value pairs. Keys are 1 to 64 + characters long and values at most 512 characters. + """ + + name: Optional[str] + """ + The new name of the memory store, 1 to 255 characters long, without control + characters. + + Sessions created after the change use the new name for the store's directory + under `/mnt/memory/`. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..17eb4bea8ac06089d29bc5f2e8c55cfd42531639 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/__init__.py @@ -0,0 +1,28 @@ +from __future__ import annotations + +from .memory_list_params import MemoryListParams as MemoryListParams +from .memory_create_params import MemoryCreateParams as MemoryCreateParams +from .memory_delete_params import MemoryDeleteParams as MemoryDeleteParams +from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams +from .memory_retrieve_params import MemoryRetrieveParams as MemoryRetrieveParams +from .beta_managed_agents_actor import BetaManagedAgentsActor as BetaManagedAgentsActor +from .beta_managed_agents_memory import BetaManagedAgentsMemory as BetaManagedAgentsMemory +from .memory_version_list_params import MemoryVersionListParams as MemoryVersionListParams +from .beta_managed_agents_api_actor import BetaManagedAgentsAPIActor as BetaManagedAgentsAPIActor +from .beta_managed_agents_user_actor import BetaManagedAgentsUserActor as BetaManagedAgentsUserActor +from .memory_version_retrieve_params import MemoryVersionRetrieveParams as MemoryVersionRetrieveParams +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView as BetaManagedAgentsMemoryView +from .beta_managed_agents_memory_prefix import BetaManagedAgentsMemoryPrefix as BetaManagedAgentsMemoryPrefix +from .beta_managed_agents_session_actor import BetaManagedAgentsSessionActor as BetaManagedAgentsSessionActor +from .beta_managed_agents_deleted_memory import BetaManagedAgentsDeletedMemory as BetaManagedAgentsDeletedMemory +from .beta_managed_agents_memory_version import BetaManagedAgentsMemoryVersion as BetaManagedAgentsMemoryVersion +from .beta_managed_agents_memory_list_item import BetaManagedAgentsMemoryListItem as BetaManagedAgentsMemoryListItem +from .beta_managed_agents_precondition_param import ( + BetaManagedAgentsPreconditionParam as BetaManagedAgentsPreconditionParam, +) +from .beta_managed_agents_service_account_actor import ( + BetaManagedAgentsServiceAccountActor as BetaManagedAgentsServiceAccountActor, +) +from .beta_managed_agents_memory_version_operation import ( + BetaManagedAgentsMemoryVersionOperation as BetaManagedAgentsMemoryVersionOperation, +) diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..22f5139d98a90ac126e0d0e365a59c87244b9c99 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_actor.py @@ -0,0 +1,20 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_managed_agents_api_actor import BetaManagedAgentsAPIActor +from .beta_managed_agents_user_actor import BetaManagedAgentsUserActor +from .beta_managed_agents_session_actor import BetaManagedAgentsSessionActor +from .beta_managed_agents_service_account_actor import BetaManagedAgentsServiceAccountActor + +__all__ = ["BetaManagedAgentsActor"] + +BetaManagedAgentsActor: TypeAlias = Annotated[ + Union[ + BetaManagedAgentsSessionActor, + BetaManagedAgentsAPIActor, + BetaManagedAgentsUserActor, + BetaManagedAgentsServiceAccountActor, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_api_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_api_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..dff5064aca49f001cb0932bd66927126645be7d6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_api_actor.py @@ -0,0 +1,19 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsAPIActor"] + + +class BetaManagedAgentsAPIActor(BaseModel): + """ + A direct caller of the public API, identified by the API key that authenticated the request. + """ + + api_key_id: str + """ID of the API key (an `apikey_...` value). + + This identifies the key, not the secret. + """ + + type: Literal["api_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_deleted_memory.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_deleted_memory.py new file mode 100644 index 0000000000000000000000000000000000000000..c65bf30b8a9f7bacfb7f0f920b49c0ce67b0dcbd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_deleted_memory.py @@ -0,0 +1,20 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsDeletedMemory"] + + +class BetaManagedAgentsDeletedMemory(BaseModel): + """ + The confirmation that [Delete a Memory](https://platform.claude.com/docs/en/api/beta/memory_stores/memories/delete) returns. + + Deleting a memory doesn't delete its versions. [List Memory Versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list) returns them while they are retained: each version is kept for at least the version retention period after it was written, unless the store itself is deleted. + + See the [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#audit-memory-changes) to learn more about how long versions are kept. + """ + + id: str + """ID of the deleted memory (a `mem_...` value).""" + + type: Literal["memory_deleted"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory.py new file mode 100644 index 0000000000000000000000000000000000000000..fb2913f7bd22beafb2c9c9b0a872ac45ea58b330 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory.py @@ -0,0 +1,79 @@ +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsMemory"] + + +class BetaManagedAgentsMemory(BaseModel): + """A text document at a path inside a memory store. + + `content` is `null` when the response uses `view=basic`. `content_size_bytes` and `content_sha256` are always set, so you can detect changes without fetching the content. To retrieve, update, or delete a memory, pass its ID, which stays the same when its path changes. + + See the [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#view-and-edit-memories) to learn more about working with memories. + """ + + id: str + """The unique ID of the memory (`mem_...`). + + It stays the same when the memory's path changes. + + To retrieve, update, or delete the memory, pass this ID. + """ + + content_sha256: str + """Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). + + The server applies no normalization, so clients can compute the same hash + locally for staleness checks and as the value for a `content_sha256` + precondition on update. Always populated, regardless of `view`. + """ + + content_size_bytes: int + """The size of the memory's `content` in UTF-8 bytes. + + It is set regardless of `view`. + """ + + created_at: datetime + """When this memory was created, in RFC 3339 format.""" + + memory_store_id: str + """ID of the memory store this memory belongs to (a `memstore_...` value).""" + + memory_version_id: str + """ + The ID of the memory version that holds the memory's current content + (`memver_...`). + + Memory versions don't have a flag that marks the latest one. Compare their IDs + with this field instead. + + See the + [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#audit-memory-changes) + to learn more about memory versions. + """ + + path: str + """Hierarchical path of the memory within the store, e.g. + + `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and + unique within a store. Maximum 1,024 bytes. + """ + + type: Literal["memory"] + + updated_at: datetime + """When the memory was last changed, in RFC 3339. + + To find out who made the change, look at `created_by` on the memory version that + `memory_version_id` references. + """ + + content: Optional[str] = None + """The memory's UTF-8 text content, or `null` when the response uses `view=basic`. + + The maximum size is 100 kB (102,400 bytes). + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_list_item.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_list_item.py new file mode 100644 index 0000000000000000000000000000000000000000..056adbd757b1ac0db98c4ed534f92d35d99ffb4b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_list_item.py @@ -0,0 +1,12 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_managed_agents_memory import BetaManagedAgentsMemory +from .beta_managed_agents_memory_prefix import BetaManagedAgentsMemoryPrefix + +__all__ = ["BetaManagedAgentsMemoryListItem"] + +BetaManagedAgentsMemoryListItem: TypeAlias = Annotated[ + Union[BetaManagedAgentsMemory, BetaManagedAgentsMemoryPrefix], UnionDiscriminator("type") +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_prefix.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_prefix.py new file mode 100644 index 0000000000000000000000000000000000000000..d7d7788e0c08981a8f74494c00f96cb57cc33309 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_prefix.py @@ -0,0 +1,22 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsMemoryPrefix"] + + +class BetaManagedAgentsMemoryPrefix(BaseModel): + """ + A directory marker that [List Memories](https://platform.claude.com/docs/en/api/beta/memory_stores/memories/list) returns instead of the memories below the requested `depth`. + + It stands for one or more memories whose paths start with `path`. It isn't a stored object and doesn't have an ID. Each marker counts toward the page `limit`. + """ + + path: str + """The rolled-up path prefix, including a trailing `/` (e.g. + + `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to + drill into the directory. + """ + + type: Literal["memory_prefix"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version.py new file mode 100644 index 0000000000000000000000000000000000000000..3cf7e01db6455835c6f00814d4f84f0770c380e0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version.py @@ -0,0 +1,101 @@ +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_managed_agents_actor import BetaManagedAgentsActor +from .beta_managed_agents_memory_version_operation import BetaManagedAgentsMemoryVersionOperation + +__all__ = ["BetaManagedAgentsMemoryVersion"] + + +class BetaManagedAgentsMemoryVersion(BaseModel): + """One entry in a memory's history, recording a single change and who made it. + + Every change to a memory adds one version. Only redaction can change a version after that. Versions belong to the memory store and stay after the memory is deleted. Each version is retained for at least the version retention period after it was written, unless the store itself is deleted. + + Retrieving a redacted version succeeds, with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`. Check `redacted_at` to find out whether a version was redacted. + + See the [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#audit-memory-changes) to learn more about memory versions. + """ + + id: str + """Unique identifier for this version (a `memver_...` value).""" + + created_at: datetime + """When this version was written, in RFC 3339 format.""" + + memory_id: str + """The ID of the memory that this version belongs to (`mem_...`). + + The ID stays valid after the memory is deleted. Pass it as `memory_id` to + [List Memory Versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list) + to get the memory's retained versions, including its `deleted` version while the + lineage is retained. + """ + + memory_store_id: str + """ID of the memory store this version belongs to (a `memstore_...` value).""" + + operation: BetaManagedAgentsMemoryVersionOperation + """The kind of mutation this version records: `created`, `modified`, or `deleted`.""" + + type: Literal["memory_version"] + + content: Optional[str] = None + """The memory's UTF-8 text content as of this version. + + `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` + is set. + """ + + content_sha256: Optional[str] = None + """Lowercase hex SHA-256 digest of `content` as of this version (64 characters). + + `null` when `redacted_at` is set or `operation` is `deleted`. Populated + regardless of `view` otherwise. + """ + + content_size_bytes: Optional[int] = None + """Size of `content` in bytes as of this version. + + `null` when `redacted_at` is set or `operation` is `deleted`. Populated + regardless of `view` otherwise. + """ + + created_by: Optional[BetaManagedAgentsActor] = None + """Who made this change to the memory, or `null` if the author wasn't recorded. + + Redacting the version doesn't change this field. A `session_actor` here is an + agent that wrote through the store's mounted filesystem at `/mnt/memory/`. The + version doesn't record the API key that created that session. So the author in + `created_by` is who made the change, not who is ultimately responsible for it. + + You can + [retrieve the session](https://platform.claude.com/docs/en/api/beta/sessions/retrieve) + to learn more about where the change came from. + """ + + path: Optional[str] = None + """The memory's path at the time of this write. + + `null` if and only if `redacted_at` is set. + """ + + redacted_at: Optional[datetime] = None + """When the version was redacted, in RFC 3339, or `null` if it hasn't been. + + When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are + `null`. + + See the + [memory guide](https://platform.claude.com/docs/en/managed-agents/memory#redact-a-version) + to learn more about redaction. + """ + + redacted_by: Optional[BetaManagedAgentsActor] = None + """Who redacted this version, or `null` if it has not been redacted. + + In practice always an `api_actor`, `user_actor`, or `service_account_actor` + (agents do not have a redact capability). + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version_operation.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version_operation.py new file mode 100644 index 0000000000000000000000000000000000000000..52c4bf5e4581e459a2b7fb7d4868ce72f116eb18 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_version_operation.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaManagedAgentsMemoryVersionOperation"] + +BetaManagedAgentsMemoryVersionOperation: TypeAlias = Literal["created", "modified", "deleted"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_view.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_view.py new file mode 100644 index 0000000000000000000000000000000000000000..147b6186f3223eb5411ec69252ed87814df32ead --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_memory_view.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaManagedAgentsMemoryView"] + +BetaManagedAgentsMemoryView: TypeAlias = Literal["basic", "full"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_precondition_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_precondition_param.py new file mode 100644 index 0000000000000000000000000000000000000000..bfc3aae58d6216db23f94f080038ce0394809caf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_precondition_param.py @@ -0,0 +1,22 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaManagedAgentsPreconditionParam"] + + +class BetaManagedAgentsPreconditionParam(TypedDict, total=False): + """Optional condition that must hold for an update to apply. + + When omitted, the update is unconditional. Asserts the current state of the memory being updated. When an update changes `path`, the precondition still refers to the memory's current content, not the destination path. Currently the only supported variant is `content_sha256`. + """ + + type: Required[Literal["content_sha256"]] + + content_sha256: str + """ + Expected `content_sha256` of the stored memory (64 lowercase hexadecimal + characters). Typically the `content_sha256` returned by a prior read or list + call. Because the server applies no content normalization, clients can also + compute this locally as the SHA-256 of the UTF-8 content bytes. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_service_account_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_service_account_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..616ef1e155625ae1923356d8181feeb11d3dd647 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_service_account_actor.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsServiceAccountActor"] + + +class BetaManagedAgentsServiceAccountActor(BaseModel): + """ + A workload authenticated as a service account, for example via Workload Identity Federation. + """ + + service_account_id: str + """ID of the service account (a `svac_...` value).""" + + type: Literal["service_account_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_session_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_session_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..ad7323ab1668f5b6dd842ad7d54e26e7dd28418c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_session_actor.py @@ -0,0 +1,20 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsSessionActor"] + + +class BetaManagedAgentsSessionActor(BaseModel): + """ + An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session. + """ + + session_id: str + """ID of the session (a `sesn_...` value). + + Look up the session via [Retrieve a session](/en/api/beta/sessions/retrieve) for + further provenance. + """ + + type: Literal["session_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_user_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_user_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..0f019b2c3d1864117e330b3427f9535a5a905efc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/beta_managed_agents_user_actor.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaManagedAgentsUserActor"] + + +class BetaManagedAgentsUserActor(BaseModel): + """A human user, for example acting through the Anthropic Console.""" + + type: Literal["user_actor"] + + user_id: str + """ID of the user (a `user_...` value).""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..fa5ace78b967e5703d14b645ebfc0a0fc5323c99 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_create_params.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView + +__all__ = ["MemoryCreateParams"] + + +class MemoryCreateParams(TypedDict, total=False): + content: Required[Optional[str]] + """The UTF-8 text content of the new memory. Pass `""` to create an empty memory. + + The maximum size is 100 kB (102,400 bytes). + """ + + path: Required[str] + """The path of the new memory, such as `/projects/foo/notes.md`. + + Paths are case-sensitive. + + A path starts with `/` and has 1 to 20 segments. A segment can't be empty and + can't be `.` or `..`. A path can't contain control characters, format + characters, or the line and paragraph separators U+2028 and U+2029. It must be + in Unicode Normalization Form C and at most 1,024 bytes long. + """ + + view: BetaManagedAgentsMemoryView + """Whether a `memory` or `memory_version` in the response includes its `content`. + + Defaults to `full` on retrieve operations and to `basic` on list, create, and + update operations. + + With `full`, list operations return at most 20 items per page. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_delete_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_delete_params.py new file mode 100644 index 0000000000000000000000000000000000000000..89b20efe417207e5a07aa54ecf74114905e5bb6b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_delete_params.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["MemoryDeleteParams"] + + +class MemoryDeleteParams(TypedDict, total=False): + memory_store_id: Required[str] + """The ID of the memory store that holds the memory (`memstore_...`).""" + + expected_content_sha256: str + """ + Delete the memory only if its current `content_sha256` equals this value, given + as 64 lowercase hexadecimal characters. Omit it to delete unconditionally. + + If the hashes differ, the request fails with HTTP status 409 and nothing is + deleted. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..d3dde41dbffdcd3dbfee62a556ef839e0bfa1a17 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_list_params.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView + +__all__ = ["MemoryListParams"] + + +class MemoryListParams(TypedDict, total=False): + depth: int + """How far below `path_prefix` to list. + + Defaults to `0`, which lists every memory below the prefix. + + Pass `1` to list only the direct children. Deeper memories are then grouped into + `memory_prefix` items. + """ + + limit: int + """The maximum number of items to return per page, from 1 to 100. Defaults to 20. + + With `view=full`, a page holds at most 20 items. `memory` and `memory_prefix` + items both count toward the limit. + """ + + page: str + """The `next_page` value from a previous response, to get the next page. + + Omit it to get the first page. + """ + + path_prefix: str + """Return only memories whose path starts with this prefix, such as `/notes/`. + + This value appears in request URLs. Do not include secrets or personally + identifiable information. + + Omit it to list the whole store. The prefix must end with `/` and matches whole + segments, so `/notes/` matches `/notes/todo.md` but not + `/notes-archive/todo.md`. + """ + + view: BetaManagedAgentsMemoryView + """Whether each memory in the response includes `content`. + + Defaults to `basic`, which sets it to `null`. + + With `full`, a page holds at most 20 items. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_retrieve_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_retrieve_params.py new file mode 100644 index 0000000000000000000000000000000000000000..42623a4166c048cfbaa446210e893120953ac33b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_retrieve_params.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView + +__all__ = ["MemoryRetrieveParams"] + + +class MemoryRetrieveParams(TypedDict, total=False): + memory_store_id: Required[str] + """The ID of the memory store that holds the memory (`memstore_...`).""" + + view: BetaManagedAgentsMemoryView + """Whether a `memory` or `memory_version` in the response includes its `content`. + + Defaults to `full` on retrieve operations and to `basic` on list, create, and + update operations. + + With `full`, list operations return at most 20 items per page. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a268f20ea5091ab62f3316971f672b58542b012c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_update_params.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView +from .beta_managed_agents_precondition_param import BetaManagedAgentsPreconditionParam + +__all__ = ["MemoryUpdateParams"] + + +class MemoryUpdateParams(TypedDict, total=False): + memory_store_id: Required[str] + """The ID of the memory store that holds the memory (`memstore_...`).""" + + view: BetaManagedAgentsMemoryView + """Whether a `memory` or `memory_version` in the response includes its `content`. + + Defaults to `full` on retrieve operations and to `basic` on list, create, and + update operations. + + With `full`, list operations return at most 20 items per page. + """ + + content: Optional[str] + """New UTF-8 text content for the memory. + + Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a + rename-only update). + """ + + path: Optional[str] + """The new path of the memory, which renames it. Omit it to keep the current path. + + The memory keeps its `id`. A path starts with `/` and has 1 to 20 segments. A + segment can't be empty and can't be `.` or `..`. A path can't contain control + characters, format characters, or the line and paragraph separators U+2028 and + U+2029. It must be in Unicode Normalization Form C and at most 1,024 bytes long. + Paths are case-sensitive. + """ + + precondition: BetaManagedAgentsPreconditionParam + """The condition that the memory must meet for the update to apply. + + Omit it to update unconditionally. + + If the condition fails, the request fails with HTTP status 409. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..3debae0f975d39f8d9724fd216cf8cb56d68b79d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_list_params.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView +from .beta_managed_agents_memory_version_operation import BetaManagedAgentsMemoryVersionOperation + +__all__ = ["MemoryVersionListParams"] + + +class MemoryVersionListParams(TypedDict, total=False): + api_key_id: str + """Return only versions written with the API key that has this ID.""" + + created_at_gte: Union[str, datetime] + """Return versions created at or after this time (inclusive).""" + + created_at_lte: Union[str, datetime] + """Return versions created at or before this time (inclusive).""" + + limit: int + """The maximum number of versions to return per page, from 1 to 100. + + Defaults to 20. + + With `view=full`, a page holds at most 20 versions. + """ + + memory_id: str + """Return only versions of the memory with this ID (`mem_...`). + + The filter still works after the memory is deleted. While that memory's versions + are retained, the results include the version whose `operation` is `deleted`. + """ + + operation: BetaManagedAgentsMemoryVersionOperation + """Return only versions that record this kind of change.""" + + page: str + """The `next_page` value from a previous response, to get the next page. + + Omit it to get the first page. + """ + + service_account_id: str + """Return only versions written by the service account with this ID (`svac_...`).""" + + session_id: str + """Return only versions written by the session with this ID.""" + + view: BetaManagedAgentsMemoryView + """Whether a `memory` or `memory_version` in the response includes its `content`. + + Defaults to `full` on retrieve operations and to `basic` on list, create, and + update operations. + + With `full`, list operations return at most 20 items per page. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_retrieve_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_retrieve_params.py new file mode 100644 index 0000000000000000000000000000000000000000..60c485bda2a540f2a2338637d96fe00a267aecbc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/memory_stores/memory_version_retrieve_params.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from .beta_managed_agents_memory_view import BetaManagedAgentsMemoryView + +__all__ = ["MemoryVersionRetrieveParams"] + + +class MemoryVersionRetrieveParams(TypedDict, total=False): + memory_store_id: Required[str] + """The ID of the memory store that holds the version (`memstore_...`).""" + + view: BetaManagedAgentsMemoryView + """Whether a `memory` or `memory_version` in the response includes its `content`. + + Defaults to `full` on retrieve operations and to `basic` on list, create, and + update operations. + + With `full`, list operations return at most 20 items per page. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `agent-memory-2026-07-22` or + `managed-agents-2026-04-01` in this header. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_count_tokens_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_count_tokens_params.py new file mode 100644 index 0000000000000000000000000000000000000000..4ccae1a6bdd46b0c8110a9eb74c267043b72e7a8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_count_tokens_params.py @@ -0,0 +1,328 @@ +from __future__ import annotations + +from typing import List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..model_param import ModelParam +from .beta_tool_param import BetaToolParam +from .beta_message_param import BetaMessageParam +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_text_block_param import BetaTextBlockParam +from .beta_mcp_toolset_param import BetaMCPToolsetParam +from .beta_tool_choice_param import BetaToolChoiceParam +from .beta_output_config_param import BetaOutputConfigParam +from .beta_thinking_config_param import BetaThinkingConfigParam +from .beta_compaction_config_param import BetaCompactionConfigParam +from .beta_tool_bash_20241022_param import BetaToolBash20241022Param +from .beta_tool_bash_20250124_param import BetaToolBash20250124Param +from .beta_memory_tool_20250818_param import BetaMemoryTool20250818Param +from .beta_advisor_tool_20260301_param import BetaAdvisorTool20260301Param +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam +from .beta_web_fetch_tool_20250910_param import BetaWebFetchTool20250910Param +from .beta_web_fetch_tool_20260209_param import BetaWebFetchTool20260209Param +from .beta_web_fetch_tool_20260309_param import BetaWebFetchTool20260309Param +from .beta_web_fetch_tool_20260318_param import BetaWebFetchTool20260318Param +from .beta_browser_toolset_20260801_param import BetaBrowserToolset20260801Param +from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param +from .beta_web_search_tool_20260209_param import BetaWebSearchTool20260209Param +from .beta_web_search_tool_20260318_param import BetaWebSearchTool20260318Param +from .beta_computer_toolset_20260801_param import BetaComputerToolset20260801Param +from .beta_context_management_config_param import BetaContextManagementConfigParam +from .beta_tool_text_editor_20241022_param import BetaToolTextEditor20241022Param +from .beta_tool_text_editor_20250124_param import BetaToolTextEditor20250124Param +from .beta_tool_text_editor_20250429_param import BetaToolTextEditor20250429Param +from .beta_tool_text_editor_20250728_param import BetaToolTextEditor20250728Param +from .beta_tool_computer_use_20241022_param import BetaToolComputerUse20241022Param +from .beta_tool_computer_use_20250124_param import BetaToolComputerUse20250124Param +from .beta_tool_computer_use_20251124_param import BetaToolComputerUse20251124Param +from .beta_code_execution_tool_20250522_param import BetaCodeExecutionTool20250522Param +from .beta_code_execution_tool_20250825_param import BetaCodeExecutionTool20250825Param +from .beta_code_execution_tool_20260120_param import BetaCodeExecutionTool20260120Param +from .beta_code_execution_tool_20260521_param import BetaCodeExecutionTool20260521Param +from .beta_tool_search_tool_bm25_20251119_param import BetaToolSearchToolBm25_20251119Param +from .beta_tool_search_tool_regex_20251119_param import BetaToolSearchToolRegex20251119Param +from .beta_request_mcp_server_url_definition_param import BetaRequestMCPServerURLDefinitionParam + +__all__ = ["MessageCountTokensParams", "Tool"] + + +class MessageCountTokensParams(TypedDict, total=False): + messages: Required[Iterable[BetaMessageParam]] + """Input messages. + + Our models are trained to operate on alternating `user` and `assistant` + conversational turns. When creating a new `Message`, you specify the prior + conversational turns with the `messages` parameter, and the model then generates + the next `Message` in the conversation. Consecutive `user` or `assistant` turns + in your request will be combined into a single turn. + + Each input message must be an object with a `role` and `content`. You can + specify a single `user`-role message, or you can include multiple `user` and + `assistant` messages. + + If the final message uses the `assistant` role, the response content will + continue immediately from the content in that message. This can be used to + constrain part of the model's response. This is called prefill. On models that + don't support prefill, creating a message that ends with a partial `assistant` + response returns a 400 error. See + [Prefill not supported](https://platform.claude.com/docs/en/api/errors#prefill-not-supported). + + Example with a single `user` message: + + ```json + [{ "role": "user", "content": "Hello, Claude" }] + ``` + + Example with multiple conversational turns: + + ```json + [ + { "role": "user", "content": "Hello there." }, + { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, + { "role": "user", "content": "Can you explain LLMs in plain English?" } + ] + ``` + + Example with a partially-filled response from Claude, for models that support + prefill: + + ```json + [ + { + "role": "user", + "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" + }, + { "role": "assistant", "content": "The best answer is (" } + ] + ``` + + Each input message `content` may be either a single `string` or an array of + content blocks, where each block has a specific `type`. Using a `string` for + `content` is shorthand for an array of one content block of type `"text"`. The + following input messages are equivalent: + + ```json + { "role": "user", "content": "Hello, Claude" } + ``` + + ```json + { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } + ``` + + See + [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). + + Note that if you want to include a + [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), + you can use the top-level `system` parameter. + + There is a limit of 100,000 messages in a single request. + """ + + model: Required[ModelParam] + """The model that will complete your prompt. + + See [models](https://docs.anthropic.com/en/docs/models-overview) for additional + details and options. + """ + + cache_control: Optional[BetaCacheControlEphemeralParam] + """ + Top-level cache control automatically applies a cache_control marker to the last + cacheable block in the request. + """ + + compaction: Optional[BetaCompactionConfigParam] + """Compaction configuration. + + When set on `POST /v1/messages`, the request is a compaction request: the + conversation in `messages` is summarized and the response holds only the + resulting `compaction` block (`stop_reason` `"compaction"`), which later + requests send first in `messages` in place of the messages it summarizes. + `POST /v1/messages/count_tokens` accepts this parameter and ignores it: the + count it returns is for the conversation in `messages` as sent. Cannot be + combined with `context_management`. + """ + + context_management: Optional[BetaContextManagementConfigParam] + """Context management configuration. + + This allows you to control how Claude manages context across multiple requests, + such as whether to clear function results or not. + """ + + mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] + """MCP servers to be utilized in this request""" + + output_config: BetaOutputConfigParam + """Configuration options for the model's output, such as the output format.""" + + speed: Optional[Literal["standard", "fast"]] + """The inference speed mode for this request. + + `"fast"` enables high output-tokens-per-second inference. + + Some models require the `fast-mode-2026-02-01` beta header for any `speed` + value. See + [fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode) for + which models. + """ + + system: Union[str, Iterable[BetaTextBlockParam]] + """System prompt. + + A system prompt is a way of providing context and instructions to Claude, such + as specifying a particular goal or role. See our + [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role). + """ + + thinking: BetaThinkingConfigParam + """Configuration for Claude's thinking. + + With `{"type": "adaptive"}`, Claude decides when and how much to think. With + `{"type": "enabled"}` (manual extended thinking), you set a `budget_tokens` of + at least 1,024. Thinking tokens count toward your `max_tokens` limit. + + Which `type` values are accepted, and what happens when you omit `thinking`, + depend on the model. See + [thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#configuring-thinking) + for each model's behavior. + """ + + tool_choice: BetaToolChoiceParam + """How the model should use the provided tools. + + The model can use a specific tool, any available tool, decide by itself, or not + use tools at all. + """ + + tools: Iterable[Tool] + """Definitions of tools that the model may use. + + If you include `tools` in your API request, the model may return `tool_use` + content blocks that represent the model's use of those tools. You can then run + those tools using the tool input generated by the model and then optionally + return results back to the model using `tool_result` content blocks. + + There are two types of tools: **client tools** and **server tools**. The + behavior described below applies to client tools. For + [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools), + see their individual documentation as each has its own behavior (e.g., the + [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)). + + Each tool definition includes: + + - `name`: Name of the tool. + - `description`: Optional, but strongly-recommended description of the tool. + - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the + tool `input` shape that the model will produce in `tool_use` output content + blocks. + + For example, if you defined `tools` as: + + ```json + [ + { + "name": "get_stock_price", + "description": "Get the current stock price for a given ticker symbol.", + "input_schema": { + "type": "object", + "properties": { + "ticker": { + "type": "string", + "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." + } + }, + "required": ["ticker"] + } + } + ] + ``` + + And then asked the model "What's the S&P 500 at today?", the model might produce + `tool_use` content blocks in the response like this: + + ```json + [ + { + "type": "tool_use", + "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", + "name": "get_stock_price", + "input": { "ticker": "^GSPC" } + } + ] + ``` + + You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an + input, and return the following back to the model in a subsequent `user` + message: + + ```json + [ + { + "type": "tool_result", + "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", + "content": "259.75 USD" + } + ] + ``` + + Tools can be used for workflows that include running client-side tools and + functions, or more generally whenever you want the model to produce a particular + JSON structure of output. + + See our + [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) + for more details. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + user_profile_id: str + """The user profile ID to attribute this request to. + + Use when acting on behalf of a party other than your organization. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Tool: 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, +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..c91def21ef7bf696e7379b331c7720a2e5a79804 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/message_create_params.py @@ -0,0 +1,431 @@ +from __future__ import annotations + +from typing import List, Union, Generic, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ..._types import SequenceNotStr +from ..model_param import ModelParam +from .beta_message_param import BetaMessageParam +from .beta_metadata_param import BetaMetadataParam +from .parsed_beta_message import ResponseFormatT +from .beta_fallbacks_param import BetaFallbacksParam +from ..anthropic_beta_param import AnthropicBetaParam +from .beta_container_params import BetaContainerParams +from .beta_text_block_param import BetaTextBlockParam +from .beta_tool_union_param import BetaToolUnionParam +from .beta_diagnostics_param import BetaDiagnosticsParam +from .beta_tool_choice_param import BetaToolChoiceParam +from .beta_output_config_param import BetaOutputConfigParam +from .beta_message_thread_param import BetaMessageThreadParam +from .beta_thinking_config_param import BetaThinkingConfigParam +from .beta_compaction_config_param import BetaCompactionConfigParam +from .beta_fallback_credit_token_param import BetaFallbackCreditTokenParam +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam +from .beta_context_management_config_param import BetaContextManagementConfigParam +from .beta_request_mcp_server_url_definition_param import BetaRequestMCPServerURLDefinitionParam + +__all__ = [ + "MessageCreateParamsBase", + "Container", + "FallbackCreditToken", + "MessageCreateParamsNonStreaming", + "MessageCreateParamsStreaming", + "OutputFormat", +] + + +class MessageCreateParamsBase(TypedDict, total=False): + max_tokens: Required[int] + """The maximum number of tokens to generate before stopping. + + Note that our models may stop _before_ reaching this maximum. This parameter + only specifies the absolute maximum number of tokens to generate. + + Set to `0` to populate the + [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) + without generating a response. + + Different models have different maximum values for this parameter. See + [models](https://platform.claude.com/docs/en/about-claude/models/overview) for + details. + """ + + messages: Required[Iterable[BetaMessageParam]] + """Input messages. + + Our models are trained to operate on alternating `user` and `assistant` + conversational turns. When creating a new `Message`, you specify the prior + conversational turns with the `messages` parameter, and the model then generates + the next `Message` in the conversation. Consecutive `user` or `assistant` turns + in your request will be combined into a single turn. + + Each input message must be an object with a `role` and `content`. You can + specify a single `user`-role message, or you can include multiple `user` and + `assistant` messages. + + If the final message uses the `assistant` role, the response content will + continue immediately from the content in that message. This can be used to + constrain part of the model's response. This is called prefill. On models that + don't support prefill, creating a message that ends with a partial `assistant` + response returns a 400 error. See + [Prefill not supported](https://platform.claude.com/docs/en/api/errors#prefill-not-supported). + + Example with a single `user` message: + + ```json + [{ "role": "user", "content": "Hello, Claude" }] + ``` + + Example with multiple conversational turns: + + ```json + [ + { "role": "user", "content": "Hello there." }, + { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, + { "role": "user", "content": "Can you explain LLMs in plain English?" } + ] + ``` + + Example with a partially-filled response from Claude, for models that support + prefill: + + ```json + [ + { + "role": "user", + "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" + }, + { "role": "assistant", "content": "The best answer is (" } + ] + ``` + + Each input message `content` may be either a single `string` or an array of + content blocks, where each block has a specific `type`. Using a `string` for + `content` is shorthand for an array of one content block of type `"text"`. The + following input messages are equivalent: + + ```json + { "role": "user", "content": "Hello, Claude" } + ``` + + ```json + { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } + ``` + + See + [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). + + Note that if you want to include a + [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), + you can use the top-level `system` parameter. + + There is a limit of 100,000 messages in a single request. + """ + + model: Required[ModelParam] + """The model that will complete your prompt. + + See [models](https://docs.anthropic.com/en/docs/models-overview) for additional + details and options. + """ + + cache_control: Optional[BetaCacheControlEphemeralParam] + """ + Top-level cache control automatically applies a cache_control marker to the last + cacheable block in the request. + """ + + compaction: Optional[BetaCompactionConfigParam] + """Compaction configuration. + + When set on `POST /v1/messages`, the request is a compaction request: the + conversation in `messages` is summarized and the response holds only the + resulting `compaction` block (`stop_reason` `"compaction"`), which later + requests send first in `messages` in place of the messages it summarizes. + `POST /v1/messages/count_tokens` accepts this parameter and ignores it: the + count it returns is for the conversation in `messages` as sent. Cannot be + combined with `context_management`. + """ + + container: Optional[Container] + """Container identifier for reuse across requests.""" + + context_management: Optional[BetaContextManagementConfigParam] + """Context management configuration. + + This allows you to control how Claude manages context across multiple requests, + such as whether to clear function results or not. + """ + + diagnostics: Optional[BetaDiagnosticsParam] + """Request-level diagnostics. + + Supply `previous_message_id` to have the response include + `diagnostics.cache_miss_reason` explaining any prompt-cache divergence from that + prior request. + """ + + fallback_credit_token: Optional[FallbackCreditToken] + """The `fallback_credit_token` from a prior refusal's `stop_details`. + + When a preceding request was refused and returned a `fallback_credit_token`, + pass that code here on the retry to have the retry's cache-creation tokens for + the prefix that was warm on the refused model billed at the cache-read rate. + Must be redeemed by the same organization and workspace, with the same request + body (optionally extended by one appended `assistant` message whose content is + the partial text — with any trailing whitespace stripped from the final text + block — and paired server-tool blocks streamed before the refusal; the + appended-assistant form is not available for requests with `output_format` set + or forced `tool_choice`), on an eligible fallback model, on the same platform, + and within 5 minutes of the refusal; a mismatch is a 400. A token minted + mid-server-tool-loop whose partial content was continuable may only be redeemed + with the appended-assistant form — if an exact-body retry is rejected with a 400 + saying the token must be redeemed by continuing the partial response, retry with + the appended-assistant form instead. + + When the appended-assistant form is used on a model that otherwise disallows + assistant-turn prefill, this token also authorizes that one prefill. + """ + + fallbacks: Optional[BetaFallbacksParam] + """ + Opt-in server-side retry on one or more substitute models when the requested + model declines for policy reasons. Tried in order: if the first entry also + declines, the second is tried, and so on. Some models don't support fallbacks; + on those models, a list of fallback models returns a 400 error. See + [Server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback). + The string "default" requests the requested model's server-defined default + fallback configuration. On a model that doesn't support fallbacks, the request + runs on the requested model alone, so a declined request stays declined. + """ + + inference_geo: Optional[str] + """Specifies the geographic region for inference processing. + + If not specified, the workspace's `default_inference_geo` is used. + """ + + mcp_servers: Iterable[BetaRequestMCPServerURLDefinitionParam] + """MCP servers to be utilized in this request""" + + metadata: BetaMetadataParam + """An object describing metadata about the request.""" + + output_config: BetaOutputConfigParam + """Configuration options for the model's output, such as the output format.""" + + service_tier: Literal["auto", "standard_only"] + """ + Determines whether to use priority capacity (if available) or standard capacity + for this request. + + Anthropic offers different levels of service for your API requests. See + [service-tiers](https://platform.claude.com/docs/en/api/service-tiers) for + details. + """ + + speed: Optional[Literal["standard", "fast"]] + """The inference speed mode for this request. + + `"fast"` enables high output-tokens-per-second inference. + + Some models require the `fast-mode-2026-02-01` beta header for any `speed` + value. See + [fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode) for + which models. + """ + + stop_sequences: SequenceNotStr[str] + """Custom text sequences that will cause the model to stop generating. + + Our models will normally stop when they have naturally completed their turn, + which will result in a response `stop_reason` of `"end_turn"`. + + If you want the model to stop generating when it encounters custom strings of + text, you can use the `stop_sequences` parameter. If the model encounters one of + the custom sequences, the response `stop_reason` value will be `"stop_sequence"` + and the response `stop_sequence` value will contain the matched stop sequence. + """ + + system: Union[str, Iterable[BetaTextBlockParam]] + """System prompt. + + A system prompt is a way of providing context and instructions to Claude, such + as specifying a particular goal or role. See our + [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role). + """ + + thinking: BetaThinkingConfigParam + """Configuration for Claude's thinking. + + With `{"type": "adaptive"}`, Claude decides when and how much to think. With + `{"type": "enabled"}` (manual extended thinking), you set a `budget_tokens` of + at least 1,024. Thinking tokens count toward your `max_tokens` limit. + + Which `type` values are accepted, and what happens when you omit `thinking`, + depend on the model. See + [thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#configuring-thinking) + for each model's behavior. + """ + + thread: Optional[BetaMessageThreadParam] + """Server-held conversation state (a Thread). + + `{"type": "create"}` asks the server to hold this conversation's state under the + response's `id`; `{"type": "continue", "previous_message_id": ...}` resumes from + a previous response so only the new turn's messages are sent. The response shape + is unchanged. + """ + + tool_choice: BetaToolChoiceParam + """How the model should use the provided tools. + + The model can use a specific tool, any available tool, decide by itself, or not + use tools at all. + """ + + tools: Iterable[BetaToolUnionParam] + """Definitions of tools that the model may use. + + If you include `tools` in your API request, the model may return `tool_use` + content blocks that represent the model's use of those tools. You can then run + those tools using the tool input generated by the model and then optionally + return results back to the model using `tool_result` content blocks. + + There are two types of tools: **client tools** and **server tools**. The + behavior described below applies to client tools. For + [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools), + see their individual documentation as each has its own behavior (e.g., the + [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)). + + Each tool definition includes: + + - `name`: Name of the tool. + - `description`: Optional, but strongly-recommended description of the tool. + - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the + tool `input` shape that the model will produce in `tool_use` output content + blocks. + + For example, if you defined `tools` as: + + ```json + [ + { + "name": "get_stock_price", + "description": "Get the current stock price for a given ticker symbol.", + "input_schema": { + "type": "object", + "properties": { + "ticker": { + "type": "string", + "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." + } + }, + "required": ["ticker"] + } + } + ] + ``` + + And then asked the model "What's the S&P 500 at today?", the model might produce + `tool_use` content blocks in the response like this: + + ```json + [ + { + "type": "tool_use", + "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", + "name": "get_stock_price", + "input": { "ticker": "^GSPC" } + } + ] + ``` + + You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an + input, and return the following back to the model in a subsequent `user` + message: + + ```json + [ + { + "type": "tool_result", + "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", + "content": "259.75 USD" + } + ] + ``` + + Tools can be used for workflows that include running client-side tools and + functions, or more generally whenever you want the model to produce a particular + JSON structure of output. + + See our + [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) + for more details. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + user_profile_id: str + """The user profile ID to attribute this request to. + + Use when acting on behalf of a party other than your organization. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +Container: TypeAlias = Union[BetaContainerParams, str] + +FallbackCreditToken: TypeAlias = Union[str, BetaFallbackCreditTokenParam] + + +class ParseMessageCreateParamsBase(MessageCreateParamsBase, Generic[ResponseFormatT]): + output_format: type[ResponseFormatT] # type: ignore[misc] + + +class OutputFormat(TypedDict, total=False): + schema: Required[object] + """The JSON schema of the format""" + + type: Required[Literal["json_schema"]] + + +class MessageCreateParamsNonStreaming(MessageCreateParamsBase, total=False): + stream: Literal[False] + """Whether to incrementally stream the response using server-sent events. + + When `true`, SDKs return a raw event stream. + + In the TypeScript, Python and Ruby SDKs, the recommended way to stream is + `messages.stream()`. It sets `stream` for you and accumulates the events into + the final message. See + [Streaming with SDKs](https://platform.claude.com/docs/en/build-with-claude/streaming#streaming-with-sdks) + for an example in each language. + """ + + +class MessageCreateParamsStreaming(MessageCreateParamsBase): + stream: Required[Literal[True]] + """Whether to incrementally stream the response using server-sent events. + + When `true`, SDKs return a raw event stream. + + In the TypeScript, Python and Ruby SDKs, the recommended way to stream is + `messages.stream()`. It sets `stream` for you and accumulates the events into + the final message. See + [Streaming with SDKs](https://platform.claude.com/docs/en/build-with-claude/streaming#streaming-with-sdks) + for an example in each language. + """ + + +MessageCreateParams = Union[MessageCreateParamsNonStreaming, MessageCreateParamsStreaming] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e7908f3c544e414a291a1f45a1f95cc04b949a2b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/__init__.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from .batch_list_params import BatchListParams as BatchListParams +from .beta_message_batch import BetaMessageBatch as BetaMessageBatch +from .batch_create_params import BatchCreateParams as BatchCreateParams +from .beta_message_batch_result import BetaMessageBatchResult as BetaMessageBatchResult +from .beta_deleted_message_batch import BetaDeletedMessageBatch as BetaDeletedMessageBatch +from .beta_message_batch_errored_result import BetaMessageBatchErroredResult as BetaMessageBatchErroredResult +from .beta_message_batch_expired_result import BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult +from .beta_message_batch_request_counts import BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts +from .beta_message_batch_canceled_result import BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult +from .beta_message_batch_succeeded_result import BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult +from .beta_message_batch_individual_response import ( + BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, +) diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_create_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..c91e8a22952a9103bec7ff0e3e37a66303f84ec7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_create_params.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam +from ..message_create_params import MessageCreateParamsNonStreaming + +__all__ = ["BatchCreateParams", "Request"] + + +class BatchCreateParams(TypedDict, total=False): + requests: Required[Iterable[Request]] + """List of requests for prompt completion. + + Each is an individual request to create a Message. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + user_profile_id: str + """The user profile ID to attribute the requests in this batch to. + + Use when acting on behalf of a party other than your organization. Applies to + every request in the batch; an individual request whose `user_profile_id` body + field conflicts with this header is errored. + """ + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ + + +class Request(TypedDict, total=False): + custom_id: Required[str] + """Developer-provided ID created for each request in a Message Batch. + + Useful for matching results to requests, as results may be given out of request + order. + + Must be unique for each request within the Message Batch. + """ + + params: Required[MessageCreateParamsNonStreaming] + """Messages API creation parameters for the individual request. + + See the + [Messages API reference](https://platform.claude.com/docs/en/api/messages) for + full documentation on available parameters. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..760dca47de79d74038fb2e71ee4ae44524466dcd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/batch_list_params.py @@ -0,0 +1,41 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +from ...anthropic_beta_param import AnthropicBetaParam + +__all__ = ["BatchListParams"] + + +class BatchListParams(TypedDict, total=False): + after_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately after this object. + """ + + before_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately before this object. + """ + + limit: int + """Number of items to return per page. + + Defaults to `20`. Ranges from `1` to `1000`. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_deleted_message_batch.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_deleted_message_batch.py new file mode 100644 index 0000000000000000000000000000000000000000..0e67558b99d3916b80d4b98426418bf7cf059569 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_deleted_message_batch.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaDeletedMessageBatch"] + + +class BetaDeletedMessageBatch(BaseModel): + id: str + """ID of the Message Batch.""" + + type: Literal["message_batch_deleted"] + """Deleted object type. + + For Message Batches, this is always `"message_batch_deleted"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch.py new file mode 100644 index 0000000000000000000000000000000000000000..b532578cfd9778985e21a136b1a04b7bb89612a5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch.py @@ -0,0 +1,75 @@ +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_message_batch_request_counts import BetaMessageBatchRequestCounts + +__all__ = ["BetaMessageBatch"] + + +class BetaMessageBatch(BaseModel): + id: str + """Unique object identifier. + + The format and length of IDs may change over time. + """ + + archived_at: Optional[datetime] = None + """ + RFC 3339 datetime string representing the time at which the Message Batch was + archived and its results became unavailable. + """ + + cancel_initiated_at: Optional[datetime] = None + """ + RFC 3339 datetime string representing the time at which cancellation was + initiated for the Message Batch. Specified only if cancellation was initiated. + """ + + created_at: datetime + """ + RFC 3339 datetime string representing the time at which the Message Batch was + created. + """ + + ended_at: Optional[datetime] = None + """ + RFC 3339 datetime string representing the time at which processing for the + Message Batch ended. Specified only once processing ends. + + Processing ends when every request in a Message Batch has either succeeded, + errored, canceled, or expired. + """ + + expires_at: datetime + """ + RFC 3339 datetime string representing the time at which the Message Batch will + expire and end processing, which is 24 hours after creation. + """ + + processing_status: Literal["in_progress", "canceling", "ended"] + """Processing status of the Message Batch.""" + + request_counts: BetaMessageBatchRequestCounts + """Tallies requests within the Message Batch, categorized by their status. + + Requests start as `processing` and move to one of the other statuses only once + processing of the entire batch ends. The sum of all values always matches the + total number of requests in the batch. + """ + + results_url: Optional[str] = None + """URL to a `.jsonl` file containing the results of the Message Batch requests. + + Specified only once processing ends. + + Results in the file are not guaranteed to be in the same order as requests. Use + the `custom_id` field to match results to requests. + """ + + type: Literal["message_batch"] + """Object type. + + For Message Batches, this is always `"message_batch"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_canceled_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_canceled_result.py new file mode 100644 index 0000000000000000000000000000000000000000..84ebed49b67666cf3deb5dd548bdb6a35f8433bd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_canceled_result.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaMessageBatchCanceledResult"] + + +class BetaMessageBatchCanceledResult(BaseModel): + type: Literal["canceled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_errored_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_errored_result.py new file mode 100644 index 0000000000000000000000000000000000000000..42ec826682d832084fb0fb6336ba2ae48d81f977 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_errored_result.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel +from ...beta_error_response import BetaErrorResponse + +__all__ = ["BetaMessageBatchErroredResult"] + + +class BetaMessageBatchErroredResult(BaseModel): + error: BetaErrorResponse + + type: Literal["errored"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_expired_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_expired_result.py new file mode 100644 index 0000000000000000000000000000000000000000..f86da423968c7b9dcd4e69d7ecdc179b02430f8f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_expired_result.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaMessageBatchExpiredResult"] + + +class BetaMessageBatchExpiredResult(BaseModel): + type: Literal["expired"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_individual_response.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_individual_response.py new file mode 100644 index 0000000000000000000000000000000000000000..2eed658fe59ab7f93c405e99600c9a2bdb142a50 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_individual_response.py @@ -0,0 +1,27 @@ +from ...._models import BaseModel +from .beta_message_batch_result import BetaMessageBatchResult + +__all__ = ["BetaMessageBatchIndividualResponse"] + + +class BetaMessageBatchIndividualResponse(BaseModel): + """ + This is a single line in the response `.jsonl` file and does not represent the response as a whole. + """ + + custom_id: str + """Developer-provided ID created for each request in a Message Batch. + + Useful for matching results to requests, as results may be given out of request + order. + + Must be unique for each request within the Message Batch. + """ + + result: BetaMessageBatchResult + """Processing result for this request. + + Contains a Message output if processing was successful, an error response if + processing failed, or the reason why processing was not attempted, such as + cancellation or expiration. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_request_counts.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_request_counts.py new file mode 100644 index 0000000000000000000000000000000000000000..2b57a4b735bba6be3142349358b23f5602590cbf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_request_counts.py @@ -0,0 +1,32 @@ +from ...._models import BaseModel + +__all__ = ["BetaMessageBatchRequestCounts"] + + +class BetaMessageBatchRequestCounts(BaseModel): + canceled: int + """Number of requests in the Message Batch that have been canceled. + + This is zero until processing of the entire Message Batch has ended. + """ + + errored: int + """Number of requests in the Message Batch that encountered an error. + + This is zero until processing of the entire Message Batch has ended. + """ + + expired: int + """Number of requests in the Message Batch that have expired. + + This is zero until processing of the entire Message Batch has ended. + """ + + processing: int + """Number of requests in the Message Batch that are processing.""" + + succeeded: int + """Number of requests in the Message Batch that have completed successfully. + + This is zero until processing of the entire Message Batch has ended. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_result.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b4cdd7dc62ed131b72587cd6bbd354ab08bfbc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_result.py @@ -0,0 +1,20 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_message_batch_errored_result import BetaMessageBatchErroredResult +from .beta_message_batch_expired_result import BetaMessageBatchExpiredResult +from .beta_message_batch_canceled_result import BetaMessageBatchCanceledResult +from .beta_message_batch_succeeded_result import BetaMessageBatchSucceededResult + +__all__ = ["BetaMessageBatchResult"] + +BetaMessageBatchResult: TypeAlias = Annotated[ + Union[ + BetaMessageBatchSucceededResult, + BetaMessageBatchErroredResult, + BetaMessageBatchCanceledResult, + BetaMessageBatchExpiredResult, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py new file mode 100644 index 0000000000000000000000000000000000000000..25d8d740798e964d7e8ee504687c5aafafe5a9fd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel +from ..beta_message import BetaMessage + +__all__ = ["BetaMessageBatchSucceededResult"] + + +class BetaMessageBatchSucceededResult(BaseModel): + message: BetaMessage + + type: Literal["succeeded"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/model_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/model_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..fb735e303b45a047bd1d283271b951610373016c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/model_list_params.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, TypedDict + +from ..anthropic_beta_param import AnthropicBetaParam + +__all__ = ["ModelListParams"] + + +class ModelListParams(TypedDict, total=False): + after_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately after this object. + """ + + before_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately before this object. + """ + + lifecycle: List[Literal["active", "deprecated", "retired"]] + """ + Filter the list to models in any of the given lifecycle stages (`active`, + `deprecated`, or `retired`). Up to 3 values. When omitted, the list contains the + `active` and `deprecated` models; `retired` models appear only when `retired` is + requested explicitly. + """ + + limit: int + """Number of items to return per page. + + Defaults to `20`. Ranges from `1` to `1000`. + """ + + betas: List[AnthropicBetaParam] + """Optional header to specify the beta version(s) you want to use.""" + + workspace_id: str + """Optional header to select the Workspace for this request. + + The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). + + Only needed for credentials that can act on more than one Workspace. A + credential that belongs to a specific Workspace may omit it; if sent, it must + match that Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce1f51aa3416ec0bc1102330db51ad21dff9a54e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/__init__.py @@ -0,0 +1,539 @@ +from __future__ import annotations + +from .beta_plugin import BetaPlugin as BetaPlugin +from .beta_api_key import BetaAPIKey as BetaAPIKey +from .beta_rbac_role import BetaRBACRole as BetaRBACRole +from .beta_workspace import BetaWorkspace as BetaWorkspace +from .beta_rbac_group import BetaRBACGroup as BetaRBACGroup +from .beta_spend_limit import BetaSpendLimit as BetaSpendLimit +from .user_list_params import UserListParams as UserListParams +from .beta_external_key import BetaExternalKey as BetaExternalKey +from .beta_spend_summary import BetaSpendSummary as BetaSpendSummary +from .invite_list_params import InviteListParams as InviteListParams +from .plugin_list_params import PluginListParams as PluginListParams +from .user_update_params import UserUpdateParams as UserUpdateParams +from .api_key_list_params import APIKeyListParams as APIKeyListParams +from .beta_analytics_user import BetaAnalyticsUser as BetaAnalyticsUser +from .beta_data_residency import BetaDataResidency as BetaDataResidency +from .beta_deleted_plugin import BetaDeletedPlugin as BetaDeletedPlugin +from .beta_workspace_role import BetaWorkspaceRole as BetaWorkspaceRole +from .webhook_list_params import WebhookListParams as WebhookListParams +from .beta_analytics_actor import BetaAnalyticsActor as BetaAnalyticsActor +from .beta_analytics_order import BetaAnalyticsOrder as BetaAnalyticsOrder +from .beta_analytics_speed import BetaAnalyticsSpeed as BetaAnalyticsSpeed +from .beta_service_account import BetaServiceAccount as BetaServiceAccount +from .invite_create_params import InviteCreateParams as InviteCreateParams +from .plugin_create_params import PluginCreateParams as PluginCreateParams +from .plugin_update_params import PluginUpdateParams as PluginUpdateParams +from .user_remove_response import UserRemoveResponse as UserRemoveResponse +from .api_key_update_params import APIKeyUpdateParams as APIKeyUpdateParams +from .beta_plugin_api_actor import BetaPluginAPIActor as BetaPluginAPIActor +from .beta_plugin_component import BetaPluginComponent as BetaPluginComponent +from .beta_workspace_member import BetaWorkspaceMember as BetaWorkspaceMember +from .rbac_role_list_params import RBACRoleListParams as RBACRoleListParams +from .webhook_create_params import WebhookCreateParams as WebhookCreateParams +from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams +from .workspace_list_params import WorkspaceListParams as WorkspaceListParams +from .beta_organization_user import BetaOrganizationUser as BetaOrganizationUser +from .beta_plugin_owner_user import BetaPluginOwnerUser as BetaPluginOwnerUser +from .beta_plugin_user_actor import BetaPluginUserActor as BetaPluginUserActor +from .beta_scan_failed_error import BetaScanFailedError as BetaScanFailedError +from .invite_delete_response import InviteDeleteResponse as InviteDeleteResponse +from .plugin_retrieve_params import PluginRetrieveParams as PluginRetrieveParams +from .rate_limit_list_params import RateLimitListParams as RateLimitListParams +from .rbac_group_list_params import RBACGroupListParams as RBACGroupListParams +from .spend_limit_set_params import SpendLimitSetParams as SpendLimitSetParams +from .beta_api_key_created_by import BetaAPIKeyCreatedBy as BetaAPIKeyCreatedBy +from .beta_api_key_user_actor import BetaAPIKeyUserActor as BetaAPIKeyUserActor +from .beta_deleted_rbac_group import BetaDeletedRBACGroup as BetaDeletedRBACGroup +from .beta_plugin_marketplace import BetaPluginMarketplace as BetaPluginMarketplace +from .beta_scan_pending_error import BetaScanPendingError as BetaScanPendingError +from .beta_spend_limit_period import BetaSpendLimitPeriod as BetaSpendLimitPeriod +from .spend_limit_list_params import SpendLimitListParams as SpendLimitListParams +from .workspace_create_params import WorkspaceCreateParams as WorkspaceCreateParams +from .workspace_update_params import WorkspaceUpdateParams as WorkspaceUpdateParams +from .beta_analytics_api_actor import BetaAnalyticsAPIActor as BetaAnalyticsAPIActor +from .beta_analytics_cost_type import BetaAnalyticsCostType as BetaAnalyticsCostType +from .beta_claude_tag_settings import BetaClaudeTagSettings as BetaClaudeTagSettings +from .beta_compliance_settings import BetaComplianceSettings as BetaComplianceSettings +from .beta_organization_invite import BetaOrganizationInvite as BetaOrganizationInvite +from .beta_plugin_content_scan import BetaPluginContentScan as BetaPluginContentScan +from .external_key_list_params import ExternalKeyListParams as ExternalKeyListParams +from .rbac_group_create_params import RBACGroupCreateParams as RBACGroupCreateParams +from .rbac_group_update_params import RBACGroupUpdateParams as RBACGroupUpdateParams +from .beta_analytics_actor_type import BetaAnalyticsActorType as BetaAnalyticsActorType +from .beta_analytics_token_type import BetaAnalyticsTokenType as BetaAnalyticsTokenType +from .beta_analytics_user_actor import BetaAnalyticsUserActor as BetaAnalyticsUserActor +from .beta_allowed_inference_geo import BetaAllowedInferenceGeo as BetaAllowedInferenceGeo +from .beta_telemetry_destination import BetaTelemetryDestination as BetaTelemetryDestination +from .external_key_create_params import ExternalKeyCreateParams as ExternalKeyCreateParams +from .external_key_update_params import ExternalKeyUpdateParams as ExternalKeyUpdateParams +from .beta_analytics_chat_metrics import BetaAnalyticsChatMetrics as BetaAnalyticsChatMetrics +from .beta_analytics_service_tier import BetaAnalyticsServiceTier as BetaAnalyticsServiceTier +from .beta_analytics_tool_actions import BetaAnalyticsToolActions as BetaAnalyticsToolActions +from .beta_skill_name_taken_error import BetaSkillNameTakenError as BetaSkillNameTakenError +from .beta_spend_limit_user_actor import BetaSpendLimitUserActor as BetaSpendLimitUserActor +from .beta_spend_limit_user_scope import BetaSpendLimitUserScope as BetaSpendLimitUserScope +from .service_account_list_params import ServiceAccountListParams as ServiceAccountListParams +from .spend_limit_delete_response import SpendLimitDeleteResponse as SpendLimitDeleteResponse +from .beta_analytics_lines_of_code import BetaAnalyticsLinesOfCode as BetaAnalyticsLinesOfCode +from .beta_analytics_user_activity import BetaAnalyticsUserActivity as BetaAnalyticsUserActivity +from .beta_analytics_user_group_by import BetaAnalyticsUserGroupBy as BetaAnalyticsUserGroupBy +from .beta_api_key_workspace_scope import BetaAPIKeyWorkspaceScope as BetaAPIKeyWorkspaceScope +from .beta_aws_external_key_config import BetaAWSExternalKeyConfig as BetaAWSExternalKeyConfig +from .beta_claude_tag_guest_policy import BetaClaudeTagGuestPolicy as BetaClaudeTagGuestPolicy +from .beta_gcp_external_key_config import BetaGCPExternalKeyConfig as BetaGCPExternalKeyConfig +from .beta_organization_rate_limit import BetaOrganizationRateLimit as BetaOrganizationRateLimit +from .beta_plugin_name_taken_error import BetaPluginNameTakenError as BetaPluginNameTakenError +from .external_key_delete_response import ExternalKeyDeleteResponse as ExternalKeyDeleteResponse +from .beta_analytics_context_window import BetaAnalyticsContextWindow as BetaAnalyticsContextWindow +from .beta_analytics_cowork_metrics import BetaAnalyticsCoworkMetrics as BetaAnalyticsCoworkMetrics +from .beta_analytics_design_metrics import BetaAnalyticsDesignMetrics as BetaAnalyticsDesignMetrics +from .beta_analytics_office_metrics import BetaAnalyticsOfficeMetrics as BetaAnalyticsOfficeMetrics +from .beta_analytics_product_filter import BetaAnalyticsProductFilter as BetaAnalyticsProductFilter +from .beta_analytics_skill_activity import BetaAnalyticsSkillActivity as BetaAnalyticsSkillActivity +from .beta_analytics_skill_group_by import BetaAnalyticsSkillGroupBy as BetaAnalyticsSkillGroupBy +from .beta_plugin_target_rbac_group import BetaPluginTargetRBACGroup as BetaPluginTargetRBACGroup +from .service_account_create_params import ServiceAccountCreateParams as ServiceAccountCreateParams +from .service_account_update_params import ServiceAccountUpdateParams as ServiceAccountUpdateParams +from .beta_analytics_cost_users_item import BetaAnalyticsCostUsersItem as BetaAnalyticsCostUsersItem +from .beta_analytics_federated_actor import BetaAnalyticsFederatedActor as BetaAnalyticsFederatedActor +from .beta_analytics_plugin_activity import BetaAnalyticsPluginActivity as BetaAnalyticsPluginActivity +from .beta_analytics_plugin_group_by import BetaAnalyticsPluginGroupBy as BetaAnalyticsPluginGroupBy +from .beta_analytics_science_metrics import BetaAnalyticsScienceMetrics as BetaAnalyticsScienceMetrics +from .beta_analytics_server_tool_use import BetaAnalyticsServerToolUse as BetaAnalyticsServerToolUse +from .beta_azure_external_key_config import BetaAzureExternalKeyConfig as BetaAzureExternalKeyConfig +from .beta_claude_tag_setting_source import BetaClaudeTagSettingSource as BetaClaudeTagSettingSource +from .beta_compliance_settings_state import BetaComplianceSettingsState as BetaComplianceSettingsState +from .beta_no_billing_workspace_role import BetaNoBillingWorkspaceRole as BetaNoBillingWorkspaceRole +from .beta_plugin_owner_organization import BetaPluginOwnerOrganization as BetaPluginOwnerOrganization +from .beta_scan_failed_error_details import BetaScanFailedErrorDetails as BetaScanFailedErrorDetails +from .external_key_validate_response import ExternalKeyValidateResponse as ExternalKeyValidateResponse +from .plugin_marketplace_list_params import PluginMarketplaceListParams as PluginMarketplaceListParams +from .beta_analytics_project_activity import BetaAnalyticsProjectActivity as BetaAnalyticsProjectActivity +from .beta_analytics_project_group_by import BetaAnalyticsProjectGroupBy as BetaAnalyticsProjectGroupBy +from .beta_analytics_usage_users_item import BetaAnalyticsUsageUsersItem as BetaAnalyticsUsageUsersItem +from .beta_api_key_organization_scope import BetaAPIKeyOrganizationScope as BetaAPIKeyOrganizationScope +from .beta_cannot_sign_out_self_error import BetaCannotSignOutSelfError as BetaCannotSignOutSelfError +from .beta_claude_tag_setting_sources import BetaClaudeTagSettingSources as BetaClaudeTagSettingSources +from .beta_plugin_target_organization import BetaPluginTargetOrganization as BetaPluginTargetOrganization +from .beta_registration_pending_error import BetaRegistrationPendingError as BetaRegistrationPendingError +from .beta_scan_pending_error_details import BetaScanPendingErrorDetails as BetaScanPendingErrorDetails +from .beta_analytics_artifact_activity import BetaAnalyticsArtifactActivity as BetaAnalyticsArtifactActivity +from .beta_analytics_artifact_group_by import BetaAnalyticsArtifactGroupBy as BetaAnalyticsArtifactGroupBy +from .beta_analytics_core_code_metrics import BetaAnalyticsCoreCodeMetrics as BetaAnalyticsCoreCodeMetrics +from .beta_analytics_grouped_cost_type import BetaAnalyticsGroupedCostType as BetaAnalyticsGroupedCostType +from .beta_analytics_report_user_actor import BetaAnalyticsReportUserActor as BetaAnalyticsReportUserActor +from .beta_analytics_time_bucket_width import BetaAnalyticsTimeBucketWidth as BetaAnalyticsTimeBucketWidth +from .beta_api_key_scope_missing_error import BetaAPIKeyScopeMissingError as BetaAPIKeyScopeMissingError +from .beta_cannot_sign_out_owner_error import BetaCannotSignOutOwnerError as BetaCannotSignOutOwnerError +from .beta_spend_limit_seat_tier_scope import BetaSpendLimitSeatTierScope as BetaSpendLimitSeatTierScope +from .beta_spend_limit_workspace_scope import BetaSpendLimitWorkspaceScope as BetaSpendLimitWorkspaceScope +from .beta_telemetry_destination_state import BetaTelemetryDestinationState as BetaTelemetryDestinationState +from .compliance_setting_update_params import ComplianceSettingUpdateParams as ComplianceSettingUpdateParams +from .plugin_marketplace_update_params import PluginMarketplaceUpdateParams as PluginMarketplaceUpdateParams +from .beta_analytics_connector_activity import BetaAnalyticsConnectorActivity as BetaAnalyticsConnectorActivity +from .beta_analytics_connector_group_by import BetaAnalyticsConnectorGroupBy as BetaAnalyticsConnectorGroupBy +from .beta_analytics_skill_chat_metrics import BetaAnalyticsSkillChatMetrics as BetaAnalyticsSkillChatMetrics +from .beta_analytics_tool_action_counts import BetaAnalyticsToolActionCounts as BetaAnalyticsToolActionCounts +from .beta_spend_limit_rbac_group_scope import BetaSpendLimitRBACGroupScope as BetaSpendLimitRBACGroupScope +from .beta_spend_limit_usage_tier_scope import BetaSpendLimitUsageTierScope as BetaSpendLimitUsageTierScope +from .beta_spend_limit_user_scope_param import BetaSpendLimitUserScopeParam as BetaSpendLimitUserScopeParam +from .beta_telemetry_destination_traces import BetaTelemetryDestinationTraces as BetaTelemetryDestinationTraces +from .telemetry_destination_list_params import TelemetryDestinationListParams as TelemetryDestinationListParams +from .beta_analytics_claude_code_metrics import BetaAnalyticsClaudeCodeMetrics as BetaAnalyticsClaudeCodeMetrics +from .beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory as BetaAnalyticsClaudeTagCategory +from .beta_api_key_service_account_actor import BetaAPIKeyServiceAccountActor as BetaAPIKeyServiceAccountActor +from .beta_aws_external_key_config_param import BetaAWSExternalKeyConfigParam as BetaAWSExternalKeyConfigParam +from .beta_claude_tag_guest_policy_allow import BetaClaudeTagGuestPolicyAllow as BetaClaudeTagGuestPolicyAllow +from .beta_claude_tag_guest_policy_param import BetaClaudeTagGuestPolicyParam as BetaClaudeTagGuestPolicyParam +from .beta_deleted_telemetry_destination import BetaDeletedTelemetryDestination as BetaDeletedTelemetryDestination +from .beta_gcp_external_key_config_param import BetaGCPExternalKeyConfigParam as BetaGCPExternalKeyConfigParam +from .beta_organization_rate_limit_value import BetaOrganizationRateLimitValue as BetaOrganizationRateLimitValue +from .beta_organization_webhook_endpoint import BetaOrganizationWebhookEndpoint as BetaOrganizationWebhookEndpoint +from .plugin_marketplace_retrieve_params import PluginMarketplaceRetrieveParams as PluginMarketplaceRetrieveParams +from .beta_analytics_cost_bucketed_result import BetaAnalyticsCostBucketedResult as BetaAnalyticsCostBucketedResult +from .beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter as BetaAnalyticsInferenceGeoFilter +from .beta_analytics_skill_cowork_metrics import BetaAnalyticsSkillCoworkMetrics as BetaAnalyticsSkillCoworkMetrics +from .beta_analytics_skill_office_metrics import BetaAnalyticsSkillOfficeMetrics as BetaAnalyticsSkillOfficeMetrics +from .beta_skill_name_taken_error_details import BetaSkillNameTakenErrorDetails as BetaSkillNameTakenErrorDetails +from .beta_spend_limit_organization_scope import BetaSpendLimitOrganizationScope as BetaSpendLimitOrganizationScope +from .telemetry_destination_create_params import TelemetryDestinationCreateParams as TelemetryDestinationCreateParams +from .telemetry_destination_update_params import TelemetryDestinationUpdateParams as TelemetryDestinationUpdateParams +from .beta_analytics_plugin_cowork_metrics import BetaAnalyticsPluginCoworkMetrics as BetaAnalyticsPluginCoworkMetrics +from .beta_analytics_service_account_actor import BetaAnalyticsServiceAccountActor as BetaAnalyticsServiceAccountActor +from .beta_analytics_usage_bucketed_result import BetaAnalyticsUsageBucketedResult as BetaAnalyticsUsageBucketedResult +from .beta_analytics_usage_cost_sort_order import BetaAnalyticsUsageCostSortOrder as BetaAnalyticsUsageCostSortOrder +from .beta_azure_external_key_config_param import BetaAzureExternalKeyConfigParam as BetaAzureExternalKeyConfigParam +from .beta_compliance_settings_state_param import BetaComplianceSettingsStateParam as BetaComplianceSettingsStateParam +from .beta_plugin_name_taken_error_details import BetaPluginNameTakenErrorDetails as BetaPluginNameTakenErrorDetails +from .beta_analytics_connector_chat_metrics import ( + BetaAnalyticsConnectorChatMetrics as BetaAnalyticsConnectorChatMetrics, +) +from .beta_analytics_office_product_metrics import ( + BetaAnalyticsOfficeProductMetrics as BetaAnalyticsOfficeProductMetrics, +) +from .beta_claude_tag_guest_policy_restrict import BetaClaudeTagGuestPolicyRestrict as BetaClaudeTagGuestPolicyRestrict +from .beta_claude_tag_settings_create_param import BetaClaudeTagSettingsCreateParam as BetaClaudeTagSettingsCreateParam +from .beta_claude_tag_settings_update_param import BetaClaudeTagSettingsUpdateParam as BetaClaudeTagSettingsUpdateParam +from .beta_external_key_attached_attachment import ( + BetaExternalKeyAttachedAttachment as BetaExternalKeyAttachedAttachment, +) +from .beta_service_account_workspace_member import ( + BetaServiceAccountWorkspaceMember as BetaServiceAccountWorkspaceMember, +) +from .beta_spend_limit_scoped_api_key_actor import BetaSpendLimitScopedAPIKeyActor as BetaSpendLimitScopedAPIKeyActor +from .beta_telemetry_destination_workspaces import ( + BetaTelemetryDestinationWorkspaces as BetaTelemetryDestinationWorkspaces, +) +from .beta_analytics_cost_report_time_bucket import ( + BetaAnalyticsCostReportTimeBucket as BetaAnalyticsCostReportTimeBucket, +) +from .beta_claude_tag_default_setting_source import ( + BetaClaudeTagDefaultSettingSource as BetaClaudeTagDefaultSettingSource, +) +from .beta_compliance_settings_state_enabled import ( + BetaComplianceSettingsStateEnabled as BetaComplianceSettingsStateEnabled, +) +from .beta_new_organization_webhook_endpoint import ( + BetaNewOrganizationWebhookEndpoint as BetaNewOrganizationWebhookEndpoint, +) +from .beta_plugin_target_organization_member import ( + BetaPluginTargetOrganizationMember as BetaPluginTargetOrganizationMember, +) +from .beta_spend_limit_workspace_scope_param import ( + BetaSpendLimitWorkspaceScopeParam as BetaSpendLimitWorkspaceScopeParam, +) +from .beta_telemetry_destination_test_result import ( + BetaTelemetryDestinationTestResult as BetaTelemetryDestinationTestResult, +) +from .beta_analytics_connector_cowork_metrics import ( + BetaAnalyticsConnectorCoworkMetrics as BetaAnalyticsConnectorCoworkMetrics, +) +from .beta_analytics_connector_office_metrics import ( + BetaAnalyticsConnectorOfficeMetrics as BetaAnalyticsConnectorOfficeMetrics, +) +from .beta_analytics_federated_actor_provider import ( + BetaAnalyticsFederatedActorProvider as BetaAnalyticsFederatedActorProvider, +) +from .beta_analytics_usage_cost_inference_geo import ( + BetaAnalyticsUsageCostInferenceGeo as BetaAnalyticsUsageCostInferenceGeo, +) +from .beta_analytics_usage_report_time_bucket import ( + BetaAnalyticsUsageReportTimeBucket as BetaAnalyticsUsageReportTimeBucket, +) +from .beta_cannot_sign_out_self_error_details import ( + BetaCannotSignOutSelfErrorDetails as BetaCannotSignOutSelfErrorDetails, +) +from .beta_compliance_settings_state_disabled import ( + BetaComplianceSettingsStateDisabled as BetaComplianceSettingsStateDisabled, +) +from .beta_data_residency_create_config_param import ( + BetaDataResidencyCreateConfigParam as BetaDataResidencyCreateConfigParam, +) +from .beta_data_residency_update_config_param import ( + BetaDataResidencyUpdateConfigParam as BetaDataResidencyUpdateConfigParam, +) +from .beta_external_key_unattached_attachment import ( + BetaExternalKeyUnattachedAttachment as BetaExternalKeyUnattachedAttachment, +) +from .beta_registration_pending_error_details import ( + BetaRegistrationPendingErrorDetails as BetaRegistrationPendingErrorDetails, +) +from .beta_telemetry_destination_content_mode import ( + BetaTelemetryDestinationContentMode as BetaTelemetryDestinationContentMode, +) +from .beta_telemetry_destination_state_params import ( + BetaTelemetryDestinationStateParams as BetaTelemetryDestinationStateParams, +) +from .beta_telemetry_destination_test_failure import ( + BetaTelemetryDestinationTestFailure as BetaTelemetryDestinationTestFailure, +) +from .beta_telemetry_destination_test_success import ( + BetaTelemetryDestinationTestSuccess as BetaTelemetryDestinationTestSuccess, +) +from .beta_analytics_skill_claude_code_metrics import ( + BetaAnalyticsSkillClaudeCodeMetrics as BetaAnalyticsSkillClaudeCodeMetrics, +) +from .beta_analytics_usage_cost_product_filter import ( + BetaAnalyticsUsageCostProductFilter as BetaAnalyticsUsageCostProductFilter, +) +from .beta_api_key_scope_missing_error_details import ( + BetaAPIKeyScopeMissingErrorDetails as BetaAPIKeyScopeMissingErrorDetails, +) +from .beta_cannot_sign_out_owner_error_details import ( + BetaCannotSignOutOwnerErrorDetails as BetaCannotSignOutOwnerErrorDetails, +) +from .beta_cannot_sign_out_primary_owner_error import ( + BetaCannotSignOutPrimaryOwnerError as BetaCannotSignOutPrimaryOwnerError, +) +from .beta_claude_tag_guest_policy_allow_param import ( + BetaClaudeTagGuestPolicyAllowParam as BetaClaudeTagGuestPolicyAllowParam, +) +from .beta_claude_tag_writes_not_enabled_error import ( + BetaClaudeTagWritesNotEnabledError as BetaClaudeTagWritesNotEnabledError, +) +from .beta_organization_rate_limit_batch_group import ( + BetaOrganizationRateLimitBatchGroup as BetaOrganizationRateLimitBatchGroup, +) +from .beta_organization_rate_limit_files_group import ( + BetaOrganizationRateLimitFilesGroup as BetaOrganizationRateLimitFilesGroup, +) +from .beta_organization_rate_limit_model_group import ( + BetaOrganizationRateLimitModelGroup as BetaOrganizationRateLimitModelGroup, +) +from .beta_organization_webhook_endpoint_state import ( + BetaOrganizationWebhookEndpointState as BetaOrganizationWebhookEndpointState, +) +from .beta_telemetry_destination_state_enabled import ( + BetaTelemetryDestinationStateEnabled as BetaTelemetryDestinationStateEnabled, +) +from .beta_telemetry_destination_test_response import ( + BetaTelemetryDestinationTestResponse as BetaTelemetryDestinationTestResponse, +) +from .beta_telemetry_destination_traces_params import ( + BetaTelemetryDestinationTracesParams as BetaTelemetryDestinationTracesParams, +) +from .beta_analytics_plugin_claude_code_metrics import ( + BetaAnalyticsPluginClaudeCodeMetrics as BetaAnalyticsPluginClaudeCodeMetrics, +) +from .beta_cannot_sign_out_managed_member_error import ( + BetaCannotSignOutManagedMemberError as BetaCannotSignOutManagedMemberError, +) +from .beta_claude_tag_guest_policy_channel_only import ( + BetaClaudeTagGuestPolicyChannelOnly as BetaClaudeTagGuestPolicyChannelOnly, +) +from .beta_claude_tag_slack_channel_identifiers import ( + BetaClaudeTagSlackChannelIdentifiers as BetaClaudeTagSlackChannelIdentifiers, +) +from .beta_organization_rate_limit_skills_group import ( + BetaOrganizationRateLimitSkillsGroup as BetaOrganizationRateLimitSkillsGroup, +) +from .beta_plugin_marketplace_validation_report import ( + BetaPluginMarketplaceValidationReport as BetaPluginMarketplaceValidationReport, +) +from .beta_spend_limit_organization_scope_param import ( + BetaSpendLimitOrganizationScopeParam as BetaSpendLimitOrganizationScopeParam, +) +from .beta_telemetry_destination_state_disabled import ( + BetaTelemetryDestinationStateDisabled as BetaTelemetryDestinationStateDisabled, +) +from .beta_telemetry_destination_workspaces_all import ( + BetaTelemetryDestinationWorkspacesAll as BetaTelemetryDestinationWorkspacesAll, +) +from .beta_analytics_chat_cowork_unified_metrics import ( + BetaAnalyticsChatCoworkUnifiedMetrics as BetaAnalyticsChatCoworkUnifiedMetrics, +) +from .beta_analytics_single_day_activity_summary import ( + BetaAnalyticsSingleDayActivitySummary as BetaAnalyticsSingleDayActivitySummary, +) +from .beta_deleted_organization_webhook_endpoint import ( + BetaDeletedOrganizationWebhookEndpoint as BetaDeletedOrganizationWebhookEndpoint, +) +from .beta_telemetry_destination_delivery_health import ( + BetaTelemetryDestinationDeliveryHealth as BetaTelemetryDestinationDeliveryHealth, +) +from .beta_telemetry_destination_disabled_reason import ( + BetaTelemetryDestinationDisabledReason as BetaTelemetryDestinationDisabledReason, +) +from .plugin_marketplace_validate_archive_params import ( + PluginMarketplaceValidateArchiveParams as PluginMarketplaceValidateArchiveParams, +) +from .beta_analytics_federated_actor_aws_provider import ( + BetaAnalyticsFederatedActorAWSProvider as BetaAnalyticsFederatedActorAWSProvider, +) +from .beta_analytics_federated_actor_gcp_provider import ( + BetaAnalyticsFederatedActorGCPProvider as BetaAnalyticsFederatedActorGCPProvider, +) +from .beta_analytics_skill_office_product_metrics import ( + BetaAnalyticsSkillOfficeProductMetrics as BetaAnalyticsSkillOfficeProductMetrics, +) +from .beta_cannot_sign_out_membership_admin_error import ( + BetaCannotSignOutMembershipAdminError as BetaCannotSignOutMembershipAdminError, +) +from .beta_claude_tag_guest_policy_restrict_param import ( + BetaClaudeTagGuestPolicyRestrictParam as BetaClaudeTagGuestPolicyRestrictParam, +) +from .beta_claude_tag_slack_workspace_identifiers import ( + BetaClaudeTagSlackWorkspaceIdentifiers as BetaClaudeTagSlackWorkspaceIdentifiers, +) +from .beta_spend_limit_organization_service_scope import ( + BetaSpendLimitOrganizationServiceScope as BetaSpendLimitOrganizationServiceScope, +) +from .beta_analytics_connector_claude_code_metrics import ( + BetaAnalyticsConnectorClaudeCodeMetrics as BetaAnalyticsConnectorClaudeCodeMetrics, +) +from .beta_analytics_federated_actor_oidc_provider import ( + BetaAnalyticsFederatedActorOIDCProvider as BetaAnalyticsFederatedActorOIDCProvider, +) +from .beta_cannot_sign_out_privileged_member_error import ( + BetaCannotSignOutPrivilegedMemberError as BetaCannotSignOutPrivilegedMemberError, +) +from .beta_claude_tag_slack_channel_setting_source import ( + BetaClaudeTagSlackChannelSettingSource as BetaClaudeTagSlackChannelSettingSource, +) +from .beta_claude_tag_slack_default_setting_source import ( + BetaClaudeTagSlackDefaultSettingSource as BetaClaudeTagSlackDefaultSettingSource, +) +from .beta_compliance_settings_state_enabled_param import ( + BetaComplianceSettingsStateEnabledParam as BetaComplianceSettingsStateEnabledParam, +) +from .beta_telemetry_destination_workspaces_params import ( + BetaTelemetryDestinationWorkspacesParams as BetaTelemetryDestinationWorkspacesParams, +) +from .beta_analytics_federated_actor_azure_provider import ( + BetaAnalyticsFederatedActorAzureProvider as BetaAnalyticsFederatedActorAzureProvider, +) +from .beta_compliance_settings_state_disabled_param import ( + BetaComplianceSettingsStateDisabledParam as BetaComplianceSettingsStateDisabledParam, +) +from .beta_organization_rate_limit_web_search_group import ( + BetaOrganizationRateLimitWebSearchGroup as BetaOrganizationRateLimitWebSearchGroup, +) +from .beta_telemetry_destination_workspaces_exclude import ( + BetaTelemetryDestinationWorkspacesExclude as BetaTelemetryDestinationWorkspacesExclude, +) +from .beta_telemetry_destination_workspaces_include import ( + BetaTelemetryDestinationWorkspacesInclude as BetaTelemetryDestinationWorkspacesInclude, +) +from .plugin_marketplace_validate_repository_params import ( + PluginMarketplaceValidateRepositoryParams as PluginMarketplaceValidateRepositoryParams, +) +from .beta_claude_tag_slack_workspace_setting_source import ( + BetaClaudeTagSlackWorkspaceSettingSource as BetaClaudeTagSlackWorkspaceSettingSource, +) +from .beta_compliance_configuration_restricted_error import ( + BetaComplianceConfigurationRestrictedError as BetaComplianceConfigurationRestrictedError, +) +from .beta_organization_rate_limit_token_count_group import ( + BetaOrganizationRateLimitTokenCountGroup as BetaOrganizationRateLimitTokenCountGroup, +) +from .beta_analytics_chat_cowork_unified_chat_metrics import ( + BetaAnalyticsChatCoworkUnifiedChatMetrics as BetaAnalyticsChatCoworkUnifiedChatMetrics, +) +from .beta_analytics_connector_office_product_metrics import ( + BetaAnalyticsConnectorOfficeProductMetrics as BetaAnalyticsConnectorOfficeProductMetrics, +) +from .beta_claude_tag_guest_policy_channel_only_param import ( + BetaClaudeTagGuestPolicyChannelOnlyParam as BetaClaudeTagGuestPolicyChannelOnlyParam, +) +from .beta_claude_tag_slack_channel_identifiers_param import ( + BetaClaudeTagSlackChannelIdentifiersParam as BetaClaudeTagSlackChannelIdentifiersParam, +) +from .beta_plugin_marketplace_validation_plugin_error import ( + BetaPluginMarketplaceValidationPluginError as BetaPluginMarketplaceValidationPluginError, +) +from .beta_telemetry_destination_state_enabled_params import ( + BetaTelemetryDestinationStateEnabledParams as BetaTelemetryDestinationStateEnabledParams, +) +from .beta_analytics_skill_chat_cowork_unified_metrics import ( + BetaAnalyticsSkillChatCoworkUnifiedMetrics as BetaAnalyticsSkillChatCoworkUnifiedMetrics, +) +from .beta_cannot_sign_out_primary_owner_error_details import ( + BetaCannotSignOutPrimaryOwnerErrorDetails as BetaCannotSignOutPrimaryOwnerErrorDetails, +) +from .beta_claude_tag_writes_not_enabled_error_details import ( + BetaClaudeTagWritesNotEnabledErrorDetails as BetaClaudeTagWritesNotEnabledErrorDetails, +) +from .beta_slack_channel_set_up_settings_refused_error import ( + BetaSlackChannelSetUpSettingsRefusedError as BetaSlackChannelSetUpSettingsRefusedError, +) +from .beta_telemetry_destination_state_disabled_params import ( + BetaTelemetryDestinationStateDisabledParams as BetaTelemetryDestinationStateDisabledParams, +) +from .beta_telemetry_destination_workspaces_all_params import ( + BetaTelemetryDestinationWorkspacesAllParams as BetaTelemetryDestinationWorkspacesAllParams, +) +from .beta_analytics_plugin_chat_cowork_unified_metrics import ( + BetaAnalyticsPluginChatCoworkUnifiedMetrics as BetaAnalyticsPluginChatCoworkUnifiedMetrics, +) +from .beta_cannot_sign_out_managed_member_error_details import ( + BetaCannotSignOutManagedMemberErrorDetails as BetaCannotSignOutManagedMemberErrorDetails, +) +from .beta_claude_tag_slack_grid_channel_setting_source import ( + BetaClaudeTagSlackGridChannelSettingSource as BetaClaudeTagSlackGridChannelSettingSource, +) +from .beta_organization_webhook_endpoint_signing_secret import ( + BetaOrganizationWebhookEndpointSigningSecret as BetaOrganizationWebhookEndpointSigningSecret, +) +from .beta_plugin_marketplace_validation_plugin_warning import ( + BetaPluginMarketplaceValidationPluginWarning as BetaPluginMarketplaceValidationPluginWarning, +) +from .beta_slack_channel_set_up_settings_conflict_error import ( + BetaSlackChannelSetUpSettingsConflictError as BetaSlackChannelSetUpSettingsConflictError, +) +from .beta_telemetry_destination_disabled_reason_caller import ( + BetaTelemetryDestinationDisabledReasonCaller as BetaTelemetryDestinationDisabledReasonCaller, +) +from .beta_plugin_marketplace_validation_plugin_warnings import ( + BetaPluginMarketplaceValidationPluginWarnings as BetaPluginMarketplaceValidationPluginWarnings, +) +from .beta_analytics_chat_cowork_unified_sessions_metrics import ( + BetaAnalyticsChatCoworkUnifiedSessionsMetrics as BetaAnalyticsChatCoworkUnifiedSessionsMetrics, +) +from .beta_cannot_sign_out_membership_admin_error_details import ( + BetaCannotSignOutMembershipAdminErrorDetails as BetaCannotSignOutMembershipAdminErrorDetails, +) +from .beta_claude_tag_slack_parent_channel_setting_source import ( + BetaClaudeTagSlackParentChannelSettingSource as BetaClaudeTagSlackParentChannelSettingSource, +) +from .beta_telemetry_destination_disabled_reason_redirect import ( + BetaTelemetryDestinationDisabledReasonRedirect as BetaTelemetryDestinationDisabledReasonRedirect, +) +from .beta_analytics_connector_chat_cowork_unified_metrics import ( + BetaAnalyticsConnectorChatCoworkUnifiedMetrics as BetaAnalyticsConnectorChatCoworkUnifiedMetrics, +) +from .beta_cannot_sign_out_privileged_member_error_details import ( + BetaCannotSignOutPrivilegedMemberErrorDetails as BetaCannotSignOutPrivilegedMemberErrorDetails, +) +from .beta_spend_limits_admin_api_writes_not_enabled_error import ( + BetaSpendLimitsAdminAPIWritesNotEnabledError as BetaSpendLimitsAdminAPIWritesNotEnabledError, +) +from .beta_telemetry_destination_workspaces_exclude_params import ( + BetaTelemetryDestinationWorkspacesExcludeParams as BetaTelemetryDestinationWorkspacesExcludeParams, +) +from .beta_telemetry_destination_workspaces_include_params import ( + BetaTelemetryDestinationWorkspacesIncludeParams as BetaTelemetryDestinationWorkspacesIncludeParams, +) +from .beta_analytics_skill_chat_cowork_unified_chat_metrics import ( + BetaAnalyticsSkillChatCoworkUnifiedChatMetrics as BetaAnalyticsSkillChatCoworkUnifiedChatMetrics, +) +from .beta_organization_level_scoped_api_key_required_error import ( + BetaOrganizationLevelScopedAPIKeyRequiredError as BetaOrganizationLevelScopedAPIKeyRequiredError, +) +from .beta_slack_channel_set_up_environment_not_found_error import ( + BetaSlackChannelSetUpEnvironmentNotFoundError as BetaSlackChannelSetUpEnvironmentNotFoundError, +) +from .beta_compliance_configuration_restricted_error_details import ( + BetaComplianceConfigurationRestrictedErrorDetails as BetaComplianceConfigurationRestrictedErrorDetails, +) +from .beta_slack_channel_set_up_settings_refused_error_details import ( + BetaSlackChannelSetUpSettingsRefusedErrorDetails as BetaSlackChannelSetUpSettingsRefusedErrorDetails, +) +from .beta_analytics_connector_chat_cowork_unified_chat_metrics import ( + BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics as BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics, +) +from .beta_analytics_skill_chat_cowork_unified_sessions_metrics import ( + BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics as BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics, +) +from .beta_slack_channel_set_up_settings_conflict_error_details import ( + BetaSlackChannelSetUpSettingsConflictErrorDetails as BetaSlackChannelSetUpSettingsConflictErrorDetails, +) +from .beta_telemetry_destination_disabled_reason_invalid_address import ( + BetaTelemetryDestinationDisabledReasonInvalidAddress as BetaTelemetryDestinationDisabledReasonInvalidAddress, +) +from .beta_spend_limits_admin_api_writes_not_enabled_error_details import ( + BetaSpendLimitsAdminAPIWritesNotEnabledErrorDetails as BetaSpendLimitsAdminAPIWritesNotEnabledErrorDetails, +) +from .beta_telemetry_destination_disabled_reason_sustained_failure import ( + BetaTelemetryDestinationDisabledReasonSustainedFailure as BetaTelemetryDestinationDisabledReasonSustainedFailure, +) +from .beta_analytics_connector_chat_cowork_unified_sessions_metrics import ( + BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics as BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics, +) +from .beta_organization_level_scoped_api_key_required_error_details import ( + BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails as BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails, +) +from .beta_slack_channel_set_up_environment_not_found_error_details import ( + BetaSlackChannelSetUpEnvironmentNotFoundErrorDetails as BetaSlackChannelSetUpEnvironmentNotFoundErrorDetails, +) diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b1d7a5056f7ecb4e72554942145ac0b42be61106 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/__init__.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from .cost_list_params import CostListParams as CostListParams +from .user_list_params import UserListParams as UserListParams +from .skill_list_params import SkillListParams as SkillListParams +from .usage_list_params import UsageListParams as UsageListParams +from .plugin_list_params import PluginListParams as PluginListParams +from .summary_list_params import SummaryListParams as SummaryListParams +from .artifact_list_params import ArtifactListParams as ArtifactListParams +from .connector_list_params import ConnectorListParams as ConnectorListParams +from .cost_report_list_params import CostReportListParams as CostReportListParams +from .beta_analytics_cost_item import BetaAnalyticsCostItem as BetaAnalyticsCostItem +from .usage_report_list_params import UsageReportListParams as UsageReportListParams +from .beta_analytics_cost_group import BetaAnalyticsCostGroup as BetaAnalyticsCostGroup +from .beta_analytics_usage_item import BetaAnalyticsUsageItem as BetaAnalyticsUsageItem +from .beta_analytics_usage_group import BetaAnalyticsUsageGroup as BetaAnalyticsUsageGroup +from .beta_analytics_cost_metrics import BetaAnalyticsCostMetrics as BetaAnalyticsCostMetrics +from .beta_analytics_cost_group_by import BetaAnalyticsCostGroupBy as BetaAnalyticsCostGroupBy +from .beta_analytics_cost_order_by import BetaAnalyticsCostOrderBy as BetaAnalyticsCostOrderBy +from .beta_analytics_usage_metrics import BetaAnalyticsUsageMetrics as BetaAnalyticsUsageMetrics +from .user_cost_report_list_params import UserCostReportListParams as UserCostReportListParams +from .beta_analytics_usage_group_by import BetaAnalyticsUsageGroupBy as BetaAnalyticsUsageGroupBy +from .beta_analytics_usage_order_by import BetaAnalyticsUsageOrderBy as BetaAnalyticsUsageOrderBy +from .user_usage_report_list_params import UserUsageReportListParams as UserUsageReportListParams diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d48db4f9f85e1752cf424c49ee18a6907c3f160 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/__init__.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88b72fbdbc5103520a4a1d6806aab8d6742c4580 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/__init__.py @@ -0,0 +1,3 @@ +from __future__ import annotations + +from .project_list_params import ProjectListParams as ProjectListParams diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/project_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/project_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..e90bfed538466a0094049e12e137ae0f57a4af61 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/apps/chat/project_list_params.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import TypedDict + +from ......._types import SequenceNotStr +from ....beta_analytics_order import BetaAnalyticsOrder +from ....beta_analytics_project_group_by import BetaAnalyticsProjectGroupBy + +__all__ = ["ProjectListParams"] + + +class ProjectListParams(TypedDict, total=False): + date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + The day to get project activity for. Data is typically available with a 1-day + lag (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive); only valid with `starting_date`. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day), so this can be at most today — + which is also the default when omitted, resolved once when the first page is + served and reused for the rest of the pagination sequence. At most 366 days + after `starting_date`. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: `project_id`, + `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id + (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as + emitted in responses and by the spend-limits API) or a bare group UUID, and + matches users who held the group at any point during each covered UTC day + (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as + emitted in responses. An unsupported dimension returns 400. At most 100 entries. + """ + + group_by: Optional[List[BetaAnalyticsProjectGroupBy]] + """Dimensions to break results out by (e.g. + + `group_by[]=user_id`). Supported on this endpoint: `rbac_group_id`, `user_id`. + Grouped rows carry the requested dimension values as additional fields and + paginate like ungrouped responses via `next_page`; an unsupported dimension + returns 400. `rbac_group_id` attributes a user to every group they held at any + point during each covered UTC day, so grouped rows are not an exclusive + partition and can sum above org-level totals. At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100).""" + + order: Optional[BetaAnalyticsOrder] + """Sort direction: `asc` or `desc`. + + Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` + names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's + default sort field when `order_by` is omitted. + """ + + order_by: Optional[str] + """Sort field. + + Restricted to the endpoint's sort column plus its rankable metrics (metrics + default to descending; a few metrics rank in date-range mode only, per the + endpoint's documented orderable set). + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + starting_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + Start of a date range (inclusive). Enables rollup mode: one row per entity + aggregated over the whole range — addable counters are summed across days, and a + distinct count is never summed where summing could double-count (a field's range + value is recomputed exactly over the window, approximate via HLL with typical + error under 2%, null, or — for the creation-event counts, whose per-day values + cannot overlap — a per-day sum that is itself exact; each field's own + description says which). Use either `date` or `starting_date`, not both. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day) and may be revised by a few + percent over the following days. No earlier than 2026-01-01. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/artifact_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/artifact_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..76186cae21f84e63138b002fd45d344308c11dd7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/artifact_list_params.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_artifact_group_by import BetaAnalyticsArtifactGroupBy + +__all__ = ["ArtifactListParams"] + + +class ArtifactListParams(TypedDict, total=False): + date: Required[Union[str, datetime.date]] + """UTC date in YYYY-MM-DD format. + + The day to get artifact activity for. Data is typically available with a 1-day + lag (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: + `artifact_type`, `is_shared`, `product`, `rbac_group_id`, `user_id`. Value + forms: `artifact_type` is a canonical artifact MIME type (e.g. `text/markdown`) + or `other`; `is_shared` is `true` or `false`; `product` is + `chat_cowork_unified`, `chat`, `claude_code`, or `cowork` (the surfaces that + create artifacts); `rbac_group_id` takes the tagged id (`rbac_group_...`, as + emitted in responses and by the spend-limits API) or a bare group UUID, and + matches users who held the group at any point during each covered UTC day + (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as + emitted in responses. An unsupported dimension returns 400. At most 100 entries. + `chat_cowork_unified` is accepted as a `product` value only where Chat and + Cowork unified is available. + """ + + group_by: Optional[List[BetaAnalyticsArtifactGroupBy]] + """Dimensions to break results out by: `product`, `user_id` and/or `rbac_group_id`. + + The ungrouped artifact-type cube is finite and returned in full; grouped queries + multiply the cube and paginate via `next_page`. `product` takes the values + `chat_cowork_unified`, `chat`, `claude_code`, or `cowork` (the surfaces that + create artifacts). `rbac_group_id` attributes a user to every group they held at + any point during the requested UTC day, so grouped rows are not an exclusive + partition. At most 100 entries. + """ + + limit: Optional[int] + """Maximum rows to return (1-1000, default 100). + + The ungrouped artifact-type cube is finite and returned in full; `limit` is the + page size only when `group_by[]` multiplies the cube. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field. + + Only valid with `group_by[]` — the ungrouped cube is never paginated. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group.py new file mode 100644 index 0000000000000000000000000000000000000000..fa7ecb7ea2fae8f049dec28b073f496d8c72f3ca --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group.py @@ -0,0 +1,184 @@ +from typing import Optional + +from ....._models import BaseModel +from ..beta_analytics_actor import BetaAnalyticsActor +from ..beta_analytics_speed import BetaAnalyticsSpeed +from ..beta_analytics_actor_type import BetaAnalyticsActorType +from ..beta_analytics_token_type import BetaAnalyticsTokenType +from ..beta_analytics_service_tier import BetaAnalyticsServiceTier +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_grouped_cost_type import BetaAnalyticsGroupedCostType +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_usage_cost_inference_geo import BetaAnalyticsUsageCostInferenceGeo + +__all__ = ["BetaAnalyticsCostGroup"] + + +class BetaAnalyticsCostGroup(BaseModel): + """ + The dimension values one cost row is broken out by, including + `cost_type` and `token_type`. + """ + + actor: Optional[BetaAnalyticsActor] = None + """ + The identity the usage is attributed to: the user if one is attributed, else the + service account, else the federated (cloud-platform) identity, else the API key. + Populated only when `actor` is in `group_by[]`; null for usage with no + attributable identity, and for users' and federated identities' usage when the + reader is a member who can see only some workspaces. Distinct identities the + server cannot render also read null, each as its own row. + """ + + actor_type: Optional[BetaAnalyticsActorType] = None + """ + Kind of identity the usage is attributed to; matches `actor.type` when `actor` + is set. Populated only when `actor_type` is in `group_by[]`. + """ + + agent_id: Optional[str] = None + """Claude Managed Agents agent whose session incurred the usage. + + Populated only when `agent_id` is in `group_by[]`; null for usage outside a + managed session. + """ + + api_key_id: Optional[str] = None + """ + API key that authenticated the requests, as a tagged API key ID, whichever + identity `actor` resolves to. Populated only when `api_key_id` is in + `group_by[]`; null for usage not authenticated by an API key. + """ + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + cost_type: Optional[BetaAnalyticsGroupedCostType] = None + """Cost component breakdown; null when returning the combined total.""" + + deployment_id: Optional[str] = None + """Deployment that started the Claude Managed Agents session. + + Populated only when `deployment_id` is in `group_by[]`; null for usage outside a + managed session and for sessions no deployment started. + """ + + environment_id: Optional[str] = None + """Claude Managed Agents environment the session ran in. + + Populated only when `environment_id` is in `group_by[]`; null for usage outside + a managed session. + """ + + inference_geo: Optional[BetaAnalyticsUsageCostInferenceGeo] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude_tag`, and `chat_cowork_unified`. `claude_tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + service_tier: Optional[BetaAnalyticsServiceTier] = None + """Service tier the usage was served at. + + Populated only when `service_tier` is in `group_by[]`; null for usage with no + service tier (for example, code execution) and for Claude Enterprise usage. + """ + + session_id: Optional[str] = None + """Claude Managed Agents session that incurred the usage. + + Populated only when `session_id` is in `group_by[]`; null for usage outside a + managed session. + """ + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[BetaAnalyticsSpeed] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + token_type: Optional[BetaAnalyticsTokenType] = None + """Token type when `cost_type` is `tokens`; null otherwise.""" + + user_profile_id: Optional[str] = None + """User profile the usage was attributed to, as a tagged `uprof_` ID. + + Populated only when `user_profile_id` is in `group_by[]`; null for usage that + named no profile and for Claude Enterprise usage. + """ + + workspace_id: Optional[str] = None + """ + Workspace the usage occurred in, as a tagged workspace ID, including the + organization's default workspace. Populated only when `workspace_id` is in + `group_by[]`; null for Claude Enterprise usage. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..bc466f17768e0de4ad0eb273598fecbccef1a30c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_group_by.py @@ -0,0 +1,27 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsCostGroupBy"] + +BetaAnalyticsCostGroupBy: TypeAlias = Literal[ + "actor", + "actor_type", + "agent_id", + "api_key_id", + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "cost_type", + "deployment_id", + "environment_id", + "inference_geo", + "model", + "product", + "rbac_group_id", + "service_tier", + "session_id", + "slack_channel_id", + "speed", + "token_type", + "user_profile_id", + "workspace_id", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_item.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_item.py new file mode 100644 index 0000000000000000000000000000000000000000..1611a54c4a23da26c7fe35d36a0690192e8380a8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_item.py @@ -0,0 +1,31 @@ +from datetime import datetime + +from ....._models import BaseModel +from .beta_analytics_cost_group import BetaAnalyticsCostGroup +from .beta_analytics_cost_metrics import BetaAnalyticsCostMetrics + +__all__ = ["BetaAnalyticsCostItem"] + + +class BetaAnalyticsCostItem(BaseModel): + cost: BetaAnalyticsCostMetrics + """Cost for this row.""" + + ending_at: datetime + """ + End of the period this row covers (exclusive), as an RFC 3339 UTC timestamp: the + end of the row's time bucket when a time-bucket width is set; otherwise the + requested `ending_at` (or, when omitted, the earlier of now and `starting_at` + plus 31 days) rounded down to the hour, because without a time bucket the report + covers whole hours. + """ + + group: BetaAnalyticsCostGroup + """The dimension values this row's cost is broken out by.""" + + starting_at: datetime + """ + Start of the period this row covers (inclusive), as an RFC 3339 UTC timestamp: + the start of the row's time bucket when a time-bucket width is set, otherwise + the requested `starting_at` rounded down to the hour. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..bf58ad4206e1786ef30edbc1959b1fc2f10cd24e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_metrics.py @@ -0,0 +1,27 @@ +from typing import Optional + +from ....._models import BaseModel + +__all__ = ["BetaAnalyticsCostMetrics"] + + +class BetaAnalyticsCostMetrics(BaseModel): + """The cost of one row.""" + + amount: str + """Amount (post-discount, pre-credit) in fractional cents (minor units).""" + + currency: str + """Currency code for the cost amount. Currently always `"USD"`.""" + + list_amount: str + """List-price amount (pre-discount) in fractional cents.""" + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + Null when `group_by` includes `cost_type` or `token_type` (the count has no + per-component attribution; read it from the ungrouped response). For sandbox / + code-execution events, this counts execution spans rather than HTTP requests + (these rows surface with `product: null`). + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_order_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_order_by.py new file mode 100644 index 0000000000000000000000000000000000000000..d8345b7b1f3169eb00f0b70f088a3018e80a79a5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_cost_order_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsCostOrderBy"] + +BetaAnalyticsCostOrderBy: TypeAlias = Literal["amount", "list_amount", "time"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group.py new file mode 100644 index 0000000000000000000000000000000000000000..6b2ac4a206a3358eddc4d44c05b5ebf092b69916 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group.py @@ -0,0 +1,176 @@ +from typing import Optional + +from ....._models import BaseModel +from ..beta_analytics_actor import BetaAnalyticsActor +from ..beta_analytics_speed import BetaAnalyticsSpeed +from ..beta_analytics_actor_type import BetaAnalyticsActorType +from ..beta_analytics_service_tier import BetaAnalyticsServiceTier +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_usage_cost_inference_geo import BetaAnalyticsUsageCostInferenceGeo + +__all__ = ["BetaAnalyticsUsageGroup"] + + +class BetaAnalyticsUsageGroup(BaseModel): + """ + The dimension values one usage row is broken out by; each is null + unless its dimension is in `group_by[]`. + """ + + actor: Optional[BetaAnalyticsActor] = None + """ + The identity the usage is attributed to: the user if one is attributed, else the + service account, else the federated (cloud-platform) identity, else the API key. + Populated only when `actor` is in `group_by[]`; null for usage with no + attributable identity, and for users' and federated identities' usage when the + reader is a member who can see only some workspaces. Distinct identities the + server cannot render also read null, each as its own row. + """ + + actor_type: Optional[BetaAnalyticsActorType] = None + """ + Kind of identity the usage is attributed to; matches `actor.type` when `actor` + is set. Populated only when `actor_type` is in `group_by[]`. + """ + + agent_id: Optional[str] = None + """Claude Managed Agents agent whose session incurred the usage. + + Populated only when `agent_id` is in `group_by[]`; null for usage outside a + managed session. + """ + + api_key_id: Optional[str] = None + """ + API key that authenticated the requests, as a tagged API key ID, whichever + identity `actor` resolves to. Populated only when `api_key_id` is in + `group_by[]`; null for usage not authenticated by an API key. + """ + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + deployment_id: Optional[str] = None + """Deployment that started the Claude Managed Agents session. + + Populated only when `deployment_id` is in `group_by[]`; null for usage outside a + managed session and for sessions no deployment started. + """ + + environment_id: Optional[str] = None + """Claude Managed Agents environment the session ran in. + + Populated only when `environment_id` is in `group_by[]`; null for usage outside + a managed session. + """ + + inference_geo: Optional[BetaAnalyticsUsageCostInferenceGeo] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude_tag`, and `chat_cowork_unified`. `claude_tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + service_tier: Optional[BetaAnalyticsServiceTier] = None + """Service tier the usage was served at. + + Populated only when `service_tier` is in `group_by[]`; null for usage with no + service tier (for example, code execution) and for Claude Enterprise usage. + """ + + session_id: Optional[str] = None + """Claude Managed Agents session that incurred the usage. + + Populated only when `session_id` is in `group_by[]`; null for usage outside a + managed session. + """ + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[BetaAnalyticsSpeed] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + user_profile_id: Optional[str] = None + """User profile the usage was attributed to, as a tagged `uprof_` ID. + + Populated only when `user_profile_id` is in `group_by[]`; null for usage that + named no profile and for Claude Enterprise usage. + """ + + workspace_id: Optional[str] = None + """ + Workspace the usage occurred in, as a tagged workspace ID, including the + organization's default workspace. Populated only when `workspace_id` is in + `group_by[]`; null for Claude Enterprise usage. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..72bec8c5e196c17ae35e5e21be7756ff7f5488fc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_group_by.py @@ -0,0 +1,25 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUsageGroupBy"] + +BetaAnalyticsUsageGroupBy: TypeAlias = Literal[ + "actor", + "actor_type", + "agent_id", + "api_key_id", + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "deployment_id", + "environment_id", + "inference_geo", + "model", + "product", + "rbac_group_id", + "service_tier", + "session_id", + "slack_channel_id", + "speed", + "user_profile_id", + "workspace_id", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_item.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_item.py new file mode 100644 index 0000000000000000000000000000000000000000..d5273b55c7174b40bb2b4a6e248434d92c053199 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_item.py @@ -0,0 +1,31 @@ +from datetime import datetime + +from ....._models import BaseModel +from .beta_analytics_usage_group import BetaAnalyticsUsageGroup +from .beta_analytics_usage_metrics import BetaAnalyticsUsageMetrics + +__all__ = ["BetaAnalyticsUsageItem"] + + +class BetaAnalyticsUsageItem(BaseModel): + ending_at: datetime + """ + End of the period this row covers (exclusive), as an RFC 3339 UTC timestamp: the + end of the row's time bucket when a time-bucket width is set; otherwise the + requested `ending_at` (or, when omitted, the earlier of now and `starting_at` + plus 31 days) rounded down to the hour, because without a time bucket the report + covers whole hours. + """ + + group: BetaAnalyticsUsageGroup + """The dimension values this row's usage is broken out by.""" + + starting_at: datetime + """ + Start of the period this row covers (inclusive), as an RFC 3339 UTC timestamp: + the start of the row's time bucket when a time-bucket width is set, otherwise + the requested `starting_at` rounded down to the hour. + """ + + usage: BetaAnalyticsUsageMetrics + """Token usage for this row.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..5f669fd1413c99184201da954d86b43680f68929 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_metrics.py @@ -0,0 +1,39 @@ +from typing import Optional + +from ....._models import BaseModel +from ...beta_cache_creation import BetaCacheCreation +from ..beta_analytics_server_tool_use import BetaAnalyticsServerToolUse + +__all__ = ["BetaAnalyticsUsageMetrics"] + + +class BetaAnalyticsUsageMetrics(BaseModel): + """The token usage of one row.""" + + cache_creation: BetaCacheCreation + """The number of input tokens for cache creation.""" + + cache_read_input_tokens: int + """The number of input tokens read from the cache.""" + + output_tokens: int + """The number of output tokens generated.""" + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + For sandbox / code-execution events, this counts execution spans rather than + HTTP requests (these rows surface with `product: null`). + """ + + server_tool_use: BetaAnalyticsServerToolUse + """Server-side tool usage metrics.""" + + total_tokens: int + """Total token count across all token types. + + This is the value the default `order_by` (`total_tokens`) sorts on. + """ + + uncached_input_tokens: int + """The number of uncached input tokens processed.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_order_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_order_by.py new file mode 100644 index 0000000000000000000000000000000000000000..1906ae5097415cea1d7b78939df815bfcd4f69fe --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/beta_analytics_usage_order_by.py @@ -0,0 +1,7 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUsageOrderBy"] + +BetaAnalyticsUsageOrderBy: TypeAlias = Literal[ + "output_tokens", "requests", "time", "total_tokens", "uncached_input_tokens" +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/connector_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/connector_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..735e925faa10cd3362e9ae02dd4df0c89978df60 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/connector_list_params.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_order import BetaAnalyticsOrder +from ..beta_analytics_connector_group_by import BetaAnalyticsConnectorGroupBy + +__all__ = ["ConnectorListParams"] + + +class ConnectorListParams(TypedDict, total=False): + date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + The day to get connector usage for. Data is typically available with a 1-day lag + (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive); only valid with `starting_date`. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day), so this can be at most today — + which is also the default when omitted, resolved once when the first page is + served and reused for the rest of the pagination sequence. At most 366 days + after `starting_date`. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: + `connector_name`, `product`, `rbac_group_id`, `user_id`. Value forms: + `connector_name` matches case-insensitively, a display name such as 'GitHub MCP' + also matches its normalized stored form ('github'), and for rows whose + `connector_name` is an opaque connector id the connector's display name + (`connector_display_name`) also matches; `product` is one of + `chat_cowork_unified`, `chat`, `claude_code`, `cowork`, or `office_agent`; + `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses + and by the spend-limits API) or a bare group UUID, and matches users who held + the group at any point during each covered UTC day (time-of-usage attribution); + `user_id` takes a tagged user id (`user_...`), as emitted in responses. An + unsupported dimension returns 400. At most 100 entries. `chat_cowork_unified` is + accepted as a `product` value only where Chat and Cowork unified is available. + """ + + group_by: Optional[List[BetaAnalyticsConnectorGroupBy]] + """Dimensions to break results out by (e.g. + + `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, + `user_id`. Grouped rows carry the requested dimension values as additional + fields and paginate like ungrouped responses via `next_page`; an unsupported + dimension returns 400. `rbac_group_id` attributes a user to every group they + held at any point during each covered UTC day, so grouped rows are not an + exclusive partition and can sum above org-level totals. At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100).""" + + order: Optional[BetaAnalyticsOrder] + """Sort direction: `asc` or `desc`. + + Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` + names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's + default sort field when `order_by` is omitted. + """ + + order_by: Optional[str] + """Sort field. + + Restricted to the endpoint's sort column plus its rankable metrics (metrics + default to descending; a few metrics rank in date-range mode only, per the + endpoint's documented orderable set). + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + starting_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + Start of a date range (inclusive). Enables rollup mode: one row per entity + aggregated over the whole range — addable counters are summed across days, and a + distinct count is never summed where summing could double-count (a field's range + value is recomputed exactly over the window, approximate via HLL with typical + error under 2%, null, or — for the creation-event counts, whose per-day values + cannot overlap — a per-day sum that is itself exact; each field's own + description says which). Use either `date` or `starting_date`, not both. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day) and may be revised by a few + percent over the following days. No earlier than 2026-01-01. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..22830604f339bd7dc5e6158bd7d8e616ae744a9b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_list_params.py @@ -0,0 +1,234 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_speed import BetaAnalyticsSpeed +from ....anthropic_beta_param import AnthropicBetaParam +from ..beta_analytics_actor_type import BetaAnalyticsActorType +from ..beta_analytics_service_tier import BetaAnalyticsServiceTier +from .beta_analytics_cost_group_by import BetaAnalyticsCostGroupBy +from .beta_analytics_cost_order_by import BetaAnalyticsCostOrderBy +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_time_bucket_width import BetaAnalyticsTimeBucketWidth +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter +from ..beta_analytics_usage_cost_sort_order import BetaAnalyticsUsageCostSortOrder +from ..beta_analytics_usage_cost_product_filter import BetaAnalyticsUsageCostProductFilter + +__all__ = ["CostListParams"] + + +class CostListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + actor_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage attributed to specific identities, by tagged ID: a `user_...`, + `svac_...` (service account), or `apikey_...` ID. An `apikey_` entry matches + only usage attributed to the key itself, not usage on that key attributed to a + user or service account (use `api_key_ids[]` for every request a key + authenticated). Federated identities have no tagged ID; select them with + `actor_types[]`. Use `group_by[]=actor` to break out per-identity values. + """ + + actor_types: Optional[List[BetaAnalyticsActorType]] + """Filter to usage attributed to specific kinds of identity. + + Use `group_by[]=actor_type` to break out per-kind values. + """ + + agent_ids: Optional[SequenceNotStr[str]] + """Filter to usage incurred by sessions of specific Claude Managed Agents agents. + + Use `group_by[]=agent_id` to break out per-agent values. Claude Platform + organizations only. + """ + + api_key_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage authenticated by specific API keys, by tagged API key ID + (`apikey_...`), whichever identity the usage is attributed to. Include an empty + entry (`api_key_ids[]=`) to also match usage that no API key authenticated. Use + `group_by[]=api_key_id` to break out per-key values; usage without a key has a + null `api_key_id`. Claude Platform organizations only. + """ + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + deployment_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by Claude Managed Agents sessions that specific + deployments started. Use `group_by[]=deployment_id` to break out per-deployment + values. Claude Platform organizations only. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + Required when `time_bucket_width` is set. Without `time_bucket_width`, defaults + to the earlier of now and `starting_at` + 31 days. The range may span at most 31 + days. + """ + + environment_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by Claude Managed Agents sessions that ran in specific + environments. Use `group_by[]=environment_id` to break out per-environment + values. Claude Platform organizations only. + """ + + exclude_deleted_users: bool + """If true, omit rows whose `actor` is a `user_actor` with `deleted: true`. + + Requires `group_by[]=actor`. Rows for other actor types, and rows whose `actor` + is null, are always kept. A page may contain fewer than `limit` rows; use + `has_more` and `next_page` to paginate as usual. + """ + + group_by: Optional[List[BetaAnalyticsCostGroupBy]] + """ + Dimensions to break cost out by (at most 5, not counting `cost_type` and + `token_type`): one row per combination of their values with cost in the range + (and per time bucket, when `time_bucket_width` is set), every combination + returned across pages rather than a capped top set. `cost_type` and `token_type` + do not count toward `limit`: `cost_type` returns one row per cost component + (tokens, web search, code execution, and `session_usage`, Claude Managed Agents + session time); `token_type` returns one row per token type, each with + `cost_type: "tokens"`; combining both returns the per-token-type rows plus the + web-search, code-execution and session-usage rows. When omitted, a single row + aggregates the whole range. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: int + """Number of rows per page (1-1000, default 20). + + `cost_type`/`token_type` fan-out rows (cost endpoint only) do not count toward + this limit, so `data` can exceed it. + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + order: BetaAnalyticsUsageCostSortOrder + """ + Sort direction of the `order_by` metric, or of the time buckets when `order_by` + is `time` and `time_bucket_width` is set. Defaults to `desc`. + """ + + order_by: BetaAnalyticsCostOrderBy + """Row order. + + A metric ranks rows by that metric in the `order` direction. `time` orders rows + by time bucket in the `order` direction (newest first by default) and, within a + bucket, by `amount`, highest first. `time` takes effect only with + `time_bucket_width`; without it, `time` is the same as `amount`. Defaults to + `amount`. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsUsageCostProductFilter]] + """Product surfaces to include. Defaults to all products.""" + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + service_tiers: Optional[List[BetaAnalyticsServiceTier]] + """Filter to specific service tiers. + + Use `group_by[]=service_tier` to break out per-tier values. Claude Platform + organizations only; matches nothing for a Claude Enterprise organization. + """ + + session_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by specific Claude Managed Agents sessions, by tagged + session ID (`sesn_...`). Use `group_by[]=session_id` to break out per-session + values. Claude Platform organizations only. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[BetaAnalyticsSpeed]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + time_bucket_width: Optional[BetaAnalyticsTimeBucketWidth] + """Time-bucket granularity. + + When set, rows are returned per time bucket (one per bucket and dimension + combination with usage) and each row's `starting_at` and `ending_at` are that + bucket's bounds; the time bucket counts toward `limit`. `ending_at` is required + when `time_bucket_width` is set, and with `time_bucket_width="1m"` the range may + span at most 24 hours. When omitted, each row aggregates the requested range + with `starting_at` and `ending_at` each rounded down to the hour. + """ + + user_profile_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage attributed to specific user profiles, by tagged user profile ID + (`uprof_...`). Use `group_by[]=user_profile_id` to break out per-profile values. + Claude Platform organizations only. + """ + + workspace_ids: Optional[SequenceNotStr[str]] + """Filter to usage in specific workspaces, by tagged workspace ID (`wrkspc_...`). + + Use `group_by[]=workspace_id` to break out per-workspace values. Claude Platform + organizations only; matches nothing for a Claude Enterprise organization. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `analytics-usage-cost-2026-08-24` + in this header. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_report_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_report_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..9581fedafb0b21ce715a517338eeb00d1c92661a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/cost_report_list_params.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_product_filter import BetaAnalyticsProductFilter +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter + +__all__ = ["CostReportListParams"] + + +class CostReportListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + bucket_width: Literal["1d", "1h", "1m"] + """Time bucket granularity.""" + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + When omitted, defaults to the earlier of now and `starting_at` + 31 days. The + range may span at most 31 days. + """ + + group_by: Optional[ + List[ + Literal[ + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "cost_type", + "inference_geo", + "model", + "product", + "rbac_group_id", + "slack_channel_id", + "speed", + "token_type", + ] + ] + ] + """Dimensions to break each time bucket out by. + + Defaults to no grouping (one total per bucket). Each bucket reports at most its + top 100 groups; a group beyond that cap has no row in that bucket (there is no + remainder row), so grouped buckets are not exhaustive when a dimension has more + than 100 distinct values. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: Optional[int] + """Maximum number of time buckets per page. + + Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default + 24, max 168; `1m`: default 60, max 256). + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsProductFilter]] + """Product surfaces to include. + + Defaults to all products. Use `group_by[]=product` to break out per-product + values. + """ + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[Literal["fast", "standard"]]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + user_ids: Optional[SequenceNotStr[str]] + """Filter to specific users by tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/plugin_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/plugin_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..e99850d55201abb14bfda675993a7231037830ac --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/plugin_list_params.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_order import BetaAnalyticsOrder +from ..beta_analytics_plugin_group_by import BetaAnalyticsPluginGroupBy + +__all__ = ["PluginListParams"] + + +class PluginListParams(TypedDict, total=False): + date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + The day to get plugin usage for. Data is typically available with a 1-day lag + (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive); only valid with `starting_date`. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day), so this can be at most today — + which is also the default when omitted, resolved once when the first page is + served and reused for the rest of the pagination sequence. At most 366 days + after `starting_date`. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: `plugin_name`, + `product`, `rbac_group_id`, `user_id`. Value forms: `plugin_name` matches + case-insensitively; `product` is `chat_cowork_unified`, `claude_code`, or + `cowork` (the only surfaces with plugin attribution); `rbac_group_id` takes the + tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits + API) or a bare group UUID, and matches users who held the group at any point + during each covered UTC day (time-of-usage attribution); `user_id` takes a + tagged user id (`user_...`), as emitted in responses. An unsupported dimension + returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a + `product` value only where Chat and Cowork unified is available. + """ + + group_by: Optional[List[BetaAnalyticsPluginGroupBy]] + """Dimensions to break results out by (e.g. + + `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, + `user_id`. On this endpoint `product` takes the values `chat_cowork_unified`, + `claude_code`, or `cowork` only (the surfaces with plugin attribution). Grouped + rows carry the requested dimension values as additional fields and paginate like + ungrouped responses via `next_page`; an unsupported dimension returns 400. + `rbac_group_id` attributes a user to every group they held at any point during + each covered UTC day, so grouped rows are not an exclusive partition and can sum + above org-level totals. At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100).""" + + order: Optional[BetaAnalyticsOrder] + """Sort direction: `asc` or `desc`. + + Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` + names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's + default sort field when `order_by` is omitted. + """ + + order_by: Optional[str] + """Sort field. + + Restricted to the endpoint's sort column plus its rankable metrics (metrics + default to descending; a few metrics rank in date-range mode only, per the + endpoint's documented orderable set). + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + starting_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + Start of a date range (inclusive). Enables rollup mode: one row per entity + aggregated over the whole range — addable counters are summed across days, and a + distinct count is never summed where summing could double-count (a field's range + value is recomputed exactly over the window, approximate via HLL with typical + error under 2%, null, or — for the creation-event counts, whose per-day values + cannot overlap — a per-day sum that is itself exact; each field's own + description says which). Use either `date` or `starting_date`, not both. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day) and may be revised by a few + percent over the following days. No earlier than 2026-01-01. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/skill_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/skill_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..9df1e2c33455eb6fdcc8a8d0a4280e60ed2ff05f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/skill_list_params.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_order import BetaAnalyticsOrder +from ..beta_analytics_skill_group_by import BetaAnalyticsSkillGroupBy + +__all__ = ["SkillListParams"] + + +class SkillListParams(TypedDict, total=False): + date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + The day to get skill usage for. Data is typically available with a 1-day lag + (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive); only valid with `starting_date`. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day), so this can be at most today — + which is also the default when omitted, resolved once when the first page is + served and reused for the rest of the pagination sequence. At most 366 days + after `starting_date`. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: `product`, + `rbac_group_id`, `share_status`, `skill_name`, `user_id`. Value forms: `product` + is one of `chat_cowork_unified`, `chat`, `claude_code`, `cowork`, or + `office_agent`; `rbac_group_id` takes the tagged id (`rbac_group_...`, as + emitted in responses and by the spend-limits API) or a bare group UUID, and + matches users who held the group at any point during each covered UTC day + (time-of-usage attribution); `share_status` is one of `organization`, `private`, + or `public`; `skill_name` matches case-insensitively; `user_id` takes a tagged + user id (`user_...`), as emitted in responses. An unsupported dimension + returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a + `product` value only where Chat and Cowork unified is available. + """ + + group_by: Optional[List[BetaAnalyticsSkillGroupBy]] + """Dimensions to break results out by (e.g. + + `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, + `user_id`. Grouped rows carry the requested dimension values as additional + fields and paginate like ungrouped responses via `next_page`; an unsupported + dimension returns 400. `rbac_group_id` attributes a user to every group they + held at any point during each covered UTC day, so grouped rows are not an + exclusive partition and can sum above org-level totals. At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100).""" + + order: Optional[BetaAnalyticsOrder] + """Sort direction: `asc` or `desc`. + + Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` + names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's + default sort field when `order_by` is omitted. + """ + + order_by: Optional[str] + """Sort field. + + Restricted to the endpoint's sort column plus its rankable metrics (metrics + default to descending; a few metrics rank in date-range mode only, per the + endpoint's documented orderable set). + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + starting_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + Start of a date range (inclusive). Enables rollup mode: one row per entity + aggregated over the whole range — addable counters are summed across days, and a + distinct count is never summed where summing could double-count (a field's range + value is recomputed exactly over the window, approximate via HLL with typical + error under 2%, null, or — for the creation-event counts, whose per-day values + cannot overlap — a per-day sum that is itself exact; each field's own + description says which). Use either `date` or `starting_date`, not both. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day) and may be revised by a few + percent over the following days. No earlier than 2026-01-01. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/summary_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/summary_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..270ec8cb5b43121eebb42bfd92e57fb3abe83505 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/summary_list_params.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from typing import Union, Optional +from datetime import date +from typing_extensions import Required, TypedDict + +from ....._types import SequenceNotStr + +__all__ = ["SummaryListParams"] + + +class SummaryListParams(TypedDict, total=False): + starting_date: Required[Union[str, date]] + """UTC date in YYYY-MM-DD format. + + Start of the date range (inclusive). Data is typically available with a 1-day + lag (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive). Data is typically available with a 1-day lag, + so this can be at most today — which is also the default when omitted, making + the last entry cover the most recent available day. Data may be revised by a few + percent over the following days. The range may span at most 366 days. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`. + + Only `rbac_group_id` is supported (e.g. `filter[]=rbac_group_id:{id}`); repeat + the param to OR across groups. Scopes the whole day series to members of the + matching group(s), re-aggregated from member-level activity — org-wide + seat/invite fields and the adoption rates derived from them are null on scoped + rows. `rbac_group_id` accepts the tagged id (`rbac_group_...`, as emitted in + responses and by the spend-limits API) or a bare group UUID, and matches users + who held the group at any point during each UTC day (time-of-usage attribution). + At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100). + + The day series (at most 366 entries) is currently returned in full in a single + page, so `limit` does not yet shorten it. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field. + + `next_page` is currently always null, so there is never a cursor to send. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..8c13ccc5c044c949593a6da93bf0b29c777aac70 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_list_params.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_speed import BetaAnalyticsSpeed +from ....anthropic_beta_param import AnthropicBetaParam +from ..beta_analytics_actor_type import BetaAnalyticsActorType +from ..beta_analytics_service_tier import BetaAnalyticsServiceTier +from .beta_analytics_usage_group_by import BetaAnalyticsUsageGroupBy +from .beta_analytics_usage_order_by import BetaAnalyticsUsageOrderBy +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_time_bucket_width import BetaAnalyticsTimeBucketWidth +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter +from ..beta_analytics_usage_cost_sort_order import BetaAnalyticsUsageCostSortOrder +from ..beta_analytics_usage_cost_product_filter import BetaAnalyticsUsageCostProductFilter + +__all__ = ["UsageListParams"] + + +class UsageListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + actor_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage attributed to specific identities, by tagged ID: a `user_...`, + `svac_...` (service account), or `apikey_...` ID. An `apikey_` entry matches + only usage attributed to the key itself, not usage on that key attributed to a + user or service account (use `api_key_ids[]` for every request a key + authenticated). Federated identities have no tagged ID; select them with + `actor_types[]`. Use `group_by[]=actor` to break out per-identity values. + """ + + actor_types: Optional[List[BetaAnalyticsActorType]] + """Filter to usage attributed to specific kinds of identity. + + Use `group_by[]=actor_type` to break out per-kind values. + """ + + agent_ids: Optional[SequenceNotStr[str]] + """Filter to usage incurred by sessions of specific Claude Managed Agents agents. + + Use `group_by[]=agent_id` to break out per-agent values. Claude Platform + organizations only. + """ + + api_key_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage authenticated by specific API keys, by tagged API key ID + (`apikey_...`), whichever identity the usage is attributed to. Include an empty + entry (`api_key_ids[]=`) to also match usage that no API key authenticated. Use + `group_by[]=api_key_id` to break out per-key values; usage without a key has a + null `api_key_id`. Claude Platform organizations only. + """ + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + deployment_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by Claude Managed Agents sessions that specific + deployments started. Use `group_by[]=deployment_id` to break out per-deployment + values. Claude Platform organizations only. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + Required when `time_bucket_width` is set. Without `time_bucket_width`, defaults + to the earlier of now and `starting_at` + 31 days. The range may span at most 31 + days. + """ + + environment_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by Claude Managed Agents sessions that ran in specific + environments. Use `group_by[]=environment_id` to break out per-environment + values. Claude Platform organizations only. + """ + + exclude_deleted_users: bool + """If true, omit rows whose `actor` is a `user_actor` with `deleted: true`. + + Requires `group_by[]=actor`. Rows for other actor types, and rows whose `actor` + is null, are always kept. A page may contain fewer than `limit` rows; use + `has_more` and `next_page` to paginate as usual. + """ + + group_by: Optional[List[BetaAnalyticsUsageGroupBy]] + """ + Dimensions to break usage out by (at most 5): one row per combination of their + values with usage in the range (and per time bucket, when `time_bucket_width` is + set), every combination returned across pages rather than a capped top set. When + omitted, a single row aggregates the whole range. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: int + """Number of rows per page (1-1000, default 20). + + `cost_type`/`token_type` fan-out rows (cost endpoint only) do not count toward + this limit, so `data` can exceed it. + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + order: BetaAnalyticsUsageCostSortOrder + """ + Sort direction of the `order_by` metric, or of the time buckets when `order_by` + is `time` and `time_bucket_width` is set. Defaults to `desc`. + """ + + order_by: BetaAnalyticsUsageOrderBy + """Row order. + + A metric ranks rows by that metric in the `order` direction. `time` orders rows + by time bucket in the `order` direction (newest first by default) and, within a + bucket, by `total_tokens`, highest first. `time` takes effect only with + `time_bucket_width`; without it, `time` is the same as `total_tokens`. Defaults + to `total_tokens`. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsUsageCostProductFilter]] + """Product surfaces to include. Defaults to all products.""" + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + service_tiers: Optional[List[BetaAnalyticsServiceTier]] + """Filter to specific service tiers. + + Use `group_by[]=service_tier` to break out per-tier values. Claude Platform + organizations only; matches nothing for a Claude Enterprise organization. + """ + + session_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage incurred by specific Claude Managed Agents sessions, by tagged + session ID (`sesn_...`). Use `group_by[]=session_id` to break out per-session + values. Claude Platform organizations only. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[BetaAnalyticsSpeed]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + time_bucket_width: Optional[BetaAnalyticsTimeBucketWidth] + """Time-bucket granularity. + + When set, rows are returned per time bucket (one per bucket and dimension + combination with usage) and each row's `starting_at` and `ending_at` are that + bucket's bounds; the time bucket counts toward `limit`. `ending_at` is required + when `time_bucket_width` is set, and with `time_bucket_width="1m"` the range may + span at most 24 hours. When omitted, each row aggregates the requested range + with `starting_at` and `ending_at` each rounded down to the hour. + """ + + user_profile_ids: Optional[SequenceNotStr[str]] + """ + Filter to usage attributed to specific user profiles, by tagged user profile ID + (`uprof_...`). Use `group_by[]=user_profile_id` to break out per-profile values. + Claude Platform organizations only. + """ + + workspace_ids: Optional[SequenceNotStr[str]] + """Filter to usage in specific workspaces, by tagged workspace ID (`wrkspc_...`). + + Use `group_by[]=workspace_id` to break out per-workspace values. Claude Platform + organizations only; matches nothing for a Claude Enterprise organization. + """ + + betas: List[AnthropicBetaParam] + """ + This endpoint is in beta: requests must send `analytics-usage-cost-2026-08-24` + in this header. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_report_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_report_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..43e10f51c3766540bd9e43e1811a9604ba82dc18 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/usage_report_list_params.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_product_filter import BetaAnalyticsProductFilter +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter + +__all__ = ["UsageReportListParams"] + + +class UsageReportListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + bucket_width: Literal["1d", "1h", "1m"] + """Time bucket granularity.""" + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + When omitted, defaults to the earlier of now and `starting_at` + 31 days. The + range may span at most 31 days. + """ + + group_by: Optional[ + List[ + Literal[ + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "inference_geo", + "model", + "product", + "rbac_group_id", + "slack_channel_id", + "speed", + ] + ] + ] + """Dimensions to break each time bucket out by. + + Defaults to no grouping (one total per bucket). Each bucket reports at most its + top 100 groups; a group beyond that cap has no row in that bucket (there is no + remainder row), so grouped buckets are not exhaustive when a dimension has more + than 100 distinct values. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: Optional[int] + """Maximum number of time buckets per page. + + Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default + 24, max 168; `1m`: default 60, max 256). + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsProductFilter]] + """Product surfaces to include. + + Defaults to all products. Use `group_by[]=product` to break out per-product + values. + """ + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[Literal["fast", "standard"]]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + user_ids: Optional[SequenceNotStr[str]] + """Filter to specific users by tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_cost_report_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_cost_report_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..17764e88f7f170a23c31c1ba22e93f29707926b3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_cost_report_list_params.py @@ -0,0 +1,153 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_product_filter import BetaAnalyticsProductFilter +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter + +__all__ = ["UserCostReportListParams"] + + +class UserCostReportListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + bucket_width: Optional[Literal["1d", "1h", "1m"]] + """Time-bucket granularity. + + When set, each row's `starting_at` and `ending_at` are populated and one actor + may span several rows (one per time bucket with usage). The time bucket counts + toward `limit`, so one page can return multiple rows for the same actor. + `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` + the range may span at most 24 hours. When omitted, each row aggregates the full + `[starting_at, ending_at)` range. + """ + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + When omitted, defaults to the earlier of now and `starting_at` + 31 days. The + range may span at most 31 days. + """ + + exclude_deleted_users: bool + """If true, omit rows for users who are deleted (`deleted: true`). + + A page may contain fewer than `limit` rows; use `has_more` and `next_page` to + paginate as usual. + """ + + group_by: Optional[ + List[ + Literal[ + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "cost_type", + "inference_geo", + "model", + "product", + "rbac_group_id", + "slack_channel_id", + "speed", + "token_type", + ] + ] + ] + """Break each actor's row out by the given dimensions. + + Accepts the same values as the bucketed `/cost_report` endpoint. The `product`, + `model`, `context_window`, `inference_geo`, and `speed` dimensions — and the + time bucket, when `bucket_width` is set — count toward `limit`. `cost_type` and + `token_type` do not: `cost_type` returns one row per cost component (tokens, web + search, code execution); `token_type` returns one row per token type, each with + `cost_type: "tokens"`; combining both returns the per-token-type rows plus the + web-search and code-execution rows. A page can therefore contain more rows than + `limit` when `cost_type` or `token_type` is requested. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: int + """Number of rows per page (1-1000, default 20). + + One row per actor unless `group_by[]` or `bucket_width` splits an actor across + rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the + exception — they do not count toward this limit, so `data` can exceed it. + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + order: Literal["asc", "desc"] + """Sort direction. Defaults to `desc`.""" + + order_by: Literal["amount", "list_amount"] + """Metric to rank actors by. Defaults to `amount`.""" + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsProductFilter]] + """Product surfaces to include. Defaults to all products.""" + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[Literal["fast", "standard"]]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + user_ids: Optional[SequenceNotStr[str]] + """Filter to specific users by tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..8824012fccdd997d711a9204bd12273dcc251288 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_list_params.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +import datetime +from typing import List, Union, Optional +from typing_extensions import TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_order import BetaAnalyticsOrder +from ..beta_analytics_user_group_by import BetaAnalyticsUserGroupBy + +__all__ = ["UserListParams"] + + +class UserListParams(TypedDict, total=False): + date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + The day to get user activity for. Data is typically available with a 1-day lag + (varies by query; the error for a too-recent date names the latest available + day) and may be revised by a few percent over the following days. No earlier + than 2026-01-01. + """ + + ending_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + End of the date range (exclusive); only valid with `starting_date`. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day), so this can be at most today — + which is also the default when omitted, resolved once when the first page is + served and reused for the rest of the pagination sequence. At most 366 days + after `starting_date`. + """ + + filter: Optional[SequenceNotStr[str]] + """Filters as `dimension:value`, e.g. + + `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and + across dimensions for AND. Supported dimensions on this endpoint: `project_id`, + `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id + (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as + emitted in responses and by the spend-limits API) or a bare group UUID, and + matches users who held the group at any point during each covered UTC day + (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as + emitted in responses. An unsupported dimension returns 400. At most 100 entries. + A `project_id` filter limits each member's row to their claude.ai chat activity + in that project and cannot be combined with `group_by[]` or an `rbac_group_id` + filter. On these rows, every count in `chat_cowork_unified_metrics.sessions` is + 0, because sessions are not measured per project. On any day a member sent a + chat message in Chat and Cowork unified, all of that member's project activity + for the day is counted in `chat_cowork_unified_metrics.chat` instead of + `chat_metrics`. + """ + + group_by: Optional[List[BetaAnalyticsUserGroupBy]] + """Dimensions to break results out by (e.g. + + `group_by[]=rbac_group_id`). Supported on this endpoint: `rbac_group_id`. Rows + are already per-member, so the one supported grouping aggregates them per RBAC + group instead. Grouped rows carry the requested dimension values as additional + fields and paginate like ungrouped responses via `next_page`; an unsupported + dimension returns 400. `rbac_group_id` attributes a user to every group they + held at any point during each covered UTC day, so grouped rows are not an + exclusive partition and can sum above org-level totals. At most 100 entries. + """ + + limit: Optional[int] + """Number of results per page (1-1000, default 100).""" + + order: Optional[BetaAnalyticsOrder] + """Sort direction: `asc` or `desc`. + + Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` + names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's + default sort field when `order_by` is omitted. + """ + + order_by: Optional[str] + """Sort field. + + Restricted to the endpoint's sort column plus its rankable metrics (metrics + default to descending; a few metrics rank in date-range mode only, per the + endpoint's documented orderable set). + """ + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + starting_date: Union[str, datetime.date, None] + """UTC date in YYYY-MM-DD format. + + Start of a date range (inclusive). Enables rollup mode: one row per entity + aggregated over the whole range — addable counters are summed across days, and a + distinct count is never summed where summing could double-count (a field's range + value is recomputed exactly over the window, approximate via HLL with typical + error under 2%, null, or — for the creation-event counts, whose per-day values + cannot overlap — a per-day sum that is itself exact; each field's own + description says which). Use either `date` or `starting_date`, not both. Data is + typically available with a 1-day lag (varies by query; the error for a + too-recent date names the latest available day) and may be revised by a few + percent over the following days. No earlier than 2026-01-01. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_usage_report_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_usage_report_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..10f5fd9ba8a738fe82122e0b67b843a9d6f56f20 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/analytics/user_usage_report_list_params.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Required, TypedDict + +from ....._types import SequenceNotStr +from ..beta_analytics_context_window import BetaAnalyticsContextWindow +from ..beta_analytics_product_filter import BetaAnalyticsProductFilter +from ..beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory +from ..beta_analytics_inference_geo_filter import BetaAnalyticsInferenceGeoFilter + +__all__ = ["UserUsageReportListParams"] + + +class UserUsageReportListParams(TypedDict, total=False): + starting_at: Required[Union[str, datetime]] + """Start of range, inclusive. + + RFC 3339 tz-aware. Must be within the last 365 days and no earlier than + 2026-01-01T00:00:00Z. + """ + + bucket_width: Optional[Literal["1d", "1h", "1m"]] + """Time-bucket granularity. + + When set, each row's `starting_at` and `ending_at` are populated and one actor + may span several rows (one per time bucket with usage). The time bucket counts + toward `limit`, so one page can return multiple rows for the same actor. + `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` + the range may span at most 24 hours. When omitted, each row aggregates the full + `[starting_at, ending_at)` range. + """ + + claude_tag_categories: Optional[List[BetaAnalyticsClaudeTagCategory]] + """Filter to Claude Tag (Claude in Slack) usage in specific spend categories. + + Usage with no category never matches. Use `group_by[]=claude_tag_category` to + break out per-category values. + """ + + claude_tag_user_ids: Optional[SequenceNotStr[str]] + """ + Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, + by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that + is not Claude Tag, and Claude Tag usage not attributed to a single user, never + matches. Use `group_by[]=claude_tag_user_id` to break out per-user values. + """ + + context_windows: Optional[List[BetaAnalyticsContextWindow]] + """Filter to specific context-window pricing tiers. + + Use `group_by[]=context_window` to break out per-tier values. + """ + + ending_at: Union[str, datetime, None] + """End of range, exclusive. + + When omitted, defaults to the earlier of now and `starting_at` + 31 days. The + range may span at most 31 days. + """ + + exclude_deleted_users: bool + """If true, omit rows for users who are deleted (`deleted: true`). + + A page may contain fewer than `limit` rows; use `has_more` and `next_page` to + paginate as usual. + """ + + group_by: Optional[ + List[ + Literal[ + "claude_tag_category", + "claude_tag_user_id", + "context_window", + "inference_geo", + "model", + "product", + "rbac_group_id", + "slack_channel_id", + "speed", + ] + ] + ] + """Break each actor's row out by the given dimensions. + + Accepts the same values as the bucketed `/usage_report` endpoint. `limit` bounds + (actor × time bucket × dimension) rows — with dimensions or `bucket_width` + present, one actor may span several rows. + """ + + inference_geos: Optional[List[BetaAnalyticsInferenceGeoFilter]] + """Filter to specific inference regions. + + `not_available` matches rows where the region is unset. Use + `group_by[]=inference_geo` to break out per-region values. + """ + + limit: int + """Number of rows per page (1-1000, default 20). + + One row per actor unless `group_by[]` or `bucket_width` splits an actor across + rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the + exception — they do not count toward this limit, so `data` can exceed it. + """ + + models: Optional[SequenceNotStr[str]] + """Models to include. + + Defaults to all models. Use `group_by[]=model` to break out per-model values. + """ + + order: Literal["asc", "desc"] + """Sort direction. Defaults to `desc`.""" + + order_by: Literal["output_tokens", "requests", "total_tokens", "uncached_input_tokens"] + """Metric to rank actors by. Defaults to `total_tokens`.""" + + page: Optional[str] + """Opaque cursor from a previous response's `next_page` field.""" + + products: Optional[List[BetaAnalyticsProductFilter]] + """Product surfaces to include. Defaults to all products.""" + + rbac_group_ids: Optional[SequenceNotStr[str]] + """Filter to usage attributed to specific RBAC groups. + + Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row + matches when the user belonged to any of the listed groups on the (UTC) day the + usage occurred; usage with no group attribution never matches. + """ + + slack_channel_ids: Optional[SequenceNotStr[str]] + """Filter to usage originating from specific Slack channels. + + Use `group_by[]=slack_channel_id` to break out per-channel values. + """ + + speeds: Optional[List[Literal["fast", "standard"]]] + """Filter to fast or standard inference mode. + + Use `group_by[]=speed` to break out per-mode values. + """ + + user_ids: Optional[SequenceNotStr[str]] + """Filter to specific users by tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_list_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b9ff28a80b9b36074b619b07677d4ea57ea440fc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_list_params.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, TypedDict + +__all__ = ["APIKeyListParams"] + + +class APIKeyListParams(TypedDict, total=False): + after_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately after this object. + """ + + before_id: str + """ID of the object to use as a cursor for pagination. + + When provided, returns the page of results immediately before this object. + """ + + created_by_user_id: Optional[str] + """Filter by the ID of the User who created the object.""" + + limit: int + """Number of items to return per page. + + Defaults to `20`. Ranges from `1` to `1000`. + """ + + status: Optional[Literal["active", "archived", "expired", "inactive"]] + """Filter by API key status.""" + + workspace_id: Optional[str] + """Filter by Workspace ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_update_params.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..2f528ae7377801c2baf70291c7f379932f5fa8e7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/api_key_update_params.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, TypedDict + +__all__ = ["APIKeyUpdateParams"] + + +class APIKeyUpdateParams(TypedDict, total=False): + name: Optional[str] + """Name of the API key.""" + + status: Optional[Literal["active", "archived", "inactive"]] + """Status of the API key.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_allowed_inference_geo.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_allowed_inference_geo.py new file mode 100644 index 0000000000000000000000000000000000000000..7409318945a859c02a1e565ac0f2ad0b7ff4ec8a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_allowed_inference_geo.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAllowedInferenceGeo"] + +BetaAllowedInferenceGeo: TypeAlias = Literal["global", "us"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..3bfc43b07f115a2d734ca74ac881f8fdac29a7f2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor.py @@ -0,0 +1,20 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_analytics_api_actor import BetaAnalyticsAPIActor +from .beta_analytics_federated_actor import BetaAnalyticsFederatedActor +from .beta_analytics_report_user_actor import BetaAnalyticsReportUserActor +from .beta_analytics_service_account_actor import BetaAnalyticsServiceAccountActor + +__all__ = ["BetaAnalyticsActor"] + +BetaAnalyticsActor: TypeAlias = Annotated[ + Union[ + BetaAnalyticsReportUserActor, + BetaAnalyticsServiceAccountActor, + BetaAnalyticsFederatedActor, + BetaAnalyticsAPIActor, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor_type.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor_type.py new file mode 100644 index 0000000000000000000000000000000000000000..d435d6492aea993f8ba5a0bbc132857e8af5909a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_actor_type.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsActorType"] + +BetaAnalyticsActorType: TypeAlias = Literal["api_actor", "federated_actor", "service_account_actor", "user_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_api_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_api_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..335abbedb270ce159946878ed69222b8c2a65203 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_api_actor.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsAPIActor"] + + +class BetaAnalyticsAPIActor(BaseModel): + api_key_id: str + """Tagged API key ID.""" + + type: Literal["api_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..75c3673013d033a00c5619581b9739eed65dab0f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_activity.py @@ -0,0 +1,83 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsArtifactActivity"] + + +class BetaAnalyticsArtifactActivity(BaseModel): + """ + Artifact-creation activity for one (`artifact_type`, `is_shared`) bucket + on a given day. + + Artifacts form a small finite cube — the canonical MIME type (8 values incl. + `other`) crossed with shared-vs-private — so the response is the full set of + non-empty buckets, not a ranked/paginated list. Claude Code and Cowork + artifacts report under `text/html` and are counted from 2026-08-17 + onward; earlier days contain claude.ai chat artifacts only. With + `group_by[]=product` / `user_id` / `rbac_group_id` each row is further + split by the flat group keys and counts are scoped to that cut. + """ + + artifact_type: str + """Canonical artifact MIME type (e.g. + + `text/markdown`, `application/vnd.ant.react`, `image/svg+xml`), or `other`. + Claude Code and Cowork artifacts report as `text/html`. + """ + + artifacts_created_count: int + """Number of artifacts created in this bucket on the requested day""" + + distinct_user_count: int + """ + Number of distinct users who created artifacts in this bucket on the requested + day + """ + + is_shared: bool + """ + Whether the artifacts in this bucket have ever been shared (a Claude Code / + Cowork artifact is shared once anyone beyond its creator may open it: named + members, the whole organization, or anyone with the link). + """ + + published_artifacts_created_count: int + """ + Number of those artifacts that have been published (for Claude Code / Cowork + artifacts: open to anyone with the link); never exceeds + `artifacts_created_count` + """ + + product: Optional[str] = None + """ + Product that produced this row's activity: one of `chat`, `claude_code`, + `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). + These are the canonical Cost & Usage product names; an `office_agent` row's + per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, + `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin + attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and + `chat_cowork_unified` occur (the surfaces that create artifacts); + `/apps/chat/projects` does not support the product dimension (a `product` entry + in `group_by[]` or `filter[]` there is rejected). Present only when the request + grouped by `product`. + """ + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ + + user_id: Optional[str] = None + """Tagged user identifier (e.g. + + `user_...`). Present only when the request grouped by `user_id`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..f52d40c1f1171b48806e421fefd3e7e2ed512784 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_artifact_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsArtifactGroupBy"] + +BetaAnalyticsArtifactGroupBy: TypeAlias = Literal["product", "rbac_group_id", "user_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..6564c403c90bb6274065ebcf1b6c204d1c96c5e6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_chat_metrics.py @@ -0,0 +1,98 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsChatCoworkUnifiedChatMetrics"] + + +class BetaAnalyticsChatCoworkUnifiedChatMetrics(BaseModel): + """ + Chat activity recorded while members had Chat and Cowork unified turned + on. + """ + + connectors_used_count: int + """ + Same measure as `chat_metrics.connectors_used_count`, for activity recorded + while members had Chat and Cowork unified turned on. + """ + + distinct_artifacts_created_count: int + """ + Same measure as `chat_metrics.distinct_artifacts_created_count`, for activity + recorded while members had Chat and Cowork unified turned on. Exact in + date-range mode: a creation belongs to exactly one day, so the per-day counts + never overlap and their sum over the window is the exact count of distinct + creations in it. + """ + + distinct_connectors_used_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_connectors_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + distinct_conversation_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_conversation_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + distinct_files_uploaded_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_files_uploaded_count`, for activity + recorded while members had Chat and Cowork unified turned on. It counts uploaded + files as well as files Claude created and images returned by Claude's tools, + such as screenshots. Approximate (HLL, typical error <2%) in date-range mode. + Null on aggregated rows where a distinct count cannot be computed. + """ + + distinct_projects_created_count: int + """ + Same measure as `chat_metrics.distinct_projects_created_count`, for activity + recorded while members had Chat and Cowork unified turned on. Exact in + date-range mode: a creation belongs to exactly one day, so the per-day counts + never overlap and their sum over the window is the exact count of distinct + creations in it. + """ + + distinct_projects_used_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_projects_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + distinct_shared_artifacts_viewed_count: Optional[int] = None + """Always null: shared-artifact views are not currently measured.""" + + distinct_skills_used_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_skills_used_count`, for activity recorded + while members had Chat and Cowork unified turned on. Approximate (HLL, typical + error <2%) in date-range mode. Null on aggregated rows where a distinct count + cannot be computed. + """ + + message_count: int + """ + Same measure as `chat_metrics.message_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + shared_conversations_viewed_count: int + """ + Same measure as `chat_metrics.shared_conversations_viewed_count`, for activity + recorded while members had Chat and Cowork unified turned on. + """ + + thinking_message_count: int + """ + Same measure as `chat_metrics.thinking_message_count`, for activity recorded + while members had Chat and Cowork unified turned on. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..10f28ec4f783bc7cdfd3c014bdb13ee62608be2d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_metrics.py @@ -0,0 +1,21 @@ +from ...._models import BaseModel +from .beta_analytics_chat_cowork_unified_chat_metrics import BetaAnalyticsChatCoworkUnifiedChatMetrics +from .beta_analytics_chat_cowork_unified_sessions_metrics import BetaAnalyticsChatCoworkUnifiedSessionsMetrics + +__all__ = ["BetaAnalyticsChatCoworkUnifiedMetrics"] + + +class BetaAnalyticsChatCoworkUnifiedMetrics(BaseModel): + """ + Activity in Chat and Cowork unified for one user on one day: `chat` holds + chat activity and `sessions` holds Cowork session activity. + """ + + chat: BetaAnalyticsChatCoworkUnifiedChatMetrics + """Chat activity recorded while members had Chat and Cowork unified turned on.""" + + sessions: BetaAnalyticsChatCoworkUnifiedSessionsMetrics + """ + Cowork session activity recorded while members had Chat and Cowork unified + turned on. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_sessions_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_sessions_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..c670b015b6f14ed1eef1177310a06c72793ccbc6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_cowork_unified_sessions_metrics.py @@ -0,0 +1,128 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsChatCoworkUnifiedSessionsMetrics"] + + +class BetaAnalyticsChatCoworkUnifiedSessionsMetrics(BaseModel): + """ + Cowork session activity recorded while members had Chat and Cowork + unified turned on. + """ + + action_count: int + """ + Same measure as `cowork_metrics.action_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + artifacts_created_count: int + """ + Same measure as `cowork_metrics.artifacts_created_count`, for activity recorded + while members had Chat and Cowork unified turned on. Exact in date-range mode: a + creation belongs to exactly one day, so the per-day counts never overlap and + their sum over the window is the exact count of distinct creations in it. + """ + + connectors_used_count: int + """ + Same measure as `cowork_metrics.connectors_used_count`, for activity recorded + while members had Chat and Cowork unified turned on. + """ + + dispatch_turn_count: int + """ + Same measure as `cowork_metrics.dispatch_turn_count`, for activity recorded + while members had Chat and Cowork unified turned on. + """ + + distinct_connectors_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_connectors_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + distinct_plugins_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_plugins_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + distinct_session_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_session_count`, for activity recorded + while members had Chat and Cowork unified turned on. Approximate (HLL, typical + error <2%) in date-range mode. Null on aggregated rows where a distinct count + cannot be computed. + """ + + distinct_skills_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_skills_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + edit_tool_count: Optional[int] = None + """ + Same measure as `cowork_metrics.edit_tool_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + file_edit_count: Optional[int] = None + """ + Same measure as `cowork_metrics.file_edit_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + message_count: int + """ + Same measure as `cowork_metrics.message_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + multi_edit_tool_count: Optional[int] = None + """ + Same measure as `cowork_metrics.multi_edit_tool_count`, for activity recorded + while members had Chat and Cowork unified turned on. Claude no longer has a + multi-edit tool, so expect 0 when not null; each edit is now a separate Edit + tool call, counted in `edit_tool_count` and `file_edit_count`. + """ + + notebook_edit_tool_count: Optional[int] = None + """ + Same measure as `cowork_metrics.notebook_edit_tool_count`, for activity recorded + while members had Chat and Cowork unified turned on. + """ + + plugins_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.plugins_used_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + sessions_with_file_edits_count: Optional[int] = None + """ + Same measure as `cowork_metrics.sessions_with_file_edits_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ + + skills_used_count: int + """ + Same measure as `cowork_metrics.skills_used_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ + + write_tool_count: Optional[int] = None + """ + Same measure as `cowork_metrics.write_tool_count`, for activity recorded while + members had Chat and Cowork unified turned on. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..bda2ccc588731b607bdd5b927c085c5dd9416112 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_chat_metrics.py @@ -0,0 +1,81 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsChatMetrics"] + + +class BetaAnalyticsChatMetrics(BaseModel): + """Claude.ai activity metrics for a single user on a given day.""" + + connectors_used_count: int + """Number of MCP connector invocations.""" + + distinct_artifacts_created_count: int + """Number of distinct artifacts created. + + Exact in date-range mode: a creation belongs to exactly one day, so the per-day + counts never overlap and their sum over the window is the exact count of + distinct creations in it. + """ + + distinct_connectors_used_count: Optional[int] = None + """Distinct claude.ai connectors this user used. + + Excludes calls whose connector could not be identified and all calls from + organizations with zero data retention. Approximate (HLL, typical error <2%) in + date-range mode. Null on aggregated rows where a distinct count cannot be + computed. + """ + + distinct_conversation_count: Optional[int] = None + """Number of distinct conversations the user participated in. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_files_uploaded_count: Optional[int] = None + """Number of distinct files uploaded. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_projects_created_count: int + """Number of distinct projects created. + + Exact in date-range mode: a creation belongs to exactly one day, so the per-day + counts never overlap and their sum over the window is the exact count of + distinct creations in it. + """ + + distinct_projects_used_count: Optional[int] = None + """Number of distinct projects used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_shared_artifacts_viewed_count: Optional[int] = None + """Number of distinct shared artifacts the user viewed. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_skills_used_count: Optional[int] = None + """Number of distinct skills used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + message_count: int + """Number of messages sent""" + + shared_conversations_viewed_count: int + """Number of times the user opened a shared conversation in a project""" + + thinking_message_count: int + """Number of messages that used extended thinking""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_code_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_code_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..aa8892111b58684ea07980af18df495bf2ffff18 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_code_metrics.py @@ -0,0 +1,15 @@ +from ...._models import BaseModel +from .beta_analytics_tool_actions import BetaAnalyticsToolActions +from .beta_analytics_core_code_metrics import BetaAnalyticsCoreCodeMetrics + +__all__ = ["BetaAnalyticsClaudeCodeMetrics"] + + +class BetaAnalyticsClaudeCodeMetrics(BaseModel): + """Claude Code activity metrics for a single user on a given day.""" + + core_metrics: BetaAnalyticsCoreCodeMetrics + """Core Claude Code activity metrics for a single user on a given day.""" + + tool_actions: BetaAnalyticsToolActions + """Per-tool accepted/rejected counts for Claude Code file modification tools.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_tag_category.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_tag_category.py new file mode 100644 index 0000000000000000000000000000000000000000..d2beabae78d467aac6bd6c68ae623547538089ad --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_claude_tag_category.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsClaudeTagCategory"] + +BetaAnalyticsClaudeTagCategory: TypeAlias = Literal["dm", "engaged", "monitoring", "proactive", "scheduled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..819451010f772f3d0abf4a9d1500ed1d12936a21 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_activity.py @@ -0,0 +1,168 @@ +from typing import Optional + +from ...._models import BaseModel +from .beta_analytics_connector_chat_metrics import BetaAnalyticsConnectorChatMetrics +from .beta_analytics_connector_cowork_metrics import BetaAnalyticsConnectorCoworkMetrics +from .beta_analytics_connector_office_metrics import BetaAnalyticsConnectorOfficeMetrics +from .beta_analytics_connector_claude_code_metrics import BetaAnalyticsConnectorClaudeCodeMetrics +from .beta_analytics_connector_chat_cowork_unified_metrics import BetaAnalyticsConnectorChatCoworkUnifiedMetrics + +__all__ = ["BetaAnalyticsConnectorActivity"] + + +class BetaAnalyticsConnectorActivity(BaseModel): + """Per-connector activity data for a given day.""" + + chat_metrics: BetaAnalyticsConnectorChatMetrics + """Claude.ai activity metrics for a single connector on a given day.""" + + claude_code_metrics: BetaAnalyticsConnectorClaudeCodeMetrics + """Claude Code activity metrics for a single connector on a given day.""" + + connector_display_name: Optional[str] = None + """ + Human-readable display name for rows whose `connector_name` is an opaque + connector id rather than a readable name, resolved at request time from the + organization's connectors (including connectors that have since been removed). + `connector_name` remains the row's stable key for sorting and pagination, and + `filter[]=connector_name:{value}` also matches these rows by display name. + Display names are not unique, and the same connector's claude.ai usage can + appear under a separate row with a readable `connector_name`. Null when + `connector_name` is already a readable name, when the id cannot be resolved to + one of the organization's connectors, or when display-name resolution is not + enabled for this organization. + """ + + connector_name: str + """Name of the connector. + + Some rows carry an opaque connector id here instead of a readable name; + `connector_display_name` holds the resolved name for those rows. + """ + + cowork_metrics: BetaAnalyticsConnectorCoworkMetrics + """Cowork activity metrics for a single connector on a given day.""" + + distinct_user_count: int + """ + Number of distinct users who used the connector on the requested day, or, in + date-range mode, over the requested window — recomputed as an exact distinct + count over the window's per-member daily rows, never a sum of per-day values. + """ + + individual_auth_distinct_user_count: Optional[int] = None + """ + Number of distinct users whose use of this connector on the requested day ran on + their own individual credential, connected through their own consent flow. + Companion bucket to `managed_auth_distinct_user_count`, which carries the + measurement, attribution, and null rules. Users whose requests used no stored + credential count in neither bucket. + """ + + managed_auth_distinct_user_count: Optional[int] = None + """ + Number of distinct users whose use of this connector on the requested day ran on + Enterprise Managed Auth (an organization-managed credential provisioned through + the organization's identity provider), read from the token record each request + used. Null, never 0, when managed-auth reporting is not enabled for the + organization, the value cannot be attributed to the row, no credentialed + requests and no managed-token mint events (a managed credential being + provisioned for a user's use of the connector) were observed that day, or the + day predates 2026-07-01, the first day the backing data exists (forward-only + data, no backfill). When credentialed requests or mint events were observed and + attributed, both managed-auth fields populate, reporting 0 for a bucket with no + users; the two counts are independent, not a partition — a user whose requests + that day used both kinds of credential counts in both. Mint events carry user + but not surface attribution, so they count as observed auth activity on + `user_id` and `rbac_group_id` cuts — attributed to the user the credential was + provisioned for — but never on a cut that references `product` (group or + filter). Date-range rollup mode (`starting_date`/`ending_date`) computes both + fields exactly over the window — distinct users with at least one qualifying day + — when the whole window starts on or after 2026-07-01, with the null-versus-0 + and mint-event rules applying with the window in place of the day; a range + starting earlier reports every managed-auth field as null, never a + partial-window value. + """ + + office_metrics: BetaAnalyticsConnectorOfficeMetrics + """ + Office Agent activity metrics for a single connector on a given day, broken out + by Office product. + """ + + read_call_count: Optional[int] = None + """ + Number of connector tool calls on the requested day whose trusted read-only + annotation marked them read-only. Call count, not distinct users. Every call + recorded on a classified surface lands in exactly one of `read_call_count`, + `write_call_count`, or `unclassified_call_count`, so the three sum to the day's + classified calls. Classification is forward-only per surface: claude.ai from + 2026-06-01, Claude Code from 2026-05-30, Claude in Office from 2026-05-29, + Cowork from 2026-06-02 (Cowork clients predating annotation forwarding land in + `unclassified_call_count`). Null, never 0, when the value cannot be stated: the + read/write split is not enabled for this organization, or the day predates + 2026-05-29. For a date-range total, sum the per-day values, but treat a window + that extends before 2026-05-29 as null rather than summing only its covered days + — date-range rollup mode (`starting_date`/`ending_date`) applies both rules + server-side. + """ + + unclassified_call_count: Optional[int] = None + """ + Number of connector tool calls on the requested day with no trusted read-only + annotation — the annotation is optional in the MCP spec and is discarded when + connector access controls are active, so unclassified calls are common. This + field shows how much of the day's classified activity the read/write split + actually covers. Call count, not distinct users. One of the three + call-classification buckets; see `read_call_count` for the per-surface + data-start dates, null conditions, and date-range guidance. + """ + + write_call_count: Optional[int] = None + """ + Number of connector tool calls on the requested day whose trusted read-only + annotation marked them not read-only. Call count, not distinct users. One of the + three call-classification buckets; see `read_call_count` for the per-surface + data-start dates, null conditions, and date-range guidance. + """ + + chat_cowork_unified_metrics: Optional[BetaAnalyticsConnectorChatCoworkUnifiedMetrics] = None + """ + Connector use recorded while members had Chat and Cowork unified (Cowork's + features inside claude.ai chat) turned on, split into chat conversations and + Cowork sessions. A count is null in date-range mode where it cannot be computed. + Omitted from the response where Chat and Cowork unified is not available. + """ + + product: Optional[str] = None + """ + Product that produced this row's activity: one of `chat`, `claude_code`, + `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). + These are the canonical Cost & Usage product names; an `office_agent` row's + per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, + `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin + attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and + `chat_cowork_unified` occur (the surfaces that create artifacts); + `/apps/chat/projects` does not support the product dimension (a `product` entry + in `group_by[]` or `filter[]` there is rejected). Present only when the request + grouped by `product`. + """ + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ + + user_id: Optional[str] = None + """Tagged user identifier (e.g. + + `user_...`). Present only when the request grouped by `user_id`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..daa4c387d883865f0551f6985b28c5248ed62feb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_chat_metrics.py @@ -0,0 +1,20 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics"] + + +class BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics(BaseModel): + """ + A connector's use in chat conversations recorded while members had + Chat and Cowork unified turned on. + """ + + distinct_conversation_connector_used_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_conversation_connector_used_count`, for + activity recorded while members had Chat and Cowork unified turned on. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..890e0625f783bbba1e3066514e01f3f546a68a41 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_metrics.py @@ -0,0 +1,28 @@ +from ...._models import BaseModel +from .beta_analytics_connector_chat_cowork_unified_chat_metrics import ( + BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics, +) +from .beta_analytics_connector_chat_cowork_unified_sessions_metrics import ( + BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics, +) + +__all__ = ["BetaAnalyticsConnectorChatCoworkUnifiedMetrics"] + + +class BetaAnalyticsConnectorChatCoworkUnifiedMetrics(BaseModel): + """ + A connector's use in Chat and Cowork unified on one day: `chat` holds its + use in chat conversations and `sessions` its use in Cowork sessions. + """ + + chat: BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics + """ + A connector's use in chat conversations recorded while members had Chat and + Cowork unified turned on. + """ + + sessions: BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics + """ + A connector's use in Cowork sessions recorded while members had Chat and Cowork + unified turned on. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_sessions_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_sessions_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..97c9a4820cb4da5445ea0fa8db64f8fc610c7d3d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_cowork_unified_sessions_metrics.py @@ -0,0 +1,20 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics"] + + +class BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics(BaseModel): + """ + A connector's use in Cowork sessions recorded while members had + Chat and Cowork unified turned on. + """ + + distinct_session_connector_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_session_connector_used_count`, for + activity recorded while members had Chat and Cowork unified turned on. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..29f8b531b245eda6be635af0c17142900f4859ea --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_chat_metrics.py @@ -0,0 +1,16 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorChatMetrics"] + + +class BetaAnalyticsConnectorChatMetrics(BaseModel): + """Claude.ai activity metrics for a single connector on a given day.""" + + distinct_conversation_connector_used_count: Optional[int] = None + """Number of distinct conversations in which the connector was used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_claude_code_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_claude_code_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..7db7790289fc3578e9e1b256f3fb36ce19ef5b56 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_claude_code_metrics.py @@ -0,0 +1,16 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorClaudeCodeMetrics"] + + +class BetaAnalyticsConnectorClaudeCodeMetrics(BaseModel): + """Claude Code activity metrics for a single connector on a given day.""" + + distinct_session_connector_used_count: Optional[int] = None + """Number of distinct Claude Code sessions in which the connector was used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_cowork_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_cowork_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..2ecb050b9944ac5d705d5287fe759f45345e45e1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_cowork_metrics.py @@ -0,0 +1,16 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorCoworkMetrics"] + + +class BetaAnalyticsConnectorCoworkMetrics(BaseModel): + """Cowork activity metrics for a single connector on a given day.""" + + distinct_session_connector_used_count: Optional[int] = None + """Number of distinct Cowork sessions in which the connector was used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..ecf704cd4e1ef1fdf8c26d542b81d3b5e0ffc3cf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsConnectorGroupBy"] + +BetaAnalyticsConnectorGroupBy: TypeAlias = Literal["product", "rbac_group_id", "user_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..c1d83b7c61cf8ef9316e1869c8e932dcefaa0139 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_metrics.py @@ -0,0 +1,34 @@ +from ...._models import BaseModel +from .beta_analytics_connector_office_product_metrics import BetaAnalyticsConnectorOfficeProductMetrics + +__all__ = ["BetaAnalyticsConnectorOfficeMetrics"] + + +class BetaAnalyticsConnectorOfficeMetrics(BaseModel): + """ + Office Agent activity metrics for a single connector on a given day, broken out by Office product. + """ + + excel: BetaAnalyticsConnectorOfficeProductMetrics + """ + Office Agent activity metrics for a single connector on a given day within one + Office product. + """ + + outlook: BetaAnalyticsConnectorOfficeProductMetrics + """ + Office Agent activity metrics for a single connector on a given day within one + Office product. + """ + + powerpoint: BetaAnalyticsConnectorOfficeProductMetrics + """ + Office Agent activity metrics for a single connector on a given day within one + Office product. + """ + + word: BetaAnalyticsConnectorOfficeProductMetrics + """ + Office Agent activity metrics for a single connector on a given day within one + Office product. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_product_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_product_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..2a603f6419b50b8bd952f1b7259990b3ebf4807e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_connector_office_product_metrics.py @@ -0,0 +1,18 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsConnectorOfficeProductMetrics"] + + +class BetaAnalyticsConnectorOfficeProductMetrics(BaseModel): + """ + Office Agent activity metrics for a single connector on a given day within one Office product. + """ + + distinct_session_connector_used_count: Optional[int] = None + """Number of distinct Office Agent sessions in which the connector was used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_context_window.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_context_window.py new file mode 100644 index 0000000000000000000000000000000000000000..612376b917c7e3b73608f345d1919b0669d1b31d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_context_window.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsContextWindow"] + +BetaAnalyticsContextWindow: TypeAlias = Literal["0-200k", "200k-1M"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_core_code_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_core_code_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..7ef84cc17db8bcb0f7652608ccfe7b93b4812ec1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_core_code_metrics.py @@ -0,0 +1,36 @@ +from typing import Optional + +from ...._models import BaseModel +from .beta_analytics_lines_of_code import BetaAnalyticsLinesOfCode + +__all__ = ["BetaAnalyticsCoreCodeMetrics"] + + +class BetaAnalyticsCoreCodeMetrics(BaseModel): + """Core Claude Code activity metrics for a single user on a given day.""" + + artifacts_created_count: int + """ + Number of artifacts created in Claude Code sessions: an artifact counts once, on + the day a session first saves it. Counted from 2026-08-17; 0 on earlier days. + Exact in date-range mode: a creation belongs to exactly one day, so the per-day + counts never overlap and their sum over the window is the exact count of + distinct creations in it. + """ + + commit_count: int + """Number of commits made via Claude Code""" + + distinct_session_count: Optional[int] = None + """Number of distinct Claude Code sessions. + + On aggregated rows and in date-range mode: summed per-day distinct counts. A + session essentially never spans a UTC day, so the sum is in practice the true + distinct count. + """ + + lines_of_code: BetaAnalyticsLinesOfCode + """Lines of code added and removed via Claude Code.""" + + pull_request_count: int + """Number of pull requests created via Claude Code""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_bucketed_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_bucketed_result.py new file mode 100644 index 0000000000000000000000000000000000000000..a882ded6b75ccd426afa6dae12b719285a6a45bd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_bucketed_result.py @@ -0,0 +1,124 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_analytics_cost_type import BetaAnalyticsCostType +from .beta_analytics_token_type import BetaAnalyticsTokenType +from .beta_analytics_context_window import BetaAnalyticsContextWindow +from .beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory + +__all__ = ["BetaAnalyticsCostBucketedResult"] + + +class BetaAnalyticsCostBucketedResult(BaseModel): + amount: str + """Amount (post-discount, pre-credit) in fractional cents.""" + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + cost_type: Optional[BetaAnalyticsCostType] = None + """ + Cost component when `group_by[]=cost_type`; null otherwise (amount is the + combined total). + """ + + currency: str + """Currency code for the cost amount. Currently always `"USD"`.""" + + inference_geo: Optional[Literal["global", "us"]] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + list_amount: str + """List-price amount (pre-discount) in fractional cents.""" + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + Null when `group_by` includes `cost_type` or `token_type` (the count has no + per-component attribution; read it from the ungrouped response). For sandbox / + code-execution events, this counts execution spans rather than HTTP requests + (these rows surface with `product: null`). + """ + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[Literal["fast", "standard"]] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + token_type: Optional[BetaAnalyticsTokenType] = None + """Token type when `group_by[]=token_type` and `cost_type=tokens`; null otherwise.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_report_time_bucket.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_report_time_bucket.py new file mode 100644 index 0000000000000000000000000000000000000000..0679d50a917100c4807ade7e1ad146586754fc55 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_report_time_bucket.py @@ -0,0 +1,23 @@ +from typing import List +from datetime import datetime + +from ...._models import BaseModel +from .beta_analytics_cost_bucketed_result import BetaAnalyticsCostBucketedResult + +__all__ = ["BetaAnalyticsCostReportTimeBucket"] + + +class BetaAnalyticsCostReportTimeBucket(BaseModel): + ending_at: datetime + """End of the time bucket (exclusive) in RFC 3339 format.""" + + results: List[BetaAnalyticsCostBucketedResult] + """Rows for this time bucket. + + Empty when the bucket has no data; otherwise a single combined row when + `group_by[]` is omitted, or one row per group (subject to the per-bucket group + cap described on the `group_by[]` parameter). + """ + + starting_at: datetime + """Start of the time bucket (inclusive) in RFC 3339 format.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_type.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_type.py new file mode 100644 index 0000000000000000000000000000000000000000..9182f20001969ff92687347a7ba275120029b5ab --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_type.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsCostType"] + +BetaAnalyticsCostType: TypeAlias = Literal["code_execution", "tokens", "web_search"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_users_item.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_users_item.py new file mode 100644 index 0000000000000000000000000000000000000000..cff7de8eefe725f772c0da5d03cf0def8793e20a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cost_users_item.py @@ -0,0 +1,139 @@ +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_analytics_cost_type import BetaAnalyticsCostType +from .beta_analytics_token_type import BetaAnalyticsTokenType +from .beta_analytics_user_actor import BetaAnalyticsUserActor +from .beta_analytics_context_window import BetaAnalyticsContextWindow +from .beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory + +__all__ = ["BetaAnalyticsCostUsersItem"] + + +class BetaAnalyticsCostUsersItem(BaseModel): + actor: BetaAnalyticsUserActor + """The user this row's usage or cost is attributed to. Always a `user_actor`.""" + + amount: str + """Amount (post-discount, pre-credit) in fractional cents (minor units).""" + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + cost_type: Optional[BetaAnalyticsCostType] = None + """Cost component breakdown; null when returning the combined total.""" + + currency: str + """Currency code for the cost amount. Currently always `"USD"`.""" + + ending_at: Optional[datetime] = None + """ + End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to + `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set. + """ + + inference_geo: Optional[Literal["global", "us"]] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + list_amount: str + """List-price amount (pre-discount) in fractional cents.""" + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + Null when `group_by` includes `cost_type` or `token_type` (the count has no + per-component attribution; read it from the ungrouped response). For sandbox / + code-execution events, this counts execution spans rather than HTTP requests + (these rows surface with `product: null`). + """ + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[Literal["fast", "standard"]] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + starting_at: Optional[datetime] = None + """Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. + + Null unless `bucket_width` is set; without `bucket_width`, each row aggregates + the full requested range. + """ + + token_type: Optional[BetaAnalyticsTokenType] = None + """Token type when `cost_type` is `tokens`; null otherwise.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cowork_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cowork_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..d2e42a04f606328636a286ee2f6e8cda2d12c299 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_cowork_metrics.py @@ -0,0 +1,107 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsCoworkMetrics"] + + +class BetaAnalyticsCoworkMetrics(BaseModel): + """Cowork activity metrics for a single user on a given day.""" + + action_count: int + """Number of tool actions completed in Cowork sessions""" + + artifacts_created_count: int + """ + Number of artifacts created in Cowork sessions: an artifact counts once, on the + day a session first saves it. Counted from 2026-08-17; 0 on earlier days. Exact + in date-range mode: a creation belongs to exactly one day, so the per-day counts + never overlap and their sum over the window is the exact count of distinct + creations in it. + """ + + connectors_used_count: int + """Total number of connector invocations in Cowork sessions""" + + dispatch_turn_count: int + """Number of Dispatch (background agent) turns completed""" + + distinct_connectors_used_count: Optional[int] = None + """Number of distinct connectors used in Cowork sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_plugins_used_count: Optional[int] = None + """Number of distinct plugins used in Cowork sessions. + + Null while Cowork plugin-use metrics are not enabled for this organization. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_session_count: Optional[int] = None + """Number of distinct Cowork sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_skills_used_count: Optional[int] = None + """Number of distinct skills used in Cowork sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + edit_tool_count: Optional[int] = None + """Number of successful Edit tool calls in Cowork sessions. + + Null while the file-edit metrics are not enabled for this organization. + """ + + file_edit_count: Optional[int] = None + """ + Number of successful file-edit tool calls (Edit, MultiEdit, Write, NotebookEdit) + in Cowork sessions. Null, never 0, while the file-edit metrics are not enabled + for this organization. + """ + + message_count: int + """Number of messages sent in Cowork sessions""" + + multi_edit_tool_count: Optional[int] = None + """Number of successful MultiEdit tool calls in Cowork sessions. + + Null while the file-edit metrics are not enabled for this organization. + """ + + notebook_edit_tool_count: Optional[int] = None + """Number of successful NotebookEdit tool calls in Cowork sessions. + + Null while the file-edit metrics are not enabled for this organization. + """ + + plugins_used_count: Optional[int] = None + """Total number of plugin invocations in Cowork sessions. + + Null while Cowork plugin-use metrics are not enabled for this organization. + """ + + sessions_with_file_edits_count: Optional[int] = None + """ + Number of distinct Cowork sessions with at least one successful file-edit tool + call. Null while the file-edit metrics are not enabled for this organization. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + skills_used_count: int + """Total number of skill invocations in Cowork sessions""" + + write_tool_count: Optional[int] = None + """Number of successful Write tool calls in Cowork sessions. + + Null while the file-edit metrics are not enabled for this organization. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_design_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_design_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..8d928c2d908e7001eb418ca7a09cd0b0858ad24d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_design_metrics.py @@ -0,0 +1,34 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsDesignMetrics"] + + +class BetaAnalyticsDesignMetrics(BaseModel): + """Claude Design activity metrics for a single user on a given day.""" + + distinct_projects_created_count: int + """Number of distinct Claude Design projects created. + + Exact in date-range mode: a creation belongs to exactly one day, so the per-day + counts never overlap and their sum over the window is the exact count of + distinct creations in it. + """ + + distinct_projects_used_count: Optional[int] = None + """Number of distinct Claude Design projects the user worked in. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_session_count: Optional[int] = None + """Number of distinct Claude Design sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + message_count: int + """Number of messages sent in Claude Design sessions""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..f605ca0eef4850577dacc96881a43e99b54dca65 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor.py @@ -0,0 +1,22 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_analytics_federated_actor_provider import BetaAnalyticsFederatedActorProvider + +__all__ = ["BetaAnalyticsFederatedActor"] + + +class BetaAnalyticsFederatedActor(BaseModel): + provider: BetaAnalyticsFederatedActorProvider + """The trusted provider that asserted the caller's identity.""" + + subject: Optional[str] = None + """ + The provider's identifier for the caller: on `aws`, the IAM principal ARN (one + role is one actor across its sessions); on `gcp`, the caller's IAM principal + identifier as Google Cloud reports it, such as `serviceAccount:`, + `user:`, or a `principal://...` URI. + """ + + type: Literal["federated_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_aws_provider.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_aws_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..a26052f537f09a409dedb97dd174d21095ac7f6d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_aws_provider.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsFederatedActorAWSProvider"] + + +class BetaAnalyticsFederatedActorAWSProvider(BaseModel): + account_id: str + """The AWS account the organization is bound to.""" + + signed_principal: str + """The AWS-signed ARN of the IAM principal that made the requests.""" + + type: Literal["aws"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_azure_provider.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_azure_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..5695dcc48e5b8046569e2f78bb99b192b63626dd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_azure_provider.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsFederatedActorAzureProvider"] + + +class BetaAnalyticsFederatedActorAzureProvider(BaseModel): + subscription_id: str + """The Azure subscription the organization is bound to.""" + + type: Literal["azure"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_gcp_provider.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_gcp_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..d99a48cee921c0124dbba9da9d2c81f8263c9d45 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_gcp_provider.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsFederatedActorGCPProvider"] + + +class BetaAnalyticsFederatedActorGCPProvider(BaseModel): + project_number: str + """The Google Cloud project the organization is bound to.""" + + type: Literal["gcp"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_oidc_provider.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_oidc_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..4dd99fc183621eefa3228d078850982cf18426c2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_oidc_provider.py @@ -0,0 +1,13 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsFederatedActorOIDCProvider"] + + +class BetaAnalyticsFederatedActorOIDCProvider(BaseModel): + issuer: Optional[str] = None + """The federation issuer's URL.""" + + type: Literal["oidc"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_provider.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..9b809501cea4919dfad579b90adc7f62b7f7e252 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_federated_actor_provider.py @@ -0,0 +1,20 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_analytics_federated_actor_aws_provider import BetaAnalyticsFederatedActorAWSProvider +from .beta_analytics_federated_actor_gcp_provider import BetaAnalyticsFederatedActorGCPProvider +from .beta_analytics_federated_actor_oidc_provider import BetaAnalyticsFederatedActorOIDCProvider +from .beta_analytics_federated_actor_azure_provider import BetaAnalyticsFederatedActorAzureProvider + +__all__ = ["BetaAnalyticsFederatedActorProvider"] + +BetaAnalyticsFederatedActorProvider: TypeAlias = Annotated[ + Union[ + BetaAnalyticsFederatedActorAWSProvider, + BetaAnalyticsFederatedActorAzureProvider, + BetaAnalyticsFederatedActorGCPProvider, + BetaAnalyticsFederatedActorOIDCProvider, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_grouped_cost_type.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_grouped_cost_type.py new file mode 100644 index 0000000000000000000000000000000000000000..f5cb59a00352ba094629a84f5aa79f7d0bffb832 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_grouped_cost_type.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsGroupedCostType"] + +BetaAnalyticsGroupedCostType: TypeAlias = Literal["code_execution", "session_usage", "tokens", "web_search"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_inference_geo_filter.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_inference_geo_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..f70c76870cc89d38dc44c626bb0ed00e22a18001 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_inference_geo_filter.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsInferenceGeoFilter"] + +BetaAnalyticsInferenceGeoFilter: TypeAlias = Literal["global", "not_available", "us"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_lines_of_code.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_lines_of_code.py new file mode 100644 index 0000000000000000000000000000000000000000..c98b0f567679b4d8b7f06c9048358f581dade052 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_lines_of_code.py @@ -0,0 +1,13 @@ +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsLinesOfCode"] + + +class BetaAnalyticsLinesOfCode(BaseModel): + """Lines of code added and removed via Claude Code.""" + + added_count: int + """Lines of code added""" + + removed_count: int + """Lines of code removed""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..fb7afef9b213f006646a9b0aae59acc5192136ea --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_metrics.py @@ -0,0 +1,34 @@ +from ...._models import BaseModel +from .beta_analytics_office_product_metrics import BetaAnalyticsOfficeProductMetrics + +__all__ = ["BetaAnalyticsOfficeMetrics"] + + +class BetaAnalyticsOfficeMetrics(BaseModel): + """ + Office Agent activity metrics for a single user on a given day, broken out by Office product. + """ + + excel: BetaAnalyticsOfficeProductMetrics + """ + Office Agent activity metrics for a single user on a given day within one Office + product. + """ + + outlook: BetaAnalyticsOfficeProductMetrics + """ + Office Agent activity metrics for a single user on a given day within one Office + product. + """ + + powerpoint: BetaAnalyticsOfficeProductMetrics + """ + Office Agent activity metrics for a single user on a given day within one Office + product. + """ + + word: BetaAnalyticsOfficeProductMetrics + """ + Office Agent activity metrics for a single user on a given day within one Office + product. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_product_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_product_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..a935e55d360374b32785f6a8487f80c4bb599009 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_office_product_metrics.py @@ -0,0 +1,41 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsOfficeProductMetrics"] + + +class BetaAnalyticsOfficeProductMetrics(BaseModel): + """ + Office Agent activity metrics for a single user on a given day within one Office product. + """ + + connectors_used_count: int + """Number of MCP connector invocations""" + + distinct_connectors_used_count: Optional[int] = None + """Number of distinct MCP connectors used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_session_count: Optional[int] = None + """Number of distinct Office Agent sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + distinct_skills_used_count: Optional[int] = None + """Number of distinct skills used. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + message_count: int + """Number of messages sent""" + + skills_used_count: int + """Number of skill invocations""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_order.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_order.py new file mode 100644 index 0000000000000000000000000000000000000000..bf13f04f5ce94ba15e6048c30f9c2f636d1f2ba6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_order.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsOrder"] + +BetaAnalyticsOrder: TypeAlias = Literal["asc", "desc"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..4d25a4971466c3d709d33436e7cda8b5dcf1922d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_activity.py @@ -0,0 +1,94 @@ +from typing import Optional + +from ...._models import BaseModel +from .beta_analytics_plugin_cowork_metrics import BetaAnalyticsPluginCoworkMetrics +from .beta_analytics_plugin_claude_code_metrics import BetaAnalyticsPluginClaudeCodeMetrics +from .beta_analytics_plugin_chat_cowork_unified_metrics import BetaAnalyticsPluginChatCoworkUnifiedMetrics + +__all__ = ["BetaAnalyticsPluginActivity"] + + +class BetaAnalyticsPluginActivity(BaseModel): + """Per-plugin install + invocation activity for a given day. + + With `group_by[]=user_id` / `rbac_group_id` / `product` (`cowork`, + `claude_code` and `chat_cowork_unified` only on this endpoint) each row is + one (plugin, user), (plugin, group), or (plugin, product) cut: the flat + `user_id` / `rbac_group_id` / `product` keys carry the cut and the counts + are scoped to it. + """ + + claude_code_metrics: BetaAnalyticsPluginClaudeCodeMetrics + """Claude Code activity metrics for a single plugin on a given day.""" + + cowork_metrics: BetaAnalyticsPluginCoworkMetrics + """Cowork activity metrics for a single plugin on a given day.""" + + distinct_user_count: int + """ + Number of distinct users with recorded install or invocation activity for the + plugin on the requested day (install-only users count), or, in date-range mode, + over the requested window — recomputed as an exact distinct count over the + window's per-member daily rows, never a sum of per-day values. + """ + + install_count: Optional[int] = None + """ + Number of distinct users who installed the plugin on the requested day, or, in + date-range mode, over the requested window — recomputed as an exact distinct + count over the window's per-member daily rows, never a sum of per-day values. + """ + + invocation_count: int + """Number of plugin invocations on the requested day""" + + plugin_id: Optional[str] = None + """Stable plugin identifier when available (e.g. + + `serena@claude-plugins-official`). Null for third-party Claude Code plugins + (redacted at the source) and Cowork slash commands that carry only a hashed id. + """ + + plugin_name: str + """Name of the plugin""" + + chat_cowork_unified_metrics: Optional[BetaAnalyticsPluginChatCoworkUnifiedMetrics] = None + """ + Plugin use recorded while members had Chat and Cowork unified (Cowork's features + inside claude.ai chat) turned on. A count is null in date-range mode where it + cannot be computed. Omitted from the response where Chat and Cowork unified is + not available. + """ + + product: Optional[str] = None + """ + Product that produced this row's activity: one of `chat`, `claude_code`, + `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). + These are the canonical Cost & Usage product names; an `office_agent` row's + per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, + `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin + attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and + `chat_cowork_unified` occur (the surfaces that create artifacts); + `/apps/chat/projects` does not support the product dimension (a `product` entry + in `group_by[]` or `filter[]` there is rejected). Present only when the request + grouped by `product`. + """ + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ + + user_id: Optional[str] = None + """Tagged user identifier (e.g. + + `user_...`). Present only when the request grouped by `user_id`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_chat_cowork_unified_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_chat_cowork_unified_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..fa6316dff8737ca059d08935309b4ce58594a9bf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_chat_cowork_unified_metrics.py @@ -0,0 +1,19 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsPluginChatCoworkUnifiedMetrics"] + + +class BetaAnalyticsPluginChatCoworkUnifiedMetrics(BaseModel): + """ + A plugin's use in Cowork sessions recorded while members had Chat + and Cowork unified turned on. + """ + + distinct_session_plugin_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_session_plugin_used_count`, for + activity recorded while members had Chat and Cowork unified turned on. Null on + aggregated rows where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_claude_code_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_claude_code_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..b502fd19764e9001131619ebcea80c3a4d9e0104 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_claude_code_metrics.py @@ -0,0 +1,15 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsPluginClaudeCodeMetrics"] + + +class BetaAnalyticsPluginClaudeCodeMetrics(BaseModel): + """Claude Code activity metrics for a single plugin on a given day.""" + + distinct_session_plugin_used_count: Optional[int] = None + """Number of distinct Claude Code sessions in which the plugin was invoked. + + Null on aggregated rows where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_cowork_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_cowork_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..9725de639a724fae3a4dc8cbe74be0bcf3498d13 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_cowork_metrics.py @@ -0,0 +1,15 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsPluginCoworkMetrics"] + + +class BetaAnalyticsPluginCoworkMetrics(BaseModel): + """Cowork activity metrics for a single plugin on a given day.""" + + distinct_session_plugin_used_count: Optional[int] = None + """Number of distinct Cowork sessions in which the plugin was invoked. + + Null on aggregated rows where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..facead5a0e67167ec801d08ade230980ca1b4906 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_plugin_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsPluginGroupBy"] + +BetaAnalyticsPluginGroupBy: TypeAlias = Literal["product", "rbac_group_id", "user_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_product_filter.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_product_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..d4d5ccf4b0033fade7f063e2ae51155ab1195687 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_product_filter.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsProductFilter"] + +BetaAnalyticsProductFilter: TypeAlias = Literal[ + "chat", + "chat_cowork_unified", + "claude-tag", + "claude_code", + "claude_design", + "claude_in_chrome", + "cowork", + "office_agent", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..9cf8b261e0b8bdc5b8f9a3900be9877ed07c3159 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_activity.py @@ -0,0 +1,65 @@ +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel +from .beta_analytics_user import BetaAnalyticsUser + +__all__ = ["BetaAnalyticsProjectActivity"] + + +class BetaAnalyticsProjectActivity(BaseModel): + """Per-project activity data for a given day.""" + + created_at: Optional[datetime] = None + """Project creation timestamp in RFC 3339 format. + + Null if the project was deleted before attribution was recorded. + """ + + created_by: Optional[BetaAnalyticsUser] = None + """User who created the project. + + Null if the project was deleted before attribution was recorded, or if the + creator's account no longer exists. + """ + + distinct_conversation_count: Optional[int] = None + """Number of distinct conversations in the project. + + Null on aggregated rows where a distinct count cannot be computed. + """ + + distinct_user_count: int + """ + Number of distinct users who used the project on the requested day, or, in + date-range mode, over the requested window — recomputed as an exact distinct + count over the window's per-member daily rows, never a sum of per-day values. + """ + + message_count: int + """Number of messages sent in the project on the requested day""" + + project_id: str + """Tagged project identifier (e.g. `claude_proj_...`)""" + + project_name: str + """Name of the project""" + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ + + user_id: Optional[str] = None + """Tagged user identifier (e.g. + + `user_...`). Present only when the request grouped by `user_id`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..2e2bb7aa66d1618fc9c5d6897db5c1d3c19e19f2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_project_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsProjectGroupBy"] + +BetaAnalyticsProjectGroupBy: TypeAlias = Literal["rbac_group_id", "user_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_report_user_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_report_user_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..5f770ec1594de6a8ab3b37207dfc1a53d9a335aa --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_report_user_actor.py @@ -0,0 +1,39 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsReportUserActor"] + + +class BetaAnalyticsReportUserActor(BaseModel): + deleted: bool + """ + True when the account has been deleted, or when the user is no longer a member + of the organization or its associated organizations (for example, their + membership was removed or they were deprovisioned via your identity provider). + `email_address` stays populated for removed users and is null when the account + has been deleted. `name` follows the rules described on that field. The + `user_id` is still populated for reconciliation. + """ + + email_address: Optional[str] = None + """ + The user's current email address, including for users who are no longer members + of the organization. Null when the account has been deleted and for + system-minted service accounts. + """ + + name: Optional[str] = None + """The user's current full name. + + Null when the user has not set one. `"Deleted User"` when the account has been + deleted, or when the user is no longer a member and the organization hides + removed users' names. + """ + + type: Literal["user_actor"] + """Actor type. Always `"user_actor"`.""" + + user_id: str + """Tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_science_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_science_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..9df473df9bb22d3366f1d2384f62b9a2a1b6223d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_science_metrics.py @@ -0,0 +1,31 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsScienceMetrics"] + + +class BetaAnalyticsScienceMetrics(BaseModel): + """Claude Science activity metrics for a single user on a given day.""" + + delegation_count: int + """ + Number of delegations (handoffs to a specialized agent) in Claude Science + sessions + """ + + distinct_session_count: Optional[int] = None + """Number of distinct Claude Science sessions. + + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ + + message_count: int + """Number of messages sent in Claude Science sessions""" + + remote_compute_job_count: int + """Number of remote compute jobs launched from Claude Science sessions""" + + skills_used_count: int + """Total number of skill invocations in Claude Science sessions""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_server_tool_use.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_server_tool_use.py new file mode 100644 index 0000000000000000000000000000000000000000..b0fed20960051e8063c4c2a8bc5431a8bd5a3300 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_server_tool_use.py @@ -0,0 +1,8 @@ +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsServerToolUse"] + + +class BetaAnalyticsServerToolUse(BaseModel): + web_search_requests: int + """The number of web search requests made.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_account_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_account_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..36a727a01a3ab3dfc173deb0050f7b82ffd3c023 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_account_actor.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsServiceAccountActor"] + + +class BetaAnalyticsServiceAccountActor(BaseModel): + service_account_id: str + """Tagged service account ID.""" + + type: Literal["service_account_actor"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_tier.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_tier.py new file mode 100644 index 0000000000000000000000000000000000000000..b5d8d13662c5e24270f403b08d37531f300c76bf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_service_tier.py @@ -0,0 +1,7 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsServiceTier"] + +BetaAnalyticsServiceTier: TypeAlias = Literal[ + "batch", "flex", "flex_discount", "priority", "priority_on_demand", "standard" +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_single_day_activity_summary.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_single_day_activity_summary.py new file mode 100644 index 0000000000000000000000000000000000000000..b30ea3ceb075522c3f3c4955c7b285b4d4ab30a7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_single_day_activity_summary.py @@ -0,0 +1,208 @@ +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSingleDayActivitySummary"] + + +class BetaAnalyticsSingleDayActivitySummary(BaseModel): + """Per-day entry in the /summaries response.""" + + assigned_seat_count: Optional[int] = None + """Number of seats currently assigned to members. + + Null when the response is scoped to an RBAC group — seat assignment is org-wide + and has no per-group analogue. + """ + + cowork_daily_active_user_count: int + """Number of users with Cowork activity on the requested day""" + + cowork_monthly_active_user_count: int + """Number of users with Cowork activity in the 30-day rolling window""" + + cowork_weekly_active_user_count: int + """Number of users with Cowork activity in the 7-day rolling window""" + + daily_active_user_count: int + """Number of users with token consumption on the requested day""" + + daily_adoption_rate: Optional[float] = None + """ + Percentage of assigned seats with activity on the requested day + (`DAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC + group. + """ + + ending_at: datetime + """End of the aggregation period (exclusive), UTC midnight in RFC 3339 format (e.g. + + `2026-01-16T00:00:00Z`). + """ + + monthly_active_user_count: int + """Number of users with token consumption in the 30-day rolling window""" + + monthly_adoption_rate: Optional[float] = None + """ + Percentage of assigned seats with activity in the 30-day rolling window + (`MAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC + group. + """ + + pending_invite_count: Optional[int] = None + """Number of pending invitations to join the organization. + + Null when the response is scoped to an RBAC group. + """ + + starting_at: datetime + """ + Start of the aggregation period (inclusive), UTC midnight in RFC 3339 format + (e.g. `2026-01-15T00:00:00Z`). + """ + + weekly_active_user_count: int + """Number of users with token consumption in the 7-day rolling window""" + + weekly_adoption_rate: Optional[float] = None + """ + Percentage of assigned seats with activity in the 7-day rolling window + (`WAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC + group. + """ + + chat_cowork_unified_daily_active_user_count: Optional[int] = None + """Number of users with activity in Chat and Cowork unified on the requested day. + + Omitted from the response where Chat and Cowork unified is not available. + """ + + chat_cowork_unified_monthly_active_user_count: Optional[int] = None + """ + Number of users with activity in Chat and Cowork unified in the 28-day rolling + window (30 days when the request filters by `rbac_group_id`). Omitted from the + response where Chat and Cowork unified is not available. + """ + + chat_cowork_unified_weekly_active_user_count: Optional[int] = None + """ + Number of users with activity in Chat and Cowork unified in the 7-day rolling + window. Omitted from the response where Chat and Cowork unified is not + available. + """ + + chat_daily_active_user_count: Optional[int] = None + """Number of users with claude.ai (chat) activity on the requested day. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + chat_monthly_active_user_count: Optional[int] = None + """Number of users with claude.ai (chat) activity in the 30-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + chat_weekly_active_user_count: Optional[int] = None + """Number of users with claude.ai (chat) activity in the 7-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_code_daily_active_user_count: Optional[int] = None + """Number of users with Claude Code activity on the requested day. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_code_monthly_active_user_count: Optional[int] = None + """Number of users with Claude Code activity in the 30-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_code_weekly_active_user_count: Optional[int] = None + """Number of users with Claude Code activity in the 7-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_design_daily_active_user_count: Optional[int] = None + """Number of users with Claude Design activity on the requested day. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_design_monthly_active_user_count: Optional[int] = None + """Number of users with Claude Design activity in the 30-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + claude_design_weekly_active_user_count: Optional[int] = None + """Number of users with Claude Design activity in the 7-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + office_agent_daily_active_user_count: Optional[int] = None + """Number of users with Claude in Office activity on the requested day. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + office_agent_monthly_active_user_count: Optional[int] = None + """Number of users with Claude in Office activity in the 30-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + office_agent_weekly_active_user_count: Optional[int] = None + """Number of users with Claude in Office activity in the 7-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + science_daily_active_user_count: Optional[int] = None + """Number of users with Claude Science activity on the requested day. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + science_entitled_user_count: Optional[int] = None + """ + Number of users with a Claude Science seat entitlement (per-seat RBAC) at the + time of the daily snapshot. The funnel top; independent of the org-level Claude + Science toggle. Null when the response is scoped to an RBAC group — entitlement + is org-wide and has no per-group analogue. Omitted from the response while the + per-product breakdown is not enabled for this organization. + """ + + science_monthly_active_user_count: Optional[int] = None + """Number of users with Claude Science activity in the 30-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ + + science_weekly_active_user_count: Optional[int] = None + """Number of users with Claude Science activity in the 7-day rolling window. + + Omitted from the response while the per-product breakdown is not enabled for + this organization. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..3f01be46b9c8625c144b33bdace7cb5b77fc6ae1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_activity.py @@ -0,0 +1,196 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_analytics_skill_chat_metrics import BetaAnalyticsSkillChatMetrics +from .beta_analytics_skill_cowork_metrics import BetaAnalyticsSkillCoworkMetrics +from .beta_analytics_skill_office_metrics import BetaAnalyticsSkillOfficeMetrics +from .beta_analytics_skill_claude_code_metrics import BetaAnalyticsSkillClaudeCodeMetrics +from .beta_analytics_skill_chat_cowork_unified_metrics import BetaAnalyticsSkillChatCoworkUnifiedMetrics + +__all__ = ["BetaAnalyticsSkillActivity"] + + +class BetaAnalyticsSkillActivity(BaseModel): + """Per-skill activity data for a given day.""" + + attributed_list_price: Optional[str] = None + """ + List-price (rate-card) value of the member requests attributed to this skill, as + a decimal string in the minor unit of `currency` (cents for USD), from Claude + Code, Cowork, and Office Agent request-level attribution — the value of requests + that involved the skill, not the skill's incremental cost. Unlike + `estimated_overage_spend` this reflects usage value regardless of how it was + funded — seat-covered usage counts — but it is undiscounted and does not tie to + billed spend or the organization's spend reporting. claude.ai chat usage carries + no request-level attribution and contributes nothing: the field is null on + `chat` product rows and on `office_agent` product cuts dated before 2026-06-18 + (the Office Agent attribution data-start), and on ungrouped rows it covers the + Claude Code + Cowork + Office Agent share only (null when no attributable usage + exists). Also null under the same conditions as `estimated_overage_spend` (spend + reporting not enabled for this organization, `office_agent` product cuts before + the 2026-06-18 data-start). "0" means attributable usage existed but none was + attributed to this skill. Addable across days: date-range rollup mode returns + the window's sum. On `group_by[]` and `filter[]` shapes both amounts can total + below the ungrouped value for the same skill over the same date or range: spend + attributed to a member–skill pair with no counted usage on that day is excluded + from those cuts. + """ + + chat_metrics: BetaAnalyticsSkillChatMetrics + """Claude.ai activity metrics for a single skill on a given day.""" + + claude_code_metrics: BetaAnalyticsSkillClaudeCodeMetrics + """Claude Code activity metrics for a single skill on a given day.""" + + cowork_metrics: BetaAnalyticsSkillCoworkMetrics + """Cowork activity metrics for a single skill on a given day.""" + + currency: Optional[str] = None + """ + Currency for this row's monetary fields (`estimated_overage_spend` and + `attributed_list_price`), as an uppercase ISO-4217 code. Always "USD" when + either amount is populated; null whenever both amounts are null. + """ + + distinct_user_count: int + """ + Number of distinct users who used the skill on the requested day, or, in + date-range mode, over the requested window — recomputed as an exact distinct + count over the window's per-member daily rows, never a sum of per-day values. A + skill counts as used only when it is explicitly activated — the model (or the + user, via the skill's slash command) invokes it, reading its instructions into + context as part of that activation. Skills that are merely installed or listed + as available, or whose content reaches the context without an activation + (preloaded, hook-injected, or read as a plain file), are not counted. + """ + + enable_count: Optional[int] = None + """ + Distinct accounts that enabled this skill on the requested day (claude.ai only — + the skill analog of plugin `install_count`). The count is org-wide: null when + enable reporting is not enabled for this organization, or when the request + scopes to `user_id` / `rbac_group_id` / `product` via `group_by[]` or `filter[]` + (an org-wide count would be misleading on per-cut rows). A distinct count, not + an event count: summing across days double-counts members who enable the skill + on more than one day, so it is also null in date-range rollup mode + (`starting_date`/`ending_date`). + """ + + estimated_overage_spend: Optional[str] = None + """ + Estimated overage spend attributed to this skill, as a decimal string in the + minor unit of `currency` (cents for USD; "1250" is $12.50, fractional cents + possible) — an allocation of each member's daily post-discount, pre-credit + metered overage spend (the same cost basis as the organization's spend reporting + and the Cost & Usage API, so per-skill figures are directly comparable; spend + with no skill attribution — including any member-day without skill invocations — + is not represented, so skill rows sum to at most those totals) across the skills + the member used. Overage only: usage covered by included seat allowances bills + nothing and allocates $0 here — see `attributed_list_price` for the + funding-independent usage-value companion. Claude Code, Cowork, and Office Agent + spend use request-level skill attribution; claude.ai chat spend is approximated + proportionally to skill-invoking messages. An estimate, not a billing number — + and the cost of the requests/messages that involved the skill, not the skill's + incremental cost (the same request would still have cost something without the + skill active). "0" means no overage spend was attributed; null when spend + reporting is not enabled for this organization, on `office_agent` product cuts + dated before 2026-06-18 (the Office Agent attribution data-start). Addable + across days: date-range rollup mode (`starting_date`/`ending_date`) returns the + window's sum. With `group_by[]=user_id` each row carries the user's own + attributed spend. On `group_by[]` and `filter[]` shapes both amounts can total + below the ungrouped value for the same skill over the same date or range: spend + attributed to a member–skill pair with no counted usage on that day is excluded + from those cuts. + """ + + invocation_count: Optional[int] = None + """ + Total number of times this skill was invoked on the requested day (the skill + analog of plugin `invocation_count`). Unlike `distinct_user_count` — which + answers '# of users' — this is the true '# of uses'. A skill counts as used only + when it is explicitly activated — the model (or the user, via the skill's slash + command) invokes it, reading its instructions into context as part of that + activation. Skills that are merely installed or listed as available, or whose + content reaches the context without an activation (preloaded, hook-injected, or + read as a plain file), are not counted. Null when invocation reporting is not + enabled for this organization. Sum across a date range for total uses in the + window — date-range rollup mode (`starting_date`/`ending_date`) returns this sum + directly. + """ + + office_metrics: BetaAnalyticsSkillOfficeMetrics + """ + Office Agent activity metrics for a single skill on a given day, broken out by + Office product. + """ + + share_status: Optional[Literal["organization", "private", "public"]] = None + """ + Skill share status (claude.ai only): one of `private`, `organization`, or + `public`. Null for skills used only in Claude Code or Office (no per-skill + share-status concept) and when share-status reporting is not yet available for + the organization. Filterable via `filter[]=share_status:{value}`. + """ + + skill_display_name: Optional[str] = None + """ + Human-readable display name for rows whose `skill_name` is an opaque skill id + (user/organization skill types and plugin-delivered skills, whose user-defined + names usage reports generally withhold). Organization-shared skills and skills + delivered by the organization's own plugins (its plugin marketplaces and its + library) resolve; plugin skill names are shown without their 'plugin:' prefix. + The literal 'unknown' bucket row gets a fixed 'Unknown skill' label. For a + member's own skill (private or personal-plugin) it is null, except when the + skill's owner used it from Claude Code or Cowork in the requested period: then + it shows the name that client reported at the time. Apart from that, the names + of members' own skills are not disclosed to analytics-key holders. Also null for + Anthropic-provided plugin skills (not resolved), for an organization skill or + plugin whose name can no longer be found (for example, one since deleted), when + `skill_name` is already a display name, or when display-name resolution is not + enabled for this organization. + """ + + skill_name: str + """Name of the skill""" + + chat_cowork_unified_metrics: Optional[BetaAnalyticsSkillChatCoworkUnifiedMetrics] = None + """ + Skill use recorded while members had Chat and Cowork unified (Cowork's features + inside claude.ai chat) turned on, split into chat conversations and Cowork + sessions. A count is null in date-range mode where it cannot be computed. + Omitted from the response where Chat and Cowork unified is not available. + """ + + product: Optional[str] = None + """ + Product that produced this row's activity: one of `chat`, `claude_code`, + `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). + These are the canonical Cost & Usage product names; an `office_agent` row's + per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, + `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin + attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and + `chat_cowork_unified` occur (the surfaces that create artifacts); + `/apps/chat/projects` does not support the product dimension (a `product` entry + in `group_by[]` or `filter[]` there is rejected). Present only when the request + grouped by `product`. + """ + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ + + user_id: Optional[str] = None + """Tagged user identifier (e.g. + + `user_...`). Present only when the request grouped by `user_id`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..9e1b5e8406444f4d18dd9465fb459e3c7aee65ea --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_chat_metrics.py @@ -0,0 +1,20 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillChatCoworkUnifiedChatMetrics"] + + +class BetaAnalyticsSkillChatCoworkUnifiedChatMetrics(BaseModel): + """ + A skill's use in chat conversations recorded while members had + Chat and Cowork unified turned on. + """ + + distinct_conversation_skill_used_count: Optional[int] = None + """ + Same measure as `chat_metrics.distinct_conversation_skill_used_count`, for + activity recorded while members had Chat and Cowork unified turned on. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..7b630a8ced66192b5e311ffbaa422c876e416565 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_metrics.py @@ -0,0 +1,26 @@ +from ...._models import BaseModel +from .beta_analytics_skill_chat_cowork_unified_chat_metrics import BetaAnalyticsSkillChatCoworkUnifiedChatMetrics +from .beta_analytics_skill_chat_cowork_unified_sessions_metrics import ( + BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics, +) + +__all__ = ["BetaAnalyticsSkillChatCoworkUnifiedMetrics"] + + +class BetaAnalyticsSkillChatCoworkUnifiedMetrics(BaseModel): + """ + A skill's use in Chat and Cowork unified on one day: `chat` holds its use + in chat conversations and `sessions` its use in Cowork sessions. + """ + + chat: BetaAnalyticsSkillChatCoworkUnifiedChatMetrics + """ + A skill's use in chat conversations recorded while members had Chat and Cowork + unified turned on. + """ + + sessions: BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics + """ + A skill's use in Cowork sessions recorded while members had Chat and Cowork + unified turned on. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_sessions_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_sessions_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..3317499c7b3cff2b6a774cfd2dcc1e8c8908e66a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_cowork_unified_sessions_metrics.py @@ -0,0 +1,20 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics"] + + +class BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics(BaseModel): + """ + A skill's use in Cowork sessions recorded while members had Chat + and Cowork unified turned on. + """ + + distinct_session_skill_used_count: Optional[int] = None + """ + Same measure as `cowork_metrics.distinct_session_skill_used_count`, for activity + recorded while members had Chat and Cowork unified turned on. Approximate (HLL, + typical error <2%) in date-range mode. Null on aggregated rows where a distinct + count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..a3ddcd46cd28888c4ea0b528d659e1a2e2de9467 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_chat_metrics.py @@ -0,0 +1,21 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillChatMetrics"] + + +class BetaAnalyticsSkillChatMetrics(BaseModel): + """Claude.ai activity metrics for a single skill on a given day.""" + + distinct_conversation_skill_used_count: Optional[int] = None + """Number of distinct conversations in which the skill was used. + + A skill counts as used only when it is explicitly activated — the model (or the + user, via the skill's slash command) invokes it, reading its instructions into + context as part of that activation. Skills that are merely installed or listed + as available, or whose content reaches the context without an activation + (preloaded, hook-injected, or read as a plain file), are not counted. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_claude_code_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_claude_code_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..54e5e18dc236be798621373b9ab80fc69685dfeb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_claude_code_metrics.py @@ -0,0 +1,21 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillClaudeCodeMetrics"] + + +class BetaAnalyticsSkillClaudeCodeMetrics(BaseModel): + """Claude Code activity metrics for a single skill on a given day.""" + + distinct_session_skill_used_count: Optional[int] = None + """Number of distinct Claude Code sessions in which the skill was used. + + A skill counts as used only when it is explicitly activated — the model (or the + user, via the skill's slash command) invokes it, reading its instructions into + context as part of that activation. Skills that are merely installed or listed + as available, or whose content reaches the context without an activation + (preloaded, hook-injected, or read as a plain file), are not counted. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_cowork_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_cowork_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..d723ebab7c19f52793b96170199834af3a811b68 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_cowork_metrics.py @@ -0,0 +1,21 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillCoworkMetrics"] + + +class BetaAnalyticsSkillCoworkMetrics(BaseModel): + """Cowork activity metrics for a single skill on a given day.""" + + distinct_session_skill_used_count: Optional[int] = None + """Number of distinct Cowork sessions in which the skill was used. + + A skill counts as used only when it is explicitly activated — the model (or the + user, via the skill's slash command) invokes it, reading its instructions into + context as part of that activation. Skills that are merely installed or listed + as available, or whose content reaches the context without an activation + (preloaded, hook-injected, or read as a plain file), are not counted. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..cffa6d2f9f64eb8d70429e5c389a1487c1e88d67 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsSkillGroupBy"] + +BetaAnalyticsSkillGroupBy: TypeAlias = Literal["product", "rbac_group_id", "user_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..b9f3d6575379a7af4744e9586876833ab6383d3d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_metrics.py @@ -0,0 +1,34 @@ +from ...._models import BaseModel +from .beta_analytics_skill_office_product_metrics import BetaAnalyticsSkillOfficeProductMetrics + +__all__ = ["BetaAnalyticsSkillOfficeMetrics"] + + +class BetaAnalyticsSkillOfficeMetrics(BaseModel): + """ + Office Agent activity metrics for a single skill on a given day, broken out by Office product. + """ + + excel: BetaAnalyticsSkillOfficeProductMetrics + """ + Office Agent activity metrics for a single skill on a given day within one + Office product. + """ + + outlook: BetaAnalyticsSkillOfficeProductMetrics + """ + Office Agent activity metrics for a single skill on a given day within one + Office product. + """ + + powerpoint: BetaAnalyticsSkillOfficeProductMetrics + """ + Office Agent activity metrics for a single skill on a given day within one + Office product. + """ + + word: BetaAnalyticsSkillOfficeProductMetrics + """ + Office Agent activity metrics for a single skill on a given day within one + Office product. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_product_metrics.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_product_metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..df74cca576c7bbc1bd7a2f87217ef8e354041b2f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_skill_office_product_metrics.py @@ -0,0 +1,23 @@ +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsSkillOfficeProductMetrics"] + + +class BetaAnalyticsSkillOfficeProductMetrics(BaseModel): + """ + Office Agent activity metrics for a single skill on a given day within one Office product. + """ + + distinct_session_skill_used_count: Optional[int] = None + """Number of distinct Office Agent sessions in which the skill was used. + + A skill counts as used only when it is explicitly activated — the model (or the + user, via the skill's slash command) invokes it, reading its instructions into + context as part of that activation. Skills that are merely installed or listed + as available, or whose content reaches the context without an activation + (preloaded, hook-injected, or read as a plain file), are not counted. + Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows + where a distinct count cannot be computed. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_speed.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_speed.py new file mode 100644 index 0000000000000000000000000000000000000000..6f11936de7eb27b7e751645357e5dadd9bfab6a3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_speed.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsSpeed"] + +BetaAnalyticsSpeed: TypeAlias = Literal["fast", "standard"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_time_bucket_width.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_time_bucket_width.py new file mode 100644 index 0000000000000000000000000000000000000000..84d9b6642a651e72d4800b8e72415ab341cb8034 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_time_bucket_width.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsTimeBucketWidth"] + +BetaAnalyticsTimeBucketWidth: TypeAlias = Literal["1d", "1h", "1m"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_token_type.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_token_type.py new file mode 100644 index 0000000000000000000000000000000000000000..155f8e1e108115c185e92f5451abbda093092d6a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_token_type.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsTokenType"] + +BetaAnalyticsTokenType: TypeAlias = Literal[ + "cache_creation.ephemeral_1h_input_tokens", + "cache_creation.ephemeral_5m_input_tokens", + "cache_read_input_tokens", + "output_tokens", + "uncached_input_tokens", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_action_counts.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_action_counts.py new file mode 100644 index 0000000000000000000000000000000000000000..59e2f296f3125e3e50aa4506b3ee4b281a4caf72 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_action_counts.py @@ -0,0 +1,13 @@ +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsToolActionCounts"] + + +class BetaAnalyticsToolActionCounts(BaseModel): + """Accepted/rejected counts for a single Claude Code tool type.""" + + accepted_count: int + """Number of tool proposals accepted""" + + rejected_count: int + """Number of tool proposals rejected""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_actions.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_actions.py new file mode 100644 index 0000000000000000000000000000000000000000..10c7c2a3a52f248628c58321a51e61d124a0614f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_tool_actions.py @@ -0,0 +1,20 @@ +from ...._models import BaseModel +from .beta_analytics_tool_action_counts import BetaAnalyticsToolActionCounts + +__all__ = ["BetaAnalyticsToolActions"] + + +class BetaAnalyticsToolActions(BaseModel): + """Per-tool accepted/rejected counts for Claude Code file modification tools.""" + + edit_tool: BetaAnalyticsToolActionCounts + """Accepted/rejected counts for a single Claude Code tool type.""" + + multi_edit_tool: BetaAnalyticsToolActionCounts + """Accepted/rejected counts for a single Claude Code tool type.""" + + notebook_edit_tool: BetaAnalyticsToolActionCounts + """Accepted/rejected counts for a single Claude Code tool type.""" + + write_tool: BetaAnalyticsToolActionCounts + """Accepted/rejected counts for a single Claude Code tool type.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_bucketed_result.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_bucketed_result.py new file mode 100644 index 0000000000000000000000000000000000000000..e906031afb479ed213844f54130226355cdc51ee --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_bucketed_result.py @@ -0,0 +1,119 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from ..beta_cache_creation import BetaCacheCreation +from .beta_analytics_context_window import BetaAnalyticsContextWindow +from .beta_analytics_server_tool_use import BetaAnalyticsServerToolUse +from .beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory + +__all__ = ["BetaAnalyticsUsageBucketedResult"] + + +class BetaAnalyticsUsageBucketedResult(BaseModel): + cache_creation: BetaCacheCreation + """The number of input tokens for cache creation.""" + + cache_read_input_tokens: int + """The number of input tokens read from the cache.""" + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + inference_geo: Optional[Literal["global", "us"]] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + output_tokens: int + """The number of output tokens generated.""" + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + For sandbox / code-execution events, this counts execution spans rather than + HTTP requests (these rows surface with `product: null`). + """ + + server_tool_use: BetaAnalyticsServerToolUse + """Server-side tool usage metrics.""" + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[Literal["fast", "standard"]] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + uncached_input_tokens: int + """The number of uncached input tokens processed.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_inference_geo.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_inference_geo.py new file mode 100644 index 0000000000000000000000000000000000000000..23e8d657cfb60ed2b7de0a777514828f554c87e2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_inference_geo.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUsageCostInferenceGeo"] + +BetaAnalyticsUsageCostInferenceGeo: TypeAlias = Literal["global", "us"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_product_filter.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_product_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..453af091cdba933eb8866a0b7ead3e45a8edb514 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_product_filter.py @@ -0,0 +1,18 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUsageCostProductFilter"] + +BetaAnalyticsUsageCostProductFilter: TypeAlias = Literal[ + "chat", + "chat_cowork_unified", + "claude_code", + "claude_console", + "claude_design", + "claude_in_chrome", + "claude_tag", + "cowork", + "managed_agents_api", + "message_batches_api", + "messages_api", + "office_agent", +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_sort_order.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_sort_order.py new file mode 100644 index 0000000000000000000000000000000000000000..3cd6b7cf0c59cde2fe49ad6b1a5fde7cd93b380c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_cost_sort_order.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUsageCostSortOrder"] + +BetaAnalyticsUsageCostSortOrder: TypeAlias = Literal["asc", "desc"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_report_time_bucket.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_report_time_bucket.py new file mode 100644 index 0000000000000000000000000000000000000000..4c4259cf364983510a2059f5f1cb047ae01f213b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_report_time_bucket.py @@ -0,0 +1,23 @@ +from typing import List +from datetime import datetime + +from ...._models import BaseModel +from .beta_analytics_usage_bucketed_result import BetaAnalyticsUsageBucketedResult + +__all__ = ["BetaAnalyticsUsageReportTimeBucket"] + + +class BetaAnalyticsUsageReportTimeBucket(BaseModel): + ending_at: datetime + """End of the time bucket (exclusive) in RFC 3339 format.""" + + results: List[BetaAnalyticsUsageBucketedResult] + """Rows for this time bucket. + + Empty when the bucket has no data; otherwise a single combined row when + `group_by[]` is omitted, or one row per group (subject to the per-bucket group + cap described on the `group_by[]` parameter). + """ + + starting_at: datetime + """Start of the time bucket (inclusive) in RFC 3339 format.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_users_item.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_users_item.py new file mode 100644 index 0000000000000000000000000000000000000000..8434b6ae769c03cf8cef776654b3ac5b95020dc5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_usage_users_item.py @@ -0,0 +1,143 @@ +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from ..beta_cache_creation import BetaCacheCreation +from .beta_analytics_user_actor import BetaAnalyticsUserActor +from .beta_analytics_context_window import BetaAnalyticsContextWindow +from .beta_analytics_server_tool_use import BetaAnalyticsServerToolUse +from .beta_analytics_claude_tag_category import BetaAnalyticsClaudeTagCategory + +__all__ = ["BetaAnalyticsUsageUsersItem"] + + +class BetaAnalyticsUsageUsersItem(BaseModel): + actor: BetaAnalyticsUserActor + """The user this row's usage or cost is attributed to. Always a `user_actor`.""" + + cache_creation: BetaCacheCreation + """The number of input tokens for cache creation.""" + + cache_read_input_tokens: int + """The number of input tokens read from the cache.""" + + claude_tag_category: Optional[BetaAnalyticsClaudeTagCategory] = None + """ + Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed + Claude in a channel or thread), `proactive` (Claude responded without being + addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching + a channel it was asked to monitor), or `dm` (direct messages with Claude). + Populated only when `claude_tag_category` is in `group_by[]`; null for usage + that is not Claude Tag. New categories may be added over time. + """ + + claude_tag_user_id: Optional[str] = None + """ + Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude + in Slack) usage is attributed to, not a claude.ai user ID. Populated only when + `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag + and for Claude Tag usage that is not attributed to a single user (for example + `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum + to less than the Claude Tag total. Cannot be combined with + `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter. + """ + + context_window: Optional[BetaAnalyticsContextWindow] = None + """Context-window pricing tier of the usage or cost. + + Null unless `context_window` is in `group_by[]`; it can also be null on grouped + rows with no context-window tier, such as code execution. + """ + + ending_at: Optional[datetime] = None + """ + End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to + `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set. + """ + + inference_geo: Optional[Literal["global", "us"]] = None + """Inference region of the usage or cost. + + Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped + rows where the region is not set (the rows that `inference_geos[]=not_available` + matches). + """ + + model: Optional[str] = None + """ + Model that produced the usage or cost, as a model name in the form the + `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` + is in `group_by[]`; it can also be null on grouped rows whose usage or cost is + not attributed to a specific model, such as code execution. + """ + + output_tokens: int + """The number of output tokens generated.""" + + product: Optional[str] = None + """Product surface that produced the usage or cost. + + Null unless product is in `group_by[]`; it can also be null on grouped rows + whose usage cannot be attributed to a known surface. Values include `chat`, + `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, + `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude + product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's + features inside claude.ai chat: chat and Cowork usage by a member who has it + turned on is reported under this value instead of `chat` or `cowork`. It is + accepted as a filter only where Chat and Cowork unified is available. Some + unattributed usage is reported as "other". + """ + + rbac_group_id: Optional[str] = None + """ + RBAC group (team) the usage is attributed to, in the public tagged + `rbac_group_...` spelling — the same spelling the activity resources use for + this key, so the same team has one id across resources and it round-trips as an + `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in + `group_by[]`. Any-membership semantics: a user in several groups contributes + their full usage to each of those groups' rows, so the named-group rows overlap + and their sum can exceed the org total. A null value is the single unassigned + row: users in no group on that (UTC) day. For the true org total, run the same + query without `group_by[]`. + """ + + requests: Optional[int] = None + """Number of API requests in this row's scope. + + For sandbox / code-execution events, this counts execution spans rather than + HTTP requests (these rows surface with `product: null`). + """ + + server_tool_use: BetaAnalyticsServerToolUse + """Server-side tool usage metrics.""" + + slack_channel_id: Optional[str] = None + """Slack channel the usage originated from. + + Populated only when `slack_channel_id` is in `group_by[]`; null for usage + outside Slack, for some Claude Tag usage that has no channel recorded, and for + usage recorded before channel attribution was enabled. + """ + + speed: Optional[Literal["fast", "standard"]] = None + """Inference speed mode of the usage or cost: `fast` or `standard`. + + Null unless `speed` is in `group_by[]`. + """ + + starting_at: Optional[datetime] = None + """Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. + + Null unless `bucket_width` is set; without `bucket_width`, each row aggregates + the full requested range. + """ + + total_tokens: int + """Total token count across all token types. + + This is the value the default `order_by` (`total_tokens`) sorts on. + """ + + uncached_input_tokens: int + """The number of uncached input tokens processed.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user.py new file mode 100644 index 0000000000000000000000000000000000000000..693845c3aed602221a1acddbd88dccf7f22a6d28 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user.py @@ -0,0 +1,18 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsUser"] + + +class BetaAnalyticsUser(BaseModel): + """A user in the organization, identified by tagged id and email address.""" + + id: str + """Tagged user identifier (e.g. `user_...`)""" + + email_address: str + """Email address of the user""" + + type: Literal["user"] + """Object type. Always `user`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_activity.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_activity.py new file mode 100644 index 0000000000000000000000000000000000000000..02e3650e8257e0d401fd9d0a7b5d3977c124bf28 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_activity.py @@ -0,0 +1,88 @@ +from typing import Optional +from datetime import date + +from ...._models import BaseModel +from .beta_analytics_user import BetaAnalyticsUser +from .beta_analytics_chat_metrics import BetaAnalyticsChatMetrics +from .beta_analytics_cowork_metrics import BetaAnalyticsCoworkMetrics +from .beta_analytics_design_metrics import BetaAnalyticsDesignMetrics +from .beta_analytics_office_metrics import BetaAnalyticsOfficeMetrics +from .beta_analytics_science_metrics import BetaAnalyticsScienceMetrics +from .beta_analytics_claude_code_metrics import BetaAnalyticsClaudeCodeMetrics +from .beta_analytics_chat_cowork_unified_metrics import BetaAnalyticsChatCoworkUnifiedMetrics + +__all__ = ["BetaAnalyticsUserActivity"] + + +class BetaAnalyticsUserActivity(BaseModel): + """Per-user activity data for a given day.""" + + chat_metrics: BetaAnalyticsChatMetrics + """Claude.ai activity metrics for a single user on a given day.""" + + claude_code_metrics: BetaAnalyticsClaudeCodeMetrics + """Claude Code activity metrics for a single user on a given day.""" + + cowork_metrics: BetaAnalyticsCoworkMetrics + """Cowork activity metrics for a single user on a given day.""" + + design_metrics: BetaAnalyticsDesignMetrics + """Claude Design activity metrics for a single user on a given day.""" + + distinct_user_count: Optional[int] = None + """Number of distinct active users represented by this row. + + Only set for grouped rollups (`group_by[]`); null for per-user rows. In + date-range mode, recomputed as an exact distinct count of the group's active + members over the requested window, never a sum of per-day values. + """ + + office_metrics: BetaAnalyticsOfficeMetrics + """ + Office Agent activity metrics for a single user on a given day, broken out by + Office product. + """ + + science_metrics: BetaAnalyticsScienceMetrics + """Claude Science activity metrics for a single user on a given day.""" + + user: Optional[BetaAnalyticsUser] = None + """The user this row describes. Null on rows aggregated across users.""" + + web_search_count: int + """Number of web searches performed""" + + chat_cowork_unified_metrics: Optional[BetaAnalyticsChatCoworkUnifiedMetrics] = None + """ + Activity recorded while the member had Chat and Cowork unified (Cowork's + features inside claude.ai chat) turned on, split into `chat` (chat activity) and + `sessions` (Cowork activity). Omitted from the response where Chat and Cowork + unified is not available. + """ + + last_activity_date: Optional[date] = None + """ + Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity, + within the requested window: equal to the requested `date` in single-day mode, + and to the latest active day from `starting_date` (inclusive) to `ending_date` + (exclusive) in date-range rollup mode — never a day earlier than the window + start. On filtered requests (`filter[]`) only days matching the filter count: + with `filter[]=rbac_group_id:{id}` it is the last day the user was active while + a member of that group, consistent with the row's other metrics. On grouped + (`group_by[]`) rows it is the latest day any member of the group was active (the + requested `date` in single-day mode). Omitted from the response while + last-activity reporting is not enabled for this organization. + """ + + rbac_group_id: Optional[str] = None + """ + Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API + spelling. Present only when the request grouped by `rbac_group_id`. + """ + + rbac_group_name: Optional[str] = None + """ + Resolved RBAC group display name, alongside `rbac_group_id` when name resolution + is available. Null if the group has been deleted or its name could not be + resolved; `rbac_group_id` remains the stable key. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..1e1de837690ea85dd1db7d257f80ccd65bd4603d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_actor.py @@ -0,0 +1,43 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAnalyticsUserActor"] + + +class BetaAnalyticsUserActor(BaseModel): + deleted: bool + """ + True when the account has been deleted, or when the user is no longer a member + of the organization or its associated organizations (for example, their + membership was removed or they were deprovisioned via your identity provider). + `email_address` stays populated for removed users and is null when the account + has been deleted. `name` follows the rules described on that field. The + `user_id` is still populated for reconciliation. + """ + + email_address: Optional[str] = None + """ + The user's email address, including for users who are no longer members of the + organization or its associated organizations. Null when the account has been + deleted (check `deleted`) and for system-minted service accounts, which have no + person's mailbox behind them (check `name`). + """ + + name: Optional[str] = None + """The user's full name. + + Null when the user has not set a name. Returns `"Deleted User"` when the account + itself has been deleted, or when the user is no longer a member of the + organization or its associated organizations and the organization has chosen to + hide the names of removed users. Otherwise, the name stays populated for removed + users. Rows for system-minted service accounts render the service name (for + example, `"Claude Security"`) or null. + """ + + type: Literal["user_actor"] + """Actor type. Always `"user_actor"`.""" + + user_id: str + """Tagged user ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_group_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_group_by.py new file mode 100644 index 0000000000000000000000000000000000000000..0929bfbc6ce21db0326dbd70e96bc4ad3248a197 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_analytics_user_group_by.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaAnalyticsUserGroupBy"] + +BetaAnalyticsUserGroupBy: TypeAlias = Literal["rbac_group_id"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key.py new file mode 100644 index 0000000000000000000000000000000000000000..4a54436d3ece111a7b32da6193e9d48e16aa9691 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key.py @@ -0,0 +1,69 @@ +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._models import BaseModel, UnionDiscriminator +from .beta_api_key_created_by import BetaAPIKeyCreatedBy +from .beta_api_key_user_actor import BetaAPIKeyUserActor +from .beta_api_key_workspace_scope import BetaAPIKeyWorkspaceScope +from .beta_api_key_organization_scope import BetaAPIKeyOrganizationScope +from .beta_api_key_service_account_actor import BetaAPIKeyServiceAccountActor + +__all__ = ["BetaAPIKey", "Principal", "Scope"] + +Principal: TypeAlias = Annotated[ + Union[BetaAPIKeyUserActor, BetaAPIKeyServiceAccountActor, None], UnionDiscriminator("type") +] + +Scope: TypeAlias = Annotated[Union[BetaAPIKeyOrganizationScope, BetaAPIKeyWorkspaceScope], UnionDiscriminator("type")] + + +class BetaAPIKey(BaseModel): + id: str + """ID of the API key.""" + + created_at: datetime + """RFC 3339 datetime string indicating when the API Key was created.""" + + created_by: Optional[BetaAPIKeyCreatedBy] = None + """ + The ID and type of the actor that created the API key, or `null` when the + creator is not recorded (legacy, workload-identity-federated, or system-created + keys). + """ + + expires_at: Optional[datetime] = None + """ + RFC 3339 datetime string indicating when the API Key expires, or `null` if it + never expires. + """ + + name: str + """Name of the API key.""" + + partial_key_hint: Optional[str] = None + """Partially redacted hint for the API key.""" + + principal: Optional[Principal] = None + """ + The principal the API key acts as (a User or a Service Account), or `null` if + the API key is not bound to a principal. + """ + + scope: Scope + """ + Where the API key belongs: its Workspace + (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's + real ID even when it is the organization's default Workspace), or the + organization (`{"type": "organization"}`) for a principal-bound API key that has + no Workspace. + """ + + status: Literal["active", "archived", "expired", "inactive"] + """Status of the API key.""" + + type: Literal["api_key"] + """Object type. + + For API Keys, this is always `"api_key"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_created_by.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_created_by.py new file mode 100644 index 0000000000000000000000000000000000000000..9faf32cea7d8b48313d9a0084a31f68089d318cb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_created_by.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyCreatedBy"] + + +class BetaAPIKeyCreatedBy(BaseModel): + id: str + """ID of the actor that created the object.""" + + type: Literal["service_account", "user"] + """Type of the actor that created the object.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_organization_scope.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_organization_scope.py new file mode 100644 index 0000000000000000000000000000000000000000..122baab851fa60f55a1821671c2a1d9ad1ce7b48 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_organization_scope.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyOrganizationScope"] + + +class BetaAPIKeyOrganizationScope(BaseModel): + type: Literal["organization"] + """Scope type. + + Always `"organization"`: the API key has no Workspace. Only a principal-bound + API key can have this scope. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error.py new file mode 100644 index 0000000000000000000000000000000000000000..e94173c69435f20ee2227c48a7b488f97c1665da --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_api_key_scope_missing_error_details import BetaAPIKeyScopeMissingErrorDetails + +__all__ = ["BetaAPIKeyScopeMissingError"] + + +class BetaAPIKeyScopeMissingError(PermissionDeniedError): + """ + The API key lacks the scope the request needs: `read:claude_tag` for a read, `write:claude_tag` for a change. + """ + + error_code: Literal["api_key_scope_missing"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaAPIKeyScopeMissingErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..55714a9e85477209f7a87b04ef472af7846505f7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_scope_missing_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyScopeMissingErrorDetails"] + + +class BetaAPIKeyScopeMissingErrorDetails(BaseModel): + """ + The API key lacks the scope the request needs: `read:claude_tag` for a read, `write:claude_tag` for a change. + """ + + error_code: Literal["api_key_scope_missing"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_service_account_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_service_account_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..04245be35b0b66b8dcfbaceca4c7bfbbcc1da852 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_service_account_actor.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyServiceAccountActor"] + + +class BetaAPIKeyServiceAccountActor(BaseModel): + service_account_id: str + """ID of the Service Account the API key acts as.""" + + type: Literal["service_account_actor"] + """Principal type. Always `"service_account_actor"` for a Service Account.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_user_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_user_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..768c0f1c6f70fbea2818ad4f281373f4f8e7eecc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_user_actor.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyUserActor"] + + +class BetaAPIKeyUserActor(BaseModel): + type: Literal["user_actor"] + """Principal type. Always `"user_actor"` for a User.""" + + user_id: str + """ID of the User the API key acts as.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_workspace_scope.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_workspace_scope.py new file mode 100644 index 0000000000000000000000000000000000000000..513858a8e7d497f7505f78cc25c0b55f0ed6f0a5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_api_key_workspace_scope.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAPIKeyWorkspaceScope"] + + +class BetaAPIKeyWorkspaceScope(BaseModel): + type: Literal["workspace"] + """Scope type. Always `"workspace"`: the API key belongs to one Workspace.""" + + workspace_id: str + """ + ID of the Workspace the API key belongs to, including when it is the + organization's default Workspace. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config.py new file mode 100644 index 0000000000000000000000000000000000000000..457fa4ef7ab7e279fd94666418bdeaf1b4bae80d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config.py @@ -0,0 +1,23 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAWSExternalKeyConfig"] + + +class BetaAWSExternalKeyConfig(BaseModel): + kms_arn: str + """Full ARN of the AWS KMS key. + + On Claude Platform on AWS, alias ARNs are rejected, and your organization's own + key must be a single-Region key in your organization's AWS account. + """ + + type: Literal["aws"] + + region: Optional[str] = None + """AWS region. Derived from `kms_arn` if omitted.""" + + role_arn: Optional[str] = None + """IAM role ARN. Deprecated; this field is ignored.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a02d9f6e47b24e061404e69a363d7de2b64e3416 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_aws_external_key_config_param.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaAWSExternalKeyConfigParam"] + + +class BetaAWSExternalKeyConfigParam(TypedDict, total=False): + kms_arn: Required[str] + """Full ARN of the AWS KMS key. + + On Claude Platform on AWS, alias ARNs are rejected, and your organization's own + key must be a single-Region key in your organization's AWS account. + """ + + type: Required[Literal["aws"]] + + region: Optional[str] + """AWS region. Derived from `kms_arn` if omitted.""" + + role_arn: Optional[str] + """IAM role ARN. Deprecated; this field is ignored.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config.py new file mode 100644 index 0000000000000000000000000000000000000000..d22b6aa561c372a7814a8d38cb58261b7ebc0863 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config.py @@ -0,0 +1,29 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaAzureExternalKeyConfig"] + + +class BetaAzureExternalKeyConfig(BaseModel): + key_name: str + """Name of the key within the vault.""" + + tenant_id: str + """Azure AD tenant ID.""" + + type: Literal["azure"] + + vault_uri: str + """ + Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or + `https://{hsm-name}.managedhsm.azure.net`. + """ + + client_id: Optional[str] = None + """Azure AD application (client) ID. + + Omit to use Anthropic's multitenant app. Provide only if using a single-tenant + app registration in the customer's directory. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..2f5aed2b833cacffc744dee963c3dedc9703b287 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_azure_external_key_config_param.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaAzureExternalKeyConfigParam"] + + +class BetaAzureExternalKeyConfigParam(TypedDict, total=False): + """Azure Key Vault provider configuration.""" + + key_name: Required[str] + """Name of the key within the vault.""" + + tenant_id: Required[str] + """Azure AD tenant ID.""" + + type: Required[Literal["azure"]] + + vault_uri: Required[str] + """ + Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or + `https://{hsm-name}.managedhsm.azure.net`. + """ + + client_id: Optional[str] + """Azure AD application (client) ID. + + Omit to use Anthropic's multitenant app. Provide only if using a single-tenant + app registration in the customer's directory. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error.py new file mode 100644 index 0000000000000000000000000000000000000000..9ac6e5d0c9f5eb3af8d0583ecbf32791b92b0b99 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_cannot_sign_out_managed_member_error_details import BetaCannotSignOutManagedMemberErrorDetails + +__all__ = ["BetaCannotSignOutManagedMemberError"] + + +class BetaCannotSignOutManagedMemberError(PermissionDeniedError): + """ + On a public-sector deployment, only an API key or token that belongs to a person with owner permissions can sign out a member with the `managed` role. + """ + + error_code: Literal["cannot_sign_out_managed_member"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutManagedMemberErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..eaf54049a3ba61b9fc2af5a70f04900a24b04656 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_managed_member_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutManagedMemberErrorDetails"] + + +class BetaCannotSignOutManagedMemberErrorDetails(BaseModel): + """ + On a public-sector deployment, only an API key or token that belongs to a person with owner permissions can sign out a member with the `managed` role. + """ + + error_code: Literal["cannot_sign_out_managed_member"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error.py new file mode 100644 index 0000000000000000000000000000000000000000..5f7f8a176346e2f77d0b1d61bda52247b7af54a1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_cannot_sign_out_membership_admin_error_details import BetaCannotSignOutMembershipAdminErrorDetails + +__all__ = ["BetaCannotSignOutMembershipAdminError"] + + +class BetaCannotSignOutMembershipAdminError(PermissionDeniedError): + """ + The member is a membership admin, and the person the API key or token belongs to is not allowed to sign out membership admins. + """ + + error_code: Literal["cannot_sign_out_membership_admin"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutMembershipAdminErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..bd887d2c1a2502362a0b35f8a5761214b9696e14 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_membership_admin_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutMembershipAdminErrorDetails"] + + +class BetaCannotSignOutMembershipAdminErrorDetails(BaseModel): + """ + The member is a membership admin, and the person the API key or token belongs to is not allowed to sign out membership admins. + """ + + error_code: Literal["cannot_sign_out_membership_admin"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error.py new file mode 100644 index 0000000000000000000000000000000000000000..b76d8b68f9ea9afb1b2ea1f923bef7497dfde4a7 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_cannot_sign_out_owner_error_details import BetaCannotSignOutOwnerErrorDetails + +__all__ = ["BetaCannotSignOutOwnerError"] + + +class BetaCannotSignOutOwnerError(PermissionDeniedError): + """ + The member is an owner or has owner permissions, and this API key or token cannot sign them out. In a Claude Enterprise organization, an API key with the `write:members` scope can. + """ + + error_code: Literal["cannot_sign_out_owner"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutOwnerErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..326be876d2adedcde96962410128b66145b3bba0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_owner_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutOwnerErrorDetails"] + + +class BetaCannotSignOutOwnerErrorDetails(BaseModel): + """ + The member is an owner or has owner permissions, and this API key or token cannot sign them out. In a Claude Enterprise organization, an API key with the `write:members` scope can. + """ + + error_code: Literal["cannot_sign_out_owner"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error.py new file mode 100644 index 0000000000000000000000000000000000000000..001fe6a07c8887f8646560398ad1acb9ddf6f66b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import BadRequestError +from .beta_cannot_sign_out_primary_owner_error_details import BetaCannotSignOutPrimaryOwnerErrorDetails + +__all__ = ["BetaCannotSignOutPrimaryOwnerError"] + + +class BetaCannotSignOutPrimaryOwnerError(BadRequestError): + """ + The member is the organization's primary owner, whom no API key or token can sign out. + """ + + error_code: Literal["cannot_sign_out_primary_owner"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutPrimaryOwnerErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..d49a05d896f2334c8c98cd0303144803139e2c0d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_primary_owner_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutPrimaryOwnerErrorDetails"] + + +class BetaCannotSignOutPrimaryOwnerErrorDetails(BaseModel): + """ + The member is the organization's primary owner, whom no API key or token can sign out. + """ + + error_code: Literal["cannot_sign_out_primary_owner"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error.py new file mode 100644 index 0000000000000000000000000000000000000000..3e3864a1a2fe0ef7044bccdf82839efc59b742cd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_cannot_sign_out_privileged_member_error_details import BetaCannotSignOutPrivilegedMemberErrorDetails + +__all__ = ["BetaCannotSignOutPrivilegedMemberError"] + + +class BetaCannotSignOutPrivilegedMemberError(PermissionDeniedError): + """ + This OAuth token cannot sign out a membership admin or a member whose roles grant owner, user management, or identity and access management. + """ + + error_code: Literal["cannot_sign_out_privileged_member"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutPrivilegedMemberErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..941b239805385de402ae33ef418c0ce0c2690a15 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_privileged_member_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutPrivilegedMemberErrorDetails"] + + +class BetaCannotSignOutPrivilegedMemberErrorDetails(BaseModel): + """ + This OAuth token cannot sign out a membership admin or a member whose roles grant owner, user management, or identity and access management. + """ + + error_code: Literal["cannot_sign_out_privileged_member"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error.py new file mode 100644 index 0000000000000000000000000000000000000000..d063da27ade7a69815185b6534ca79607f2d225a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._exceptions import BadRequestError +from .beta_cannot_sign_out_self_error_details import BetaCannotSignOutSelfErrorDetails + +__all__ = ["BetaCannotSignOutSelfError"] + + +class BetaCannotSignOutSelfError(BadRequestError): + """The member is the user the API key or token belongs to.""" + + error_code: Literal["cannot_sign_out_self"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaCannotSignOutSelfErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..cfbe62edebc1462add25872e51a130501c025084 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_cannot_sign_out_self_error_details.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaCannotSignOutSelfErrorDetails"] + + +class BetaCannotSignOutSelfErrorDetails(BaseModel): + """The member is the user the API key or token belongs to.""" + + error_code: Literal["cannot_sign_out_self"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_default_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_default_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..38744ebf54d001f0e8d5db3a9fd01880951d817f --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_default_setting_source.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagDefaultSettingSource"] + + +class BetaClaudeTagDefaultSettingSource(BaseModel): + """No settings level sets a value, and the built-in default applies.""" + + type: Literal["default"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy.py new file mode 100644 index 0000000000000000000000000000000000000000..78121ba37cf1fd0b9d691084e772b470cb319c43 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy.py @@ -0,0 +1,14 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_claude_tag_guest_policy_allow import BetaClaudeTagGuestPolicyAllow +from .beta_claude_tag_guest_policy_restrict import BetaClaudeTagGuestPolicyRestrict +from .beta_claude_tag_guest_policy_channel_only import BetaClaudeTagGuestPolicyChannelOnly + +__all__ = ["BetaClaudeTagGuestPolicy"] + +BetaClaudeTagGuestPolicy: TypeAlias = Annotated[ + Union[BetaClaudeTagGuestPolicyAllow, BetaClaudeTagGuestPolicyRestrict, BetaClaudeTagGuestPolicyChannelOnly], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow.py new file mode 100644 index 0000000000000000000000000000000000000000..ff985923cf0198065dd6a3a3c9c6d17f4430ad52 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagGuestPolicyAllow"] + + +class BetaClaudeTagGuestPolicyAllow(BaseModel): + """Claude answers in the channel.""" + + type: Literal["allow"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow_param.py new file mode 100644 index 0000000000000000000000000000000000000000..455478a393ff7bef7c4e49ee34e9294002594b27 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_allow_param.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaClaudeTagGuestPolicyAllowParam"] + + +class BetaClaudeTagGuestPolicyAllowParam(TypedDict, total=False): + """Claude answers in the channel.""" + + type: Required[Literal["allow"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only.py new file mode 100644 index 0000000000000000000000000000000000000000..aa76162bea8d3e861604ca9e652bf468c2cda43e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagGuestPolicyChannelOnly"] + + +class BetaClaudeTagGuestPolicyChannelOnly(BaseModel): + """Claude answers with only the Bundles attached to the channel itself.""" + + type: Literal["channel_only"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only_param.py new file mode 100644 index 0000000000000000000000000000000000000000..fd3f375e75b245ede073b7739b4cd61a306fd41d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_channel_only_param.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaClaudeTagGuestPolicyChannelOnlyParam"] + + +class BetaClaudeTagGuestPolicyChannelOnlyParam(TypedDict, total=False): + """Claude answers with only the Bundles attached to the channel itself.""" + + type: Required[Literal["channel_only"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_param.py new file mode 100644 index 0000000000000000000000000000000000000000..10a847e85a8e1e8b15b24dfb138495cce20db2b4 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_param.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .beta_claude_tag_guest_policy_allow_param import BetaClaudeTagGuestPolicyAllowParam +from .beta_claude_tag_guest_policy_restrict_param import BetaClaudeTagGuestPolicyRestrictParam +from .beta_claude_tag_guest_policy_channel_only_param import BetaClaudeTagGuestPolicyChannelOnlyParam + +__all__ = ["BetaClaudeTagGuestPolicyParam"] + +BetaClaudeTagGuestPolicyParam: TypeAlias = Union[ + BetaClaudeTagGuestPolicyAllowParam, BetaClaudeTagGuestPolicyRestrictParam, BetaClaudeTagGuestPolicyChannelOnlyParam +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict.py new file mode 100644 index 0000000000000000000000000000000000000000..028bdc09cb6d11692777086f251b8de10f3a04f6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagGuestPolicyRestrict"] + + +class BetaClaudeTagGuestPolicyRestrict(BaseModel): + """Claude does not answer in the channel.""" + + type: Literal["restrict"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict_param.py new file mode 100644 index 0000000000000000000000000000000000000000..8be4a281ced3037df80e6de8e124b670fd09bc17 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_guest_policy_restrict_param.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaClaudeTagGuestPolicyRestrictParam"] + + +class BetaClaudeTagGuestPolicyRestrictParam(TypedDict, total=False): + """Claude does not answer in the channel.""" + + type: Required[Literal["restrict"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..0536e118babf2bdc5e4497f6894b8a2c206325a8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_source.py @@ -0,0 +1,24 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_claude_tag_default_setting_source import BetaClaudeTagDefaultSettingSource +from .beta_claude_tag_slack_channel_setting_source import BetaClaudeTagSlackChannelSettingSource +from .beta_claude_tag_slack_default_setting_source import BetaClaudeTagSlackDefaultSettingSource +from .beta_claude_tag_slack_workspace_setting_source import BetaClaudeTagSlackWorkspaceSettingSource +from .beta_claude_tag_slack_grid_channel_setting_source import BetaClaudeTagSlackGridChannelSettingSource +from .beta_claude_tag_slack_parent_channel_setting_source import BetaClaudeTagSlackParentChannelSettingSource + +__all__ = ["BetaClaudeTagSettingSource"] + +BetaClaudeTagSettingSource: TypeAlias = Annotated[ + Union[ + BetaClaudeTagSlackChannelSettingSource, + BetaClaudeTagSlackWorkspaceSettingSource, + BetaClaudeTagSlackParentChannelSettingSource, + BetaClaudeTagSlackDefaultSettingSource, + BetaClaudeTagDefaultSettingSource, + BetaClaudeTagSlackGridChannelSettingSource, + ], + UnionDiscriminator("type"), +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_sources.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_sources.py new file mode 100644 index 0000000000000000000000000000000000000000..e88eec0271819b3fa7793b5d461d9e6ac852a0d9 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_setting_sources.py @@ -0,0 +1,31 @@ +from typing import List, Optional + +from ...._models import BaseModel +from .beta_claude_tag_setting_source import BetaClaudeTagSettingSource + +__all__ = ["BetaClaudeTagSettingSources"] + + +class BetaClaudeTagSettingSources(BaseModel): + """For each setting, the settings level its value in `settings` comes from. + + Without `include_inherited`, a setting the channel or workspace stores has a source that names the channel or workspace itself, and one it does not store has null, or an empty list for `instructions`. With `include_inherited=true` no member is null: a value that no settings level sets has the source `default`. + """ + + enabled: Optional[BetaClaudeTagSettingSource] = None + """The settings level `enabled` comes from.""" + + environment_id: Optional[BetaClaudeTagSettingSource] = None + """The settings level `environment_id` comes from.""" + + guest_policy: Optional[BetaClaudeTagSettingSource] = None + """The settings level `guest_policy` comes from.""" + + instructions: List[BetaClaudeTagSettingSource] + """ + Every settings level that contributes text to `instructions`, broadest first, in + the order their text is joined. Empty when none does. + """ + + model: Optional[BetaClaudeTagSettingSource] = None + """The settings level `model` comes from.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..9ffeb4d916aec129b3ceeb9cea6773b6cd27926e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings.py @@ -0,0 +1,43 @@ +from typing import Optional + +from ...._models import BaseModel +from .beta_claude_tag_guest_policy import BetaClaudeTagGuestPolicy + +__all__ = ["BetaClaudeTagSettings"] + + +class BetaClaudeTagSettings(BaseModel): + """Claude Tag settings. + + Without `include_inherited`, a setting that is null is not set on the settings level and is inherited. With it, `enabled` and `guest_policy` are never null, and `instructions`, `model` and `environment_id` are null when no settings level sets them. + """ + + enabled: Optional[bool] = None + """Whether Claude is on. The nearest settings level that sets it decides.""" + + environment_id: Optional[str] = None + """ + The environment Claude's sessions run in, starting with `env_`, or the + identifier of a self-hosted runner pool, starting with `ccpool_`. The nearest + settings level that sets it decides. + """ + + guest_policy: Optional[BetaClaudeTagGuestPolicy] = None + """What Claude does in a channel while a Slack guest is in it. + + The nearest settings level that sets it decides. + """ + + instructions: Optional[str] = None + """Instructions for Claude. + + Instructions add up: the text of every settings level that sets it is joined, + broadest first. + """ + + model: Optional[str] = None + """The model Claude uses: a model identifier or the name of a model line. + + The nearest settings level that sets it decides. When none does, Claude uses the + product's default model. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_create_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_create_param.py new file mode 100644 index 0000000000000000000000000000000000000000..dd24a9347283ba17f619798ba84e80f6448acca3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_create_param.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from .beta_claude_tag_guest_policy_param import BetaClaudeTagGuestPolicyParam + +__all__ = ["BetaClaudeTagSettingsCreateParam"] + + +class BetaClaudeTagSettingsCreateParam(TypedDict, total=False): + """The settings in a request that sets a Slack channel up. + + A setting left out is not set. A setting sent as null is cleared. + """ + + enabled: Optional[bool] + """Whether Claude is on. + + `true` on a channel turns Claude on in it even when its workspace stores + `false`. Null clears it. + """ + + environment_id: Optional[str] + """ + The environment Claude's sessions run in: the identifier of an active + environment of the organization, starting with `env_`. Null clears it. + """ + + guest_policy: Optional[BetaClaudeTagGuestPolicyParam] + """What Claude does in a channel while a Slack guest is in it. Null clears it.""" + + instructions: Optional[str] + """ + Instructions for Claude, up to 8,192 characters after leading and trailing white + space is trimmed. Null or blank text clears them. + """ + + model: Optional[str] + """ + The model Claude uses: the identifier of a model, or the name of a model line, + that the organization is entitled to for Claude Tag. Null clears it. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_update_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_update_param.py new file mode 100644 index 0000000000000000000000000000000000000000..9261ed868570c2393a07dc956eb86df3ed2fc2c0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_settings_update_param.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from .beta_claude_tag_guest_policy_param import BetaClaudeTagGuestPolicyParam + +__all__ = ["BetaClaudeTagSettingsUpdateParam"] + + +class BetaClaudeTagSettingsUpdateParam(TypedDict, total=False): + """The settings to change. + + A setting left out is unchanged. A setting sent as null is cleared, so it is inherited. + """ + + enabled: Optional[bool] + """Whether Claude is on. + + `true` on a channel turns Claude on in it even when its workspace stores + `false`. Null clears it. + """ + + environment_id: Optional[str] + """ + The environment Claude's sessions run in: the identifier of an active + environment of the organization, starting with `env_`. Null clears it. + """ + + guest_policy: Optional[BetaClaudeTagGuestPolicyParam] + """What Claude does in a channel while a Slack guest is in it. Null clears it.""" + + instructions: Optional[str] + """ + Instructions for Claude, up to 8,192 characters after leading and trailing white + space is trimmed. Null or blank text clears them. + """ + + model: Optional[str] + """ + The model Claude uses: the identifier of a model, or the name of a model line, + that the organization is entitled to for Claude Tag. Null clears it. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers.py new file mode 100644 index 0000000000000000000000000000000000000000..5cf43f3b1686c51192e7fcd374554695b742f817 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers.py @@ -0,0 +1,22 @@ +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackChannelIdentifiers"] + + +class BetaClaudeTagSlackChannelIdentifiers(BaseModel): + """The identifiers Slack shows for a channel. + + They are Slack's own, not identifiers of this API. + """ + + channel_id: str + """ + Slack's identifier for the channel, starting with `C` or `G`, such as + `C0456EFGH`. + """ + + workspace_id: str + """ + Slack's identifier for the workspace the channel is in, starting with `T`, such + as `T0123ABCD`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4d6f20e50c38e223651e004b0c332137357236c0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_identifiers_param.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BetaClaudeTagSlackChannelIdentifiersParam"] + + +class BetaClaudeTagSlackChannelIdentifiersParam(TypedDict, total=False): + """The identifiers Slack shows for a channel. + + They are Slack's own, not identifiers of this API. + """ + + channel_id: Required[str] + """ + Slack's identifier for the channel, starting with `C` or `G`, such as + `C0456EFGH`. + """ + + workspace_id: Required[str] + """ + Slack's identifier for the workspace the channel is in, starting with `T`, such + as `T0123ABCD`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..97ed8dfa191d08357715f9e373508a4be8ee11c6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_channel_setting_source.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackChannelSettingSource"] + + +class BetaClaudeTagSlackChannelSettingSource(BaseModel): + """The value comes from the addressed Slack channel itself.""" + + slack_channel_id: str + """The channel's identifier, starting with `slch_`.""" + + type: Literal["slack_channel"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_default_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_default_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..0110bd3129ea7af696c7d0c2de0445e438216bf3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_default_setting_source.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackDefaultSettingSource"] + + +class BetaClaudeTagSlackDefaultSettingSource(BaseModel): + """ + The value comes from the organization's Slack defaults, which have no identifier. + """ + + type: Literal["slack_default"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..ced804f51b2ef5b450b63be489fcbfe0f7a27383 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_claude_tag_slack_channel_identifiers import BetaClaudeTagSlackChannelIdentifiers + +__all__ = ["BetaClaudeTagSlackGridChannelSettingSource"] + + +class BetaClaudeTagSlackGridChannelSettingSource(BaseModel): + """ + The value comes from the addressed channel as it is set up under another workspace of its Enterprise Grid: a channel shared across the Grid keeps one Slack channel identifier in every workspace that sees it. + """ + + slack: BetaClaudeTagSlackChannelIdentifiers + """Slack's own identifiers for the channel under that other workspace.""" + + type: Literal["slack_grid_channel"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..79c61c0b58eed088a80fe0c8bbe9bdbdb38ef024 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackParentChannelSettingSource"] + + +class BetaClaudeTagSlackParentChannelSettingSource(BaseModel): + """The value comes from the channel that a code channel was started from. + + A parent channel contributes `instructions` and `environment_id` only. + """ + + slack_channel_id: str + """The parent channel's identifier, starting with `slch_`.""" + + type: Literal["slack_parent_channel"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_identifiers.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_identifiers.py new file mode 100644 index 0000000000000000000000000000000000000000..3949599c0a3e3c3652c6049e03fbad61fa9490ae --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_identifiers.py @@ -0,0 +1,13 @@ +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackWorkspaceIdentifiers"] + + +class BetaClaudeTagSlackWorkspaceIdentifiers(BaseModel): + """The identifier Slack shows for a workspace. + + It is Slack's own, not an identifier of this API. + """ + + workspace_id: str + """Slack's identifier for the workspace, starting with `T`, such as `T0123ABCD`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_setting_source.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_setting_source.py new file mode 100644 index 0000000000000000000000000000000000000000..a095f1a3ceb1c41d3c5f8530a800e6d71ab99e10 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_slack_workspace_setting_source.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagSlackWorkspaceSettingSource"] + + +class BetaClaudeTagSlackWorkspaceSettingSource(BaseModel): + """The value comes from a Slack workspace of the organization.""" + + slack_workspace_id: str + """The workspace's identifier, starting with `slws_`.""" + + type: Literal["slack_workspace"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error.py new file mode 100644 index 0000000000000000000000000000000000000000..5c11d1830d03dc4d97150d8352789df320ffab02 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_claude_tag_writes_not_enabled_error_details import BetaClaudeTagWritesNotEnabledErrorDetails + +__all__ = ["BetaClaudeTagWritesNotEnabledError"] + + +class BetaClaudeTagWritesNotEnabledError(PermissionDeniedError): + """Changes through the Claude Tag API are not enabled for the organization.""" + + error_code: Literal["claude_tag_writes_not_enabled"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaClaudeTagWritesNotEnabledErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..fad7fc03097eb3a84628adfe83f5943475366d9b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_claude_tag_writes_not_enabled_error_details.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaClaudeTagWritesNotEnabledErrorDetails"] + + +class BetaClaudeTagWritesNotEnabledErrorDetails(BaseModel): + """Changes through the Claude Tag API are not enabled for the organization.""" + + error_code: Literal["claude_tag_writes_not_enabled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error.py new file mode 100644 index 0000000000000000000000000000000000000000..760d3d314f5dfa45ed32e3ae4e9b85c452169870 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_compliance_configuration_restricted_error_details import BetaComplianceConfigurationRestrictedErrorDetails + +__all__ = ["BetaComplianceConfigurationRestrictedError"] + + +class BetaComplianceConfigurationRestrictedError(PermissionDeniedError): + """ + The organization's compliance configuration does not let Claude Tag store anything new. + """ + + error_code: Literal["compliance_configuration_restricted"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaComplianceConfigurationRestrictedErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..edf00e153c3196e4edecfd8ba64e138d91807c08 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_configuration_restricted_error_details.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaComplianceConfigurationRestrictedErrorDetails"] + + +class BetaComplianceConfigurationRestrictedErrorDetails(BaseModel): + """ + The organization's compliance configuration does not let Claude Tag store anything new. + """ + + error_code: Literal["compliance_configuration_restricted"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..77955694ed376509977954ddc83f4df7d5bc37af --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_compliance_settings_state import BetaComplianceSettingsState + +__all__ = ["BetaComplianceSettings"] + + +class BetaComplianceSettings(BaseModel): + state: BetaComplianceSettingsState + """Whether the Compliance API is enabled for this organization.""" + + type: Literal["compliance_settings"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state.py new file mode 100644 index 0000000000000000000000000000000000000000..7f123eaeba3445bc8024f17998d80be92478679b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state.py @@ -0,0 +1,12 @@ +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._models import UnionDiscriminator +from .beta_compliance_settings_state_enabled import BetaComplianceSettingsStateEnabled +from .beta_compliance_settings_state_disabled import BetaComplianceSettingsStateDisabled + +__all__ = ["BetaComplianceSettingsState"] + +BetaComplianceSettingsState: TypeAlias = Annotated[ + Union[BetaComplianceSettingsStateEnabled, BetaComplianceSettingsStateDisabled], UnionDiscriminator("type") +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled.py new file mode 100644 index 0000000000000000000000000000000000000000..c164cf92a5f0cb3cc87ac0e938fc05da048e73e2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaComplianceSettingsStateDisabled"] + + +class BetaComplianceSettingsStateDisabled(BaseModel): + type: Literal["disabled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled_param.py new file mode 100644 index 0000000000000000000000000000000000000000..a1bf7fef7b12f9d7da224e6a5087260d3c8282eb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_disabled_param.py @@ -0,0 +1,9 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaComplianceSettingsStateDisabledParam"] + + +class BetaComplianceSettingsStateDisabledParam(TypedDict, total=False): + type: Required[Literal["disabled"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled.py new file mode 100644 index 0000000000000000000000000000000000000000..562f2b79ca995485e9f3bb29a206432c6d156629 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaComplianceSettingsStateEnabled"] + + +class BetaComplianceSettingsStateEnabled(BaseModel): + type: Literal["enabled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled_param.py new file mode 100644 index 0000000000000000000000000000000000000000..fb46abec6aceab36b2015a737fb270bd33ebb5b2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_enabled_param.py @@ -0,0 +1,9 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaComplianceSettingsStateEnabledParam"] + + +class BetaComplianceSettingsStateEnabledParam(TypedDict, total=False): + type: Required[Literal["enabled"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_param.py new file mode 100644 index 0000000000000000000000000000000000000000..37f30231107eafce6a964f6e805a38ea3d6315e0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_compliance_settings_state_param.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .beta_compliance_settings_state_enabled_param import BetaComplianceSettingsStateEnabledParam +from .beta_compliance_settings_state_disabled_param import BetaComplianceSettingsStateDisabledParam + +__all__ = ["BetaComplianceSettingsStateParam"] + +BetaComplianceSettingsStateParam: TypeAlias = Union[ + BetaComplianceSettingsStateEnabledParam, BetaComplianceSettingsStateDisabledParam +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency.py new file mode 100644 index 0000000000000000000000000000000000000000..4a5169e056762edd42994f914c87b9705276a230 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency.py @@ -0,0 +1,18 @@ +from typing import List, Union +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_allowed_inference_geo import BetaAllowedInferenceGeo + +__all__ = ["BetaDataResidency"] + + +class BetaDataResidency(BaseModel): + allowed_inference_geos: Union[List[BetaAllowedInferenceGeo], Literal["unrestricted"]] + """Permitted inference geo values. 'unrestricted' means all geos are allowed.""" + + default_inference_geo: Literal["global", "us"] + """Default inference geo applied when requests omit the parameter.""" + + workspace_geo: Literal["us"] + """Geographic region for workspace data storage. Immutable after creation.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_create_config_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_create_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..4cb7c6afab4a2e2d44d93bce977b2310d867b4d5 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_create_config_param.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from typing_extensions import Literal, TypedDict + +from .beta_allowed_inference_geo import BetaAllowedInferenceGeo + +__all__ = ["BetaDataResidencyCreateConfigParam"] + + +class BetaDataResidencyCreateConfigParam(TypedDict, total=False): + allowed_inference_geos: Union[List[BetaAllowedInferenceGeo], Literal["unrestricted"], None] + """Permitted inference geo values. + + Defaults to 'unrestricted' if omitted, which allows all geos. Use the string + 'unrestricted' to allow all geos, or a list of specific geos. + """ + + default_inference_geo: Optional[Literal["global", "us"]] + """Default inference geo applied when requests omit the parameter. + + Defaults to 'global' if omitted. Must be a member of `allowed_inference_geos` + unless `allowed_inference_geos` is `"unrestricted"`. + """ + + workspace_geo: Optional[Literal["us"]] + """Geographic region for workspace data storage. + + Immutable after creation. Defaults to 'us' if omitted. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_update_config_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_update_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..0961b93cb619d9e47381b49a3057a08e70f7399d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_data_residency_update_config_param.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from typing import List, Union, Optional +from typing_extensions import Literal, TypedDict + +from .beta_allowed_inference_geo import BetaAllowedInferenceGeo + +__all__ = ["BetaDataResidencyUpdateConfigParam"] + + +class BetaDataResidencyUpdateConfigParam(TypedDict, total=False): + allowed_inference_geos: Union[List[BetaAllowedInferenceGeo], Literal["unrestricted"], None] + """Permitted inference geo values. + + Use 'unrestricted' to allow all geos, or a list of specific geos. + """ + + default_inference_geo: Optional[Literal["global", "us"]] + """Default inference geo applied when requests omit the parameter. + + Must be a member of `allowed_inference_geos` unless `allowed_inference_geos` is + `"unrestricted"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_organization_webhook_endpoint.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_organization_webhook_endpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..1ff0da5a936c45b536b586e8fb53832ebad911ce --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_organization_webhook_endpoint.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaDeletedOrganizationWebhookEndpoint"] + + +class BetaDeletedOrganizationWebhookEndpoint(BaseModel): + """A deleted organization webhook endpoint.""" + + id: str + """ID of the deleted webhook endpoint.""" + + type: Literal["webhook_endpoint_deleted"] + """Always `webhook_endpoint_deleted`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_plugin.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..f0c8b47f4d8db6cc4130c83a8deaa26b8f6aa9d1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_plugin.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaDeletedPlugin"] + + +class BetaDeletedPlugin(BaseModel): + id: str + """The deleted Plugin's ID.""" + + type: Literal["plugin_deleted"] + """Always `plugin_deleted`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_rbac_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_rbac_group.py new file mode 100644 index 0000000000000000000000000000000000000000..3be6daf8e19dc4ca84c7747ca1ce58b36f4c17b8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_rbac_group.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaDeletedRBACGroup"] + + +class BetaDeletedRBACGroup(BaseModel): + id: str + """ID of the RBAC Group.""" + + type: Literal["rbac_group_deleted"] + """Deleted object type. + + For RBAC Groups, this is always `"rbac_group_deleted"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_telemetry_destination.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_telemetry_destination.py new file mode 100644 index 0000000000000000000000000000000000000000..e358002c29331a52fe18859552c407db5666d511 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_deleted_telemetry_destination.py @@ -0,0 +1,14 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaDeletedTelemetryDestination"] + + +class BetaDeletedTelemetryDestination(BaseModel): + """Confirmation that a destination was deleted.""" + + id: str + """ID of the deleted destination (`tdst_...`).""" + + type: Literal["telemetry_destination_deleted"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key.py new file mode 100644 index 0000000000000000000000000000000000000000..258d3f9c2a45f053f1dc6f011b76b0e6d50f4566 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key.py @@ -0,0 +1,66 @@ +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._models import BaseModel, UnionDiscriminator +from .beta_aws_external_key_config import BetaAWSExternalKeyConfig +from .beta_gcp_external_key_config import BetaGCPExternalKeyConfig +from .beta_azure_external_key_config import BetaAzureExternalKeyConfig +from .beta_external_key_attached_attachment import BetaExternalKeyAttachedAttachment +from .beta_external_key_unattached_attachment import BetaExternalKeyUnattachedAttachment + +__all__ = ["BetaExternalKey", "Attachment", "ProviderConfig"] + +Attachment: TypeAlias = Annotated[ + Union[BetaExternalKeyAttachedAttachment, BetaExternalKeyUnattachedAttachment], UnionDiscriminator("type") +] + +ProviderConfig: TypeAlias = Annotated[ + Union[BetaAWSExternalKeyConfig, BetaGCPExternalKeyConfig, BetaAzureExternalKeyConfig], UnionDiscriminator("type") +] + + +class BetaExternalKey(BaseModel): + """CMEK external key config belonging to the caller's organization. + + Configs are organization-scoped. Workspaces attach to a config; once any + workspace references it, the provider fields become effectively immutable + (existing encrypted data needs the config for decrypt). + """ + + id: str + """ + Identifier of the external key config: a tagged ID prefixed `ekey_`, or, on + Claude Platform on AWS, an AWS KMS key's ARN. + """ + + attachment: Attachment + """ + Whether any workspace uses this config to encrypt its data — counting live and + archived workspaces (an archived workspace's data remains encrypted under the + config), excluding deleted ones. Only an attached config is used by the + encryption path; an `unattached` config is inert and can be deleted. + """ + + created_at: datetime + + display_name: Optional[str] = None + """Human-friendly display name. Null if none was set.""" + + geo: str + """Data residency geo. Selects the region this key is used in.""" + + provider_config: ProviderConfig + """KMS provider identity and auth coordinates.""" + + type: Literal["external_key"] + + updated_at: datetime + + user_profile_id: Optional[str] = None + """ + ID of the user profile the key is bound to, or null if the key is not bound to + one. A key bound to a user profile can only be attached to a Workspace that has + the same user profile. A key that isn't bound can be attached to a Workspace + whatever its user profile. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_attached_attachment.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_attached_attachment.py new file mode 100644 index 0000000000000000000000000000000000000000..26a9e43a3278edf3147245668853c0ba279c0b66 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_attached_attachment.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaExternalKeyAttachedAttachment"] + + +class BetaExternalKeyAttachedAttachment(BaseModel): + type: Literal["attached"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_unattached_attachment.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_unattached_attachment.py new file mode 100644 index 0000000000000000000000000000000000000000..52be47995589f997121c0d17393e4db52170cabb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_external_key_unattached_attachment.py @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaExternalKeyUnattachedAttachment"] + + +class BetaExternalKeyUnattachedAttachment(BaseModel): + type: Literal["unattached"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config.py new file mode 100644 index 0000000000000000000000000000000000000000..ca4a6c0b8c69b08765878cd8a35aa510d49d49b3 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config.py @@ -0,0 +1,12 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaGCPExternalKeyConfig"] + + +class BetaGCPExternalKeyConfig(BaseModel): + key_name: str + """Full resource name of the Cloud KMS key.""" + + type: Literal["gcp"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config_param.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config_param.py new file mode 100644 index 0000000000000000000000000000000000000000..19593992f5da985965c22676fe83ab5698fbea2d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_gcp_external_key_config_param.py @@ -0,0 +1,12 @@ +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BetaGCPExternalKeyConfigParam"] + + +class BetaGCPExternalKeyConfigParam(TypedDict, total=False): + key_name: Required[str] + """Full resource name of the Cloud KMS key.""" + + type: Required[Literal["gcp"]] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_new_organization_webhook_endpoint.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_new_organization_webhook_endpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..780ec0b2d4f771737dafce78571c7438506327b8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_new_organization_webhook_endpoint.py @@ -0,0 +1,49 @@ +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_organization_webhook_endpoint_state import BetaOrganizationWebhookEndpointState + +__all__ = ["BetaNewOrganizationWebhookEndpoint"] + + +class BetaNewOrganizationWebhookEndpoint(BaseModel): + """A new organization webhook endpoint, with its signing secret.""" + + id: str + """ID of the webhook endpoint.""" + + created_at: datetime + """When the endpoint was created, in RFC 3339 format.""" + + description: str + """Notes about the endpoint. An empty string when none were given.""" + + disabled_reason: str + """Why Anthropic disabled the endpoint automatically. + + An empty string when the endpoint is enabled, or when you disabled it. + """ + + enabled_events: List[Literal["user_profile.enforcement_action_opened", "user_profile.enforcement_action_resolved"]] + """The event types delivered to the endpoint.""" + + name: str + """A short label for the endpoint. An empty string when none was given.""" + + signing_secret: str + """The secret Anthropic signs deliveries to the endpoint with (prefix `whsec_`). + + No other response returns it, so store it now. To replace it, regenerate the + signing secret. + """ + + state: BetaOrganizationWebhookEndpointState + """Whether deliveries are sent to the endpoint.""" + + updated_at: datetime + """When the endpoint was last changed, in RFC 3339 format.""" + + url: str + """The HTTPS URL that deliveries are sent to.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_no_billing_workspace_role.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_no_billing_workspace_role.py new file mode 100644 index 0000000000000000000000000000000000000000..102b35137db87e21f452df7027d69ce67e6ff313 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_no_billing_workspace_role.py @@ -0,0 +1,7 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaNoBillingWorkspaceRole"] + +BetaNoBillingWorkspaceRole: TypeAlias = Literal[ + "workspace_admin", "workspace_developer", "workspace_restricted_developer", "workspace_user" +] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_invite.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_invite.py new file mode 100644 index 0000000000000000000000000000000000000000..0ff2878798fe235e772d3d193fa8021d8898e7ee --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_invite.py @@ -0,0 +1,43 @@ +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from ..beta_organization_role import BetaOrganizationRole + +__all__ = ["BetaOrganizationInvite"] + + +class BetaOrganizationInvite(BaseModel): + id: str + """ID of the Invite.""" + + accepted_at: Optional[datetime] = None + """RFC 3339 datetime string indicating when the Invite was accepted, or null.""" + + email: str + """Email of the User being invited.""" + + expires_at: datetime + """RFC 3339 datetime string indicating when the Invite expires.""" + + invited_at: datetime + """RFC 3339 datetime string indicating when the Invite was created.""" + + rbac_group_ids: List[str] + """ + RBAC group IDs recorded on the Invite (Claude Enterprise organizations), to be + assigned to the User when the Invite is accepted. `[]` when none. + """ + + role: BetaOrganizationRole + """Organization role of the User.""" + + status: Literal["accepted", "deleted", "expired", "pending"] + """Status of the Invite.""" + + type: Literal["invite"] + """Object type. + + For Invites, this is always `"invite"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error.py new file mode 100644 index 0000000000000000000000000000000000000000..e38e1501b1fb5c222191ebdbd6ce65e77aa611b2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._exceptions import PermissionDeniedError +from .beta_organization_level_scoped_api_key_required_error_details import ( + BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails, +) + +__all__ = ["BetaOrganizationLevelScopedAPIKeyRequiredError"] + + +class BetaOrganizationLevelScopedAPIKeyRequiredError(PermissionDeniedError): + """The credential is not a scoped API key that is bound at the organization level.""" + + error_code: Literal["organization_level_scoped_api_key_required"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..9f0975771f04c973e2a66b46d6626589ce0d4a7b --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_level_scoped_api_key_required_error_details.py @@ -0,0 +1,11 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails"] + + +class BetaOrganizationLevelScopedAPIKeyRequiredErrorDetails(BaseModel): + """The credential is not a scoped API key that is bound at the organization level.""" + + error_code: Literal["organization_level_scoped_api_key_required"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit.py new file mode 100644 index 0000000000000000000000000000000000000000..8549a59415dbb41bf78b8e4c83d776bb28a46306 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit.py @@ -0,0 +1,51 @@ +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._models import BaseModel, UnionDiscriminator +from .beta_organization_rate_limit_value import BetaOrganizationRateLimitValue +from .beta_organization_rate_limit_batch_group import BetaOrganizationRateLimitBatchGroup +from .beta_organization_rate_limit_files_group import BetaOrganizationRateLimitFilesGroup +from .beta_organization_rate_limit_model_group import BetaOrganizationRateLimitModelGroup +from .beta_organization_rate_limit_skills_group import BetaOrganizationRateLimitSkillsGroup +from .beta_organization_rate_limit_web_search_group import BetaOrganizationRateLimitWebSearchGroup +from .beta_organization_rate_limit_token_count_group import BetaOrganizationRateLimitTokenCountGroup + +__all__ = ["BetaOrganizationRateLimit", "Group"] + +Group: TypeAlias = Annotated[ + Union[ + BetaOrganizationRateLimitModelGroup, + BetaOrganizationRateLimitBatchGroup, + BetaOrganizationRateLimitTokenCountGroup, + BetaOrganizationRateLimitFilesGroup, + BetaOrganizationRateLimitSkillsGroup, + BetaOrganizationRateLimitWebSearchGroup, + ], + UnionDiscriminator("type"), +] + + +class BetaOrganizationRateLimit(BaseModel): + id: str + """Identifier of this rate-limit entry. + + It is stable within the organization and differs between organizations; the + group's own identifier is `group.id`. Pass it as `rate_limit_id` to set a + workspace's overrides for this group. + """ + + group: Group + """The rate-limit group this entry's limits apply to.""" + + limits: List[BetaOrganizationRateLimitValue] + """The limiter values that apply to this group.""" + + models: Optional[List[str]] = None + """Model names this entry's limits apply to, including aliases. + + `null` when `group.type` is not `"model_group"`. The list covers the models your + organization has access to, so it can differ between organizations. + """ + + type: Literal["rate_limit"] + """Object type. Always `rate_limit` for organization rate-limit entries.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_batch_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_batch_group.py new file mode 100644 index 0000000000000000000000000000000000000000..9058a474db589e8a1179415ec108dea753a05fc0 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_batch_group.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitBatchGroup"] + + +class BetaOrganizationRateLimitBatchGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + type: Literal["batch"] + """Always `batch`: the Message Batches API.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_files_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_files_group.py new file mode 100644 index 0000000000000000000000000000000000000000..6194bd486107af57166636272e249db6e7ff9cb2 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_files_group.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitFilesGroup"] + + +class BetaOrganizationRateLimitFilesGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + type: Literal["files"] + """Always `files`: the Files API.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_model_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_model_group.py new file mode 100644 index 0000000000000000000000000000000000000000..1edc1fb3fc731f7c58ca8a7908dac65354f228c6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_model_group.py @@ -0,0 +1,23 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitModelGroup"] + + +class BetaOrganizationRateLimitModelGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + display_name: str + """Human-readable name of the model group (for example, `Claude Sonnet 4.x`). + + For display only; it may change. + """ + + type: Literal["model_group"] + """Always `model_group`: a family of models.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_skills_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_skills_group.py new file mode 100644 index 0000000000000000000000000000000000000000..641d36bdfb9d37180ab57f681161955976696c7d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_skills_group.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitSkillsGroup"] + + +class BetaOrganizationRateLimitSkillsGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + type: Literal["skills"] + """Always `skills`: the Skills API.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_token_count_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_token_count_group.py new file mode 100644 index 0000000000000000000000000000000000000000..15666d0d70c684896fefbd6fd6677e6541814470 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_token_count_group.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitTokenCountGroup"] + + +class BetaOrganizationRateLimitTokenCountGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + type: Literal["token_count"] + """Always `token_count`: the Token Count API.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_value.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_value.py new file mode 100644 index 0000000000000000000000000000000000000000..76c426be56d0406f54d0dbd3c50f4835d43c656a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_value.py @@ -0,0 +1,14 @@ +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitValue"] + + +class BetaOrganizationRateLimitValue(BaseModel): + type: str + """ + The limiter type (for example, `requests_per_minute` or + `input_tokens_per_minute`). + """ + + value: int + """The configured limit value for this limiter type.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_web_search_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_web_search_group.py new file mode 100644 index 0000000000000000000000000000000000000000..63e35fdaa28ce611bcc576f2b37d2bf10c8dc70a --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_rate_limit_web_search_group.py @@ -0,0 +1,17 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaOrganizationRateLimitWebSearchGroup"] + + +class BetaOrganizationRateLimitWebSearchGroup(BaseModel): + id: str + """ + Opaque identifier of the rate-limit group (for example, + `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never + changes, unlike the entry's own identifier, which differs per organization. + """ + + type: Literal["web_search"] + """Always `web_search`: the Messages API web search tool.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_user.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_user.py new file mode 100644 index 0000000000000000000000000000000000000000..aa98b250dd95307a30813a253d0672e4bac8bf27 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_user.py @@ -0,0 +1,30 @@ +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from ..beta_organization_role import BetaOrganizationRole + +__all__ = ["BetaOrganizationUser"] + + +class BetaOrganizationUser(BaseModel): + id: str + """ID of the User.""" + + added_at: datetime + """RFC 3339 datetime string indicating when the User joined the Organization.""" + + email: str + """Email of the User.""" + + name: str + """Name of the User.""" + + role: BetaOrganizationRole + """Organization role of the User.""" + + type: Literal["user"] + """Object type. + + For Users, this is always `"user"`. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..7d5eadc231c1a2dd11ee4c20a08cfe8fa350cdb8 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint.py @@ -0,0 +1,45 @@ +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_organization_webhook_endpoint_state import BetaOrganizationWebhookEndpointState + +__all__ = ["BetaOrganizationWebhookEndpoint"] + + +class BetaOrganizationWebhookEndpoint(BaseModel): + """ + A webhook endpoint that belongs to the organization rather than to one of + its workspaces. + """ + + id: str + """ID of the webhook endpoint.""" + + created_at: datetime + """When the endpoint was created, in RFC 3339 format.""" + + description: str + """Notes about the endpoint. An empty string when none were given.""" + + disabled_reason: str + """Why Anthropic disabled the endpoint automatically. + + An empty string when the endpoint is enabled, or when you disabled it. + """ + + enabled_events: List[Literal["user_profile.enforcement_action_opened", "user_profile.enforcement_action_resolved"]] + """The event types delivered to the endpoint.""" + + name: str + """A short label for the endpoint. An empty string when none was given.""" + + state: BetaOrganizationWebhookEndpointState + """Whether deliveries are sent to the endpoint.""" + + updated_at: datetime + """When the endpoint was last changed, in RFC 3339 format.""" + + url: str + """The HTTPS URL that deliveries are sent to.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_signing_secret.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_signing_secret.py new file mode 100644 index 0000000000000000000000000000000000000000..fd2e3983681012dfe3f5b615bb2808821d6befdf --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_signing_secret.py @@ -0,0 +1,13 @@ +from ...._models import BaseModel + +__all__ = ["BetaOrganizationWebhookEndpointSigningSecret"] + + +class BetaOrganizationWebhookEndpointSigningSecret(BaseModel): + """An organization webhook endpoint's new signing secret.""" + + signing_secret: str + """The new signing secret. + + Deliveries are signed with it from now on, and no other response returns it. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_state.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_state.py new file mode 100644 index 0000000000000000000000000000000000000000..46737ad12fa24f4ff288dec22fb6e0038519740e --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_organization_webhook_endpoint_state.py @@ -0,0 +1,5 @@ +from typing_extensions import Literal, TypeAlias + +__all__ = ["BetaOrganizationWebhookEndpointState"] + +BetaOrganizationWebhookEndpointState: TypeAlias = Literal["disabled", "enabled"] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..a4cc137f9b666ddd67b653bf476efff7b4f4df7d --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin.py @@ -0,0 +1,129 @@ +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._models import BaseModel, UnionDiscriminator +from .beta_plugin_api_actor import BetaPluginAPIActor +from .beta_plugin_component import BetaPluginComponent +from .beta_plugin_owner_user import BetaPluginOwnerUser +from .beta_plugin_user_actor import BetaPluginUserActor +from .beta_plugin_content_scan import BetaPluginContentScan +from .beta_plugin_owner_organization import BetaPluginOwnerOrganization + +__all__ = ["BetaPlugin", "CreatedBy", "Owner"] + +CreatedBy: TypeAlias = Annotated[Union[BetaPluginUserActor, BetaPluginAPIActor, None], UnionDiscriminator("type")] + +Owner: TypeAlias = Annotated[Union[BetaPluginOwnerOrganization, BetaPluginOwnerUser], UnionDiscriminator("type")] + + +class BetaPlugin(BaseModel): + id: str + """The Plugin's ID.""" + + components: Optional[List[BetaPluginComponent]] = None + """What the served version contains; null when not enumerated.""" + + content_scan: Optional[BetaPluginContentScan] = None + """The served version's content scan; null when it has not been scanned.""" + + created_at: datetime + """RFC 3339.""" + + created_by: Optional[CreatedBy] = None + """Who created the Plugin; null when no creator is recorded.""" + + description: Optional[str] = None + """The served version's description.""" + + display_name: Optional[str] = None + """The served version's display name.""" + + latest_version_id: str + """The newest version.""" + + manifest_version: Optional[str] = None + """ + The served version's manifest `version`, normalized for display, or `null` (the + Plugin Version's `manifest_version` says how and when). + """ + + marketplace_id: str + """The ID of the plugin marketplace the Plugin lives in.""" + + name: str + """Lowercase identifier, unique within its plugin marketplace. + + Fixed for an organization-owned Plugin's lifetime; a member-owned Plugin's + changes when its owner renames it in claude.ai, while its `id` stays the same. + """ + + organization_installation_preference: Optional[ + Literal["auto_install", "available", "not_available", "required"] + ] = None + """ + Organization-owned Plugin: the organization-wide installation setting every + member gets unless an RBAC Group they belong to holds its own — the Plugin's own + setting, or its plugin marketplace's default. Null for a member-owned Plugin, + which has shares instead. One of `required`, `auto_install`, `available`, + `not_available`; a value this API does not yet name is returned as stored. + """ + + organization_installation_preference_inherited: Optional[bool] = None + """ + Organization-owned Plugin: true while it has no organization-wide setting of its + own and `organization_installation_preference` is its plugin marketplace's + default. Null for a member-owned Plugin. + """ + + owner: Owner + """ + Who owns the Plugin: the organization, or the member whose personal plugin + marketplace it lives in. + """ + + reach: Optional[Literal["contained", "privileged", "remote"]] = None + """How far the served version reaches, or `null` if it is not classified. + + `remote` means it declares an MCP server or a CLI, or something that counts as + one. `privileged` means it is not `remote`, but declares a hook (of any type, + even one that posts to a URL), monitor, language server, Claude Code workflow + (any file in a `workflows/` folder at its root counts as one), or settings, or + has a skill, command, or other Markdown file whose frontmatter pre-approves + tools (`allowed-tools` with any value other than an empty one or one that names + only `AskUserQuestion`, `TodoWrite`, and `ToolSearch`). Otherwise it is + `contained`. + + If the frontmatter of a skill, command, or other Markdown file that could change + the value could not be read, or was past a size limit, the version is `null` or + `privileged` (or `remote`, if something else it declares makes it `remote`), not + `contained`. The value is normally worked out when a version is stored, under + the rules of that time, so an older version can be `null`, `contained` where the + same files stored today would be `privileged`, `remote`, or `null`, or + `privileged` where they would be `remote`. + """ + + served_version_id: str + """The version claude.ai serves to members.""" + + served_version_pinned: bool + """ + True once the served version has been pinned, through Update Plugin or in + claude.ai. While false, a new version normally becomes the served version when + it is stored. While the newest version is not the served version, as when a + version saved in claude.ai is waiting for its content scan, `served_version_id` + differs from `latest_version_id`. + """ + + type: Literal["plugin"] + """Always `plugin`.""" + + updated_at: datetime + """RFC 3339. + + Moves on a served-version change (including pinning an unpinned Plugin to the + version it already serves) and, normally, on a new version. A version saved in + claude.ai that waits for its content scan moves it when it becomes the served + version, and not necessarily when it is stored. A change to the Plugin's + installation settings or shares does not move it. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_api_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_api_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..b9ece547c5aeeac5e261de46dbbababb6f9a9fb6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_api_actor.py @@ -0,0 +1,15 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginAPIActor"] + + +class BetaPluginAPIActor(BaseModel): + api_key_id: str + """The key's ID.""" + + type: Literal["api_actor"] + """ + An Admin API key, in the same form the Compliance API activity feed uses for it. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_component.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_component.py new file mode 100644 index 0000000000000000000000000000000000000000..52dfa8038559cc48ff192e7b0a40fa1e3045d7fe --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_component.py @@ -0,0 +1,23 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginComponent"] + + +class BetaPluginComponent(BaseModel): + description: Optional[str] = None + """ + What the component declares about itself; always null for MCP servers, hooks, + and CLIs. + """ + + name: str + """ + The component's name: a skill's, command's or agent's name, an MCP server's key + in the manifest, the event a hook runs on, or a CLI's executable. + """ + + type: Literal["agent", "cli", "command", "hook", "mcp_server", "skill"] + """The kind of component.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_content_scan.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_content_scan.py new file mode 100644 index 0000000000000000000000000000000000000000..d2173d3f32ff0b9ebbca8bf63d42ed67cdf0d9fc --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_content_scan.py @@ -0,0 +1,30 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginContentScan"] + + +class BetaPluginContentScan(BaseModel): + assessment: Optional[Literal["fail", "pass", "unknown", "warn"]] = None + """The scan's verdict; set only when `status` is `completed`. + + A `warn` can mean a `fail` that was allowed in claude.ai. + """ + + reason: Optional[str] = None + """ + The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` + or `guardrail-tampering`; a mechanism this API does not yet name reads as + `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism + is reported for the verdict. + """ + + status: Literal["completed", "errored", "processing"] + """ + `processing` while a scan runs, `completed` when it ran to completion, `errored` + when it could not run. Once a scan of the version has completed, `content_scan` + describes the newest completed scan, even while a later scan runs. While the + scan outcome cannot be read, `status` is `errored` instead. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace.py new file mode 100644 index 0000000000000000000000000000000000000000..51614b5f881e14e455d98c107582d3e514b9b203 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace.py @@ -0,0 +1,74 @@ +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._models import BaseModel, UnionDiscriminator +from .beta_plugin_owner_user import BetaPluginOwnerUser +from .beta_plugin_owner_organization import BetaPluginOwnerOrganization + +__all__ = ["BetaPluginMarketplace", "Owner"] + +Owner: TypeAlias = Annotated[Union[BetaPluginOwnerOrganization, BetaPluginOwnerUser], UnionDiscriminator("type")] + + +class BetaPluginMarketplace(BaseModel): + id: str + """The plugin marketplace's ID, prefixed `marketplace_`.""" + + created_at: datetime + """RFC 3339.""" + + default_installation_preference: Optional[Literal["auto_install", "available", "not_available", "required"]] = None + """ + Organization plugin marketplace: the organization-wide setting every Plugin in + it with no setting of its own gets. Null for a member's personal plugin + marketplace. One of `required`, `auto_install`, `available`, `not_available`; a + value this API does not yet name is returned as stored. + """ + + last_sync_ended_at: Optional[datetime] = None + """RFC 3339. + + When the most recent synchronization attempt to finish did so, whatever its + outcome; for a repository plugin marketplace no synchronization has run on yet, + when it was created. Null for a plugin marketplace that is not synchronized from + a repository. + """ + + last_sync_read_sha: Optional[str] = None + """ + The commit the last synchronization attempt that reached the repository read, + whether or not its content was then accepted (see `sync_status`); an attempt + that ends `failed_auth` or `failed_transient` leaves it unchanged. Null until an + attempt has first read the repository, and for a plugin marketplace that is not + synchronized from a repository. + """ + + name: str + """Fixed for the plugin marketplace's lifetime.""" + + owner: Owner + """The organization, or the member whose personal plugin marketplace it is.""" + + source: Literal["directory", "github", "gitlab", "manual", "public_git"] + """ + Where the plugin marketplace's Plugins come from: `manual` when they are + uploaded; `github`, `gitlab` or `public_git` when they are synchronized from the + Git repository the owner connected, into which nothing can be uploaded; + `directory` is Anthropic's own catalog, which this API does not list. A value + this API does not yet name is returned as stored. + """ + + sync_status: Optional[ + Literal["failed_auth", "failed_content", "failed_limits", "failed_transient", "in_progress", "success"] + ] = None + """ + Outcome of the plugin marketplace's most recent synchronization: one of + `success`, `in_progress`, `failed_content`, `failed_transient`, `failed_auth`, + `failed_limits`; a value this API does not yet name is returned as stored. Null + until a synchronization is first attempted — so always for a `manual` plugin + marketplace. + """ + + type: Literal["plugin_marketplace"] + """Always `plugin_marketplace`.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_error.py new file mode 100644 index 0000000000000000000000000000000000000000..675a3067be50325e2c2d30ac20f7481475c000bd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_error.py @@ -0,0 +1,14 @@ +from ...._models import BaseModel + +__all__ = ["BetaPluginMarketplaceValidationPluginError"] + + +class BetaPluginMarketplaceValidationPluginError(BaseModel): + error: str + """Why the plugin would be skipped by a synchronization.""" + + error_code: str + """A stable identifier for the reason — the value to branch on.""" + + name: str + """The plugin's name, as its entry in marketplace.json declares it.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warning.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warning.py new file mode 100644 index 0000000000000000000000000000000000000000..982c1ce380fdb4722afed726d449fef892af12f1 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warning.py @@ -0,0 +1,11 @@ +from ...._models import BaseModel + +__all__ = ["BetaPluginMarketplaceValidationPluginWarning"] + + +class BetaPluginMarketplaceValidationPluginWarning(BaseModel): + error_code: str + """A stable identifier for the kind of warning.""" + + message: str + """What would be left out, and why.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warnings.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warnings.py new file mode 100644 index 0000000000000000000000000000000000000000..01c0fa144b62cb5d82d9b987fa947d1a90285ceb --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_plugin_warnings.py @@ -0,0 +1,14 @@ +from typing import List + +from ...._models import BaseModel +from .beta_plugin_marketplace_validation_plugin_warning import BetaPluginMarketplaceValidationPluginWarning + +__all__ = ["BetaPluginMarketplaceValidationPluginWarnings"] + + +class BetaPluginMarketplaceValidationPluginWarnings(BaseModel): + name: str + """The plugin's name, as its entry in marketplace.json declares it.""" + + warnings: List[BetaPluginMarketplaceValidationPluginWarning] + """The parts of the plugin a synchronization would leave out.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_report.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_report.py new file mode 100644 index 0000000000000000000000000000000000000000..b7407e0249951728f7c489a064279efa07c462c6 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_marketplace_validation_report.py @@ -0,0 +1,63 @@ +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .beta_plugin_marketplace_validation_plugin_error import BetaPluginMarketplaceValidationPluginError +from .beta_plugin_marketplace_validation_plugin_warnings import BetaPluginMarketplaceValidationPluginWarnings + +__all__ = ["BetaPluginMarketplaceValidationReport"] + + +class BetaPluginMarketplaceValidationReport(BaseModel): + """ + The outcome of validating plugin marketplace content: a report, not a + stored object, so nothing in it can be retrieved afterwards. + """ + + commit_sha: Optional[str] = None + """ + The full SHA of the commit that was validated: for a repository, the commit that + was read; for an uploaded archive, the commit recorded in the archive's comment + (as a Git host's download writes it; not verified), else null. + """ + + manifest_error: Optional[str] = None + """ + Set when nothing could be validated: the repository or archive could not be + read, or marketplace.json is missing, malformed or over a limit. Null otherwise. + """ + + manifest_error_code: Optional[str] = None + """A stable identifier for `manifest_error`; null when that is.""" + + plugin_errors: List[BetaPluginMarketplaceValidationPluginError] + """ + One entry per plugin a synchronization would skip entirely, keyed by the + plugin's name in marketplace.json. + """ + + plugin_warnings: List[BetaPluginMarketplaceValidationPluginWarnings] + """ + One entry per plugin that would synchronize with some of its contents left out, + keyed by the plugin's name in marketplace.json. + """ + + ref: Optional[str] = None + """ + For a repository, the branch that was read by name: the one requested, or else + the branch a synchronization of this repository is set to read. Null when no + branch is named or set and the repository's default branch was read, for a + request by commit SHA, and for an uploaded archive. + """ + + total_plugin_count: int + """How many plugins marketplace.json declares; 0 when it could not be read.""" + + type: Literal["plugin_marketplace_validation_report"] + """Always `plugin_marketplace_validation_report`.""" + + valid: bool + """ + True when marketplace.json is well-formed and no plugin would be skipped; + warnings never make it false. + """ diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error.py new file mode 100644 index 0000000000000000000000000000000000000000..973ccd5669ff7eff0f5f3fd3bed9602b5c384093 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error.py @@ -0,0 +1,16 @@ +from typing_extensions import Literal + +from ...._exceptions import ConflictError +from .beta_plugin_name_taken_error_details import BetaPluginNameTakenErrorDetails + +__all__ = ["BetaPluginNameTakenError"] + + +class BetaPluginNameTakenError(ConflictError): + """The marketplace already holds this name. + + `plugin_id` is the Plugin that holds it, and can be absent. + """ + + error_code: Literal["plugin_name_taken"] # pyright: ignore[reportIncompatibleVariableOverride] + details: BetaPluginNameTakenErrorDetails # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error_details.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error_details.py new file mode 100644 index 0000000000000000000000000000000000000000..0c6cf2bda63215ce5e61381d8ba393821f48d60c --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_name_taken_error_details.py @@ -0,0 +1,17 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginNameTakenErrorDetails"] + + +class BetaPluginNameTakenErrorDetails(BaseModel): + """The marketplace already holds this name. + + `plugin_id` is the Plugin that holds it, and can be absent. + """ + + error_code: Literal["plugin_name_taken"] + + plugin_id: Optional[str] = None diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_organization.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_organization.py new file mode 100644 index 0000000000000000000000000000000000000000..255fdc2e82b55799c8e202001460bddb99869860 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_organization.py @@ -0,0 +1,10 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginOwnerOrganization"] + + +class BetaPluginOwnerOrganization(BaseModel): + type: Literal["organization"] + """The Plugin lives in a plugin marketplace the organization owns.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_user.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_user.py new file mode 100644 index 0000000000000000000000000000000000000000..9194bb22c6ededbbefb15a587cdd8cc03d053800 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_owner_user.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginOwnerUser"] + + +class BetaPluginOwnerUser(BaseModel): + type: Literal["user"] + """The Plugin lives in one member's personal plugin marketplace.""" + + user_id: str + """The member's User ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization.py new file mode 100644 index 0000000000000000000000000000000000000000..b9c36c8a764349bdd903d5d4aa4bc40d9ac05038 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization.py @@ -0,0 +1,10 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginTargetOrganization"] + + +class BetaPluginTargetOrganization(BaseModel): + type: Literal["organization"] + """Every member of the organization.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization_member.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization_member.py new file mode 100644 index 0000000000000000000000000000000000000000..0dfd7f9e8103620ca5b68ed0df5a7350b8e516d9 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_organization_member.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginTargetOrganizationMember"] + + +class BetaPluginTargetOrganizationMember(BaseModel): + type: Literal["organization_member"] + """One member of the organization.""" + + user_id: str + """The member's User ID.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_rbac_group.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_rbac_group.py new file mode 100644 index 0000000000000000000000000000000000000000..7cb602f1b8854bafa3e79e3faab0a881eddd1a94 --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_target_rbac_group.py @@ -0,0 +1,13 @@ +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginTargetRBACGroup"] + + +class BetaPluginTargetRBACGroup(BaseModel): + rbac_group_id: str + """The RBAC Group's ID.""" + + type: Literal["rbac_group"] + """An RBAC Group.""" diff --git a/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_user_actor.py b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_user_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..e169bac7b0f8b720a50d457344bbaf94fd01dedd --- /dev/null +++ b/.venv/lib/python3.13/site-packages/anthropic/types/beta/organization/beta_plugin_user_actor.py @@ -0,0 +1,20 @@ +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["BetaPluginUserActor"] + + +class BetaPluginUserActor(BaseModel): + email_address: Optional[str] = None + """ + The member's email address; may be null, for example when they are no longer a + member of the organization. + """ + + type: Literal["user_actor"] + """A member of the organization.""" + + user_id: str + """The member's User ID."""