Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
13,873 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
13,873
◇
Types & classes
4,472
↳
Endpoints
93
↓ 8 callers
Method
validate_archive
Check whether a plugin marketplace, uploaded as a `.zip` of the marketplace directory, would synchronize into claude.ai, without conn
src/anthropic/resources/beta/organization/plugin_marketplaces.py:312
↓ 8 callers
Method
validate_repository
Check whether a plugin marketplace held in a public GitHub repository would synchronize into claude.ai, without connecting or storing
src/anthropic/resources/beta/organization/plugin_marketplaces.py:413
↓ 8 callers
Method
wait
(self, context: BetaToolsetCallContext, input: BetaBrowserWaitInput)
src/anthropic/lib/tools/_toolsets/_browser.py:402
↓ 7 callers
Function
_async_compact_runner
( client: AsyncAnthropic, *, context_management: Union[BetaContextManagementConfigParam, Omit] = o
tests/lib/tools/test_runners.py:2552
↓ 7 callers
Function
_async_weather_tool
()
tests/lib/tools/test_runners.py:2521
↓ 7 callers
Function
_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_keep_only_copy.py:21
↓ 7 callers
Method
_ensure_memory_root
Ensure the memory root directory exists
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:682
↓ 7 callers
Function
_error_text
(desktop: FakeDesktop, name: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_computer_pipeline.py:53
↓ 7 callers
Function
_get_weather
(location: str, units: Literal["c", "f"])
tests/lib/tools/test_runners.py:2429
↓ 7 callers
Function
_mcp_field_v1_or_v2
(obj: Any, name: str)
src/anthropic/lib/tools/mcp.py:80
↓ 7 callers
Function
_message
(*blocks: dict[str, Any], stop: str = "tool_use")
tests/lib/tools/toolsets/test_computer_runner.py:40
↓ 7 callers
Function
_mock_client
(result: CallToolResult | None = None)
tests/lib/tools/test_mcp_tool.py:67
↓ 7 callers
Function
_mock_token_endpoint
(respx_mock: MockRouter)
tests/lib/test_credentials.py:2391
↓ 7 callers
Function
_read_result
(contents: list[Any])
tests/lib/tools/test_mcp_tool.py:51
↓ 7 callers
Function
_requests
(respx_mock: MockRouter)
tests/lib/tools/toolsets/test_computer_runner.py:63
↓ 7 callers
Function
_set_ambient_first_party_credentials
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:138
↓ 7 callers
Function
_text_resource
(uri: str = "file:///x.txt", text: str = "hello", mime: str | None = None)
tests/lib/tools/test_mcp_tool.py:43
↓ 7 callers
Function
_use
(name: str, input: dict[str, Any], id: str = "toolu_1")
tests/lib/tools/toolsets/test_computer_pipeline.py:49
↓ 7 callers
Method
_validate_path
Validate and resolve memory paths
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:400
↓ 7 callers
Function
_within
True if `child` is `root` or a path inside it (both already resolved). Names compare exactly: on Windows `relative_to` lowercases them first,
src/anthropic/lib/tools/_skills.py:41
↓ 7 callers
Method
aclose
(self)
src/anthropic/_tracing.py:606
↓ 7 callers
Function
application_trace_context
Runs with a sampled span and a baggage entry current, as an instrumented application calls the SDK.
tests/test_open_telemetry.py:4122
↓ 7 callers
Function
b64_obj
(data: object)
tests/test_prepare.py:121
↓ 7 callers
Function
beta_agent_toolset_20260401
Return the `agent_toolset_20260401` implementations bound to `ctx`. The result is a plain list of `anthropic.lib.tools.BetaAsyncFunctionTool`
src/anthropic/lib/tools/agent_toolset.py:1252
↓ 7 callers
Function
beta_glob_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:1090
↓ 7 callers
Function
beta_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:117
↓ 7 callers
Function
cached_json_schema
`adapter.json_schema()`, cached. Callers share the dict, so `transform_schema()` copies from it.
src/anthropic/lib/_parse/_transform.py:99
↓ 7 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding. A credential passed her
src/anthropic/_client.py:855
↓ 7 callers
Method
end
Ends the span, unless it has ended. The status stays unset when `error` is a cancellation, and when the consumer stopped before it `f
src/anthropic/lib/_tracing/_work.py:54
↓ 7 callers
Method
execute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_interface.py:139
↓ 7 callers
Method
extra_headers
Return headers derived from the config file (e.g. `workspace_id`). Eagerly reads the config if not yet loaded. The returned dict is s
src/anthropic/lib/credentials/_providers.py:289
↓ 7 callers
Function
extract_type_var_from_base
Given a type like `Foo[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g. ```py
src/anthropic/_utils/_typing.py:91
↓ 7 callers
Function
field_types
(cls: Any)
tests/test_open_telemetry.py:8245
↓ 7 callers
Function
http_client
( client_class: ClientClass, transport: httpx2.MockTransport | None = None )
tests/lib/test_client_copy.py:186
↓ 7 callers
Function
marker_stamp
(local: Path)
tests/lib/tools/memory_sync/test_folder_trust.py:28
↓ 7 callers
Function
quoted_name
A model-chosen name as it is echoed inside single quotes in a text the model reads: one line, cut short, and without the quotes and runs of spaces
src/anthropic/lib/tools/_toolsets/_sanitize.py:69
↓ 7 callers
Method
read
Read and return the binary response content.
src/anthropic/_response.py:361
↓ 7 callers
Function
result_of
(tool: Any, **input: object)
tests/lib/tools/test_agent_toolset.py:972
↓ 7 callers
Function
saved_path
(output: str)
tests/lib/tools/test_agent_toolset.py:1511
↓ 7 callers
Function
session_after
(steps: list[Step], *, custom_permissions: bool = False, self_hosted: bool = False)
tests/lib/tools/test_fake_sessions_api.py:36
↓ 7 callers
Function
span_id
(span: ReadableSpan | trace.Span)
tests/test_open_telemetry.py:214
↓ 7 callers
Method
status
(self)
tests/lib/tools/_fake_sessions_api.py:540
↓ 7 callers
Function
trace_id
(span: ReadableSpan)
tests/test_open_telemetry.py:220
↓ 7 callers
Function
unmarked
`marked(text)` without the marker.
tests/lib/threads/helpers.py:180
↓ 7 callers
Function
validate_credentials
Raise if only one of aws_access_key/aws_secret_key is provided.
src/anthropic/lib/aws/_credentials.py:7
↓ 6 callers
Method
__init__
( self, *, thread: ThreadT, options: TurnOverrides | RequestOptions, t
src/anthropic/lib/tools/_beta_runner.py:179
↓ 6 callers
Method
_build_workload_delegate
(self, auth: Dict[str, Any])
src/anthropic/lib/credentials/_providers.py:697
↓ 6 callers
Function
_disabled
(entry: Any)
tests/lib/tools/toolsets/test_interface.py:72
↓ 6 callers
Function
_keep_client_header_params
Per-request header params arrive as `Omit` when unset, which would strip a value the client itself sends (e.g. `AnthropicAWS(workspace_id=...)`, a
src/anthropic/_client.py:132
↓ 6 callers
Function
_mock_deployment
Mock one deployment: its token endpoint mints `token` and its messages endpoint accepts anything. Pair with `_requests_to` to check that a cli
tests/lib/test_credentials.py:2426
↓ 6 callers
Function
_mode
(p: Path)
tests/lib/tools/test_skills.py:205
↓ 6 callers
Function
_on
(world: World, tab_id: str, url: str, *, active: bool = False)
tests/lib/tools/toolsets/test_enforcement.py:34
↓ 6 callers
Function
_paused_server_tool_use
()
tests/lib/tools/test_runners.py:653
↓ 6 callers
Function
_reject_httpx_object
`httpx` objects don't work with `httpx2`, and would otherwise fail deep inside a request.
src/anthropic/_base_client.py:161
↓ 6 callers
Function
_requests_to
(respx_mock: MockRouter, base_url: str)
tests/lib/test_credentials.py:2435
↓ 6 callers
Function
_sha
(content: str | bytes)
tests/lib/tools/test_file_store.py:27
↓ 6 callers
Function
_sha
(content: str)
tests/lib/tools/memory_sync/_fake_anthropic.py:23
↓ 6 callers
Function
_status_error
(code: int)
tests/lib/tools/memory_sync/_fake_anthropic.py:27
↓ 6 callers
Function
_symlink_fixture
Workdir with two symlink cycles, a link that escapes, and a link whose target spells its way through a cycle to the escaping link.
tests/lib/tools/test_agent_toolset.py:94
↓ 6 callers
Method
_tool_use_span
The span of one run of `tool` for the call `tool_use`. The result the runner sends back, an error result too, is made inside it.
src/anthropic/lib/tools/_beta_runner.py:264
↓ 6 callers
Method
_toolset_refuse_if_closed
(self)
src/anthropic/lib/tools/_toolsets/_runnable.py:91
↓ 6 callers
Method
_validate_path
Validate and resolve memory paths
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:686
↓ 6 callers
Method
_workload_provider
(self, handler: Callable[[httpx2.Request], httpx2.Response])
tests/lib/test_credentials.py:5204
↓ 6 callers
Function
assert_http_attributes
Checks that `span` is of a `method` request to `path`, and that its route is `path` with a placeholder for each ID.
tests/test_open_telemetry.py:6956
↓ 6 callers
Function
assert_signatures_in_sync
Ensure that the signature of the second function matches the first.
src/anthropic/_utils/_reflection.py:30
↓ 6 callers
Function
build_headers
Fold header layers into one `httpx2.Headers`, later layers taking precedence whatever a name's casing. An `Omit` value removes the header set by
src/anthropic/_base_client.py:2803
↓ 6 callers
Function
change
(runner: Any, _reply: Any, _tool_response: Any)
tests/lib/threads/helpers.py:569
↓ 6 callers
Function
classify
The rule for an exception out of a member call, at the `execute` boundary and in the runner alike: a `ToolsetUsageError` propagates, a `ToolError`
src/anthropic/lib/tools/_toolsets/_runnable.py:216
↓ 6 callers
Method
close
(self)
tests/lib/test_credentials.py:4262
↓ 6 callers
Function
defer_calls
Defers the calls with these ids, when the caller sees their blocks finish. Pass each event to what it returns.
tests/lib/tools/test_runner_eager_toolsets.py:445
↓ 6 callers
Function
download_session_skills
Download the skills of the session's agent and its subagents into `{workdir}/skills/<name>/`. Reads the resolved agent off `session`, and for eac
src/anthropic/lib/tools/_skills.py:202
↓ 6 callers
Method
ended
(self, spans: Spans, content_mode: str, *, output: bool = True)
tests/test_open_telemetry.py:7758
↓ 6 callers
Function
extract_response_type
Given a type like `APIResponse[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g.
src/anthropic/_response.py:867
↓ 6 callers
Function
failing_tracing
An `open_telemetry` option whose tracer provider fails every span at `failure`.
tests/test_open_telemetry.py:7930
↓ 6 callers
Method
find
(self, context: BetaToolsetCallContext, input: BetaBrowserFindInput)
src/anthropic/lib/tools/_toolsets/_browser.py:396
↓ 6 callers
Method
finish
()
src/anthropic/lib/tools/agent_toolset.py:635
↓ 6 callers
Function
foo
(a: str | None = None)
tests/test_required_args.py:10
↓ 6 callers
Function
get_args
(tp: type[Any])
src/anthropic/_utils/_compat.py:15
↓ 6 callers
Function
get_helper_tag
Get the helper name from an object, if any.
src/anthropic/lib/_stainless_helpers.py:96
↓ 6 callers
Function
given
`values` without the entries whose value is `omit` or `not_given`, or `None` for an `extra_*` request option (whose "not given" default is `None`)
src/anthropic/lib/threads/_params.py:132
↓ 6 callers
Function
helper_header
The `x-stainless-helper: <value>` header dict, for passing into a `merge_headers` call or as `extra_headers`/`default_headers`. Typing keeps
src/anthropic/lib/_stainless_helpers.py:76
↓ 6 callers
Function
ids
(tool_uses: list[Any])
tests/lib/tools/test_runner_eager_tools.py:864
↓ 6 callers
Function
iter_next
(iter: Iterator[_T] | AsyncIterator[_T])
tests/decoders/test_jsonl.py:127
↓ 6 callers
Function
iteration
An entry of a response's `usage.iterations`.
tests/test_open_telemetry.py:725
↓ 6 callers
Function
mcp_resource_to_content
Convert MCP resource contents to an Anthropic content block. Finds the first resource with a supported MIME type from the result's `contents`
src/anthropic/lib/tools/mcp.py:246
↓ 6 callers
Function
member_calls
A reply with one `tool_use` for each call, which is its id, its name and its `toolset_name`, if it has one.
tests/lib/tools/test_open_telemetry.py:257
↓ 6 callers
Function
one_line
A page- or model-supplied text on one line the model or an operator reads: a tab's title, a download's error, a field of a member's confirmation l
src/anthropic/lib/tools/_toolsets/_sanitize.py:58
↓ 6 callers
Method
parse
Like `send()`, and parses the reply against the thread's `output_format` into `parsed_output`.
src/anthropic/lib/threads/_beta_threads.py:205
↓ 6 callers
Function
prepare_request_data
Copy request params into plain data that can be serialized and re-sent. Drops `NotGiven` / `Omit` entries (`keep_top_level_omit` keeps `Omit` dir
src/anthropic/_utils/_prepare.py:47
↓ 6 callers
Function
redeemed_token
The request-body form of a redeemed credit token — the object shape, best-effort mode.
tests/lib/test_refusal_fallback_streaming.py:152
↓ 6 callers
Function
see
(event: Any)
tests/lib/tools/test_runner_eager_toolsets.py:448
↓ 6 callers
Method
start_span
(self, name: str, *args: Any, **kwargs: Any)
tests/test_tracing.py:58
↓ 6 callers
Method
stopping_since
(self, session: FakeSession)
tests/lib/tools/test_session_runner_properties.py:176
↓ 6 callers
Function
text_part
(content: str)
tests/test_open_telemetry.py:291
↓ 6 callers
Function
to_json_output_format
The `output_config.format` param that asks for replies matching `output_format`'s JSON schema.
src/anthropic/lib/_parse/_transform.py:29
↓ 6 callers
Method
to_param
Convert this response Message to a MessageParam so it can be passed back to the API as an input message, e.g. in the `messages` param.
src/anthropic/types/message.py:141
↓ 6 callers
Function
tool_spans
(spans: Spans)
tests/lib/tools/test_open_telemetry.py:309
↓ 6 callers
Function
well_formed
`text` with each unpaired surrogate replaced by U+FFFD, so it can be sent.
src/anthropic/lib/tools/_toolsets/_sanitize.py:41
↓ 6 callers
Method
with_middleware
A new client with the given middleware appended after this client's middleware. Convenience for applying extra middleware to a single request
src/anthropic/_client.py:554
↓ 5 callers
Method
__get_proxied__
(self)
src/anthropic/_utils/_proxy.py:57
← previous
next →
401–500 of 13,873, ranked by callers