Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
9,455 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
9,455
◇
Types & classes
3,151
↳
Endpoints
25
↓ 3 callers
Method
_get_page_items
(self)
src/anthropic/_base_client.py:229
↓ 3 callers
Function
_idle
(stop_reason: str)
tests/lib/tools/test_session_runner.py:110
↓ 3 callers
Function
_install_session_ended_by_heartbeat
A session that never completes on its own, with the fake heartbeat held back until the runner is serving it: the heartbeat's outcome — not skill
tests/lib/environments/test_worker.py:463
↓ 3 callers
Function
_is_fatal_4xx
(err: Exception)
src/anthropic/lib/environments/_poller.py:40
↓ 3 callers
Function
_is_supported_image_type
(mime_type: str)
src/anthropic/lib/tools/mcp.py:102
↓ 3 callers
Function
_iter
()
tests/lib/environments/test_worker.py:214
↓ 3 callers
Function
_jitter
(low: float, high: float)
src/anthropic/lib/environments/_poller.py:36
↓ 3 callers
Function
_json_dumps_secrets
`json.dumps` with `SecretStr` values unwrapped at dump time. Returns bytes so call sites can pass the result inline (request content, `os.wri
src/anthropic/lib/credentials/_secrets.py:95
↓ 3 callers
Method
_list_memories
The store's memories — `basic` view (shas, no content) at `_LIST_PAGE_SIZE` per page unless the caller needs `full` pages. `memory_pre
src/anthropic/lib/tools/_memories.py:779
↓ 3 callers
Method
_make_status_error
( self, err_msg: str, *, body: object, response: httpx2.Response,
src/anthropic/_client.py:551
↓ 3 callers
Function
_make_tar
(path: Path, members: list[tuple[tarfile.TarInfo, bytes]])
tests/lib/tools/test_skills.py:88
↓ 3 callers
Function
_make_zip_infos
(path: Path, entries: list[tuple[zipfile.ZipInfo, bytes]])
tests/lib/tools/test_skills.py:101
↓ 3 callers
Function
_member_use
(name: str, id: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_browser_runner.py:51
↓ 3 callers
Function
_messages
(caplog: pytest.LogCaptureFixture)
tests/lib/environments/test_worker.py:1107
↓ 3 callers
Function
_prepare_options
(input_options: FinalRequestOptions, *, project_id: str | None, region: str)
src/anthropic/lib/vertex/_client.py:420
↓ 3 callers
Function
_read_file_content
(full_path: Path, memory_path: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:355
↓ 3 callers
Function
_redact_body
Truncate a token-endpoint error body for safe inclusion in an exception.
src/anthropic/lib/credentials/_workload.py:58
↓ 3 callers
Function
_reject_read_only
Raise `ToolError` when `target` falls under a read-only root. Roots resolve at check time, exactly like `allowed_roots` in `resolve_path` — a
src/anthropic/lib/tools/agent_toolset.py:416
↓ 3 callers
Method
_request_api_list
( self, model: Type[object], page: Type[SyncPageT], options: FinalRequestOptio
src/anthropic/_base_client.py:1430
↓ 3 callers
Function
_request_id
(resp: httpx2.Response)
src/anthropic/lib/credentials/_workload.py:53
↓ 3 callers
Method
_resolve_base_url
base_url precedence: top-level config field → bound (the owning client's base_url, via `bind_base_url`) → default. Validated against t
src/anthropic/lib/credentials/_providers.py:275
↓ 3 callers
Function
_resolve_max_bytes
Resolve a configured cap to an effective size limit. `not_given` selects `default`; `None` disables the size check (uncapped); a positive int
src/anthropic/lib/tools/agent_toolset.py:131
↓ 3 callers
Function
_response_without_a_summary
(content: List[Any], stop_reason: str)
tests/lib/tools/test_runners.py:2498
↓ 3 callers
Function
_run_heartbeat_loop
( monkeypatch: pytest.MonkeyPatch, script: list[tuple[float, Any]] )
tests/lib/environments/test_worker.py:1093
↓ 3 callers
Function
_run_timed
Run the worker to completion and return the wall-clock seconds it took.
tests/lib/tools/memory_sync/test_e2e_memory.py:127
↓ 3 callers
Method
_run_tool
(self, tool: BetaRunnableTool, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:617
↓ 3 callers
Method
_run_toolset_member
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:640
↓ 3 callers
Function
_safe_json
(text: str)
src/anthropic/lib/middleware/_fallbacks.py:1535
↓ 3 callers
Method
_scan_marker
(self, store: _AttachedStore)
src/anthropic/lib/tools/_memories.py:360
↓ 3 callers
Function
_seam_block
The synthetic `fallback` content block marking one model boundary.
src/anthropic/lib/middleware/_fallbacks.py:1424
↓ 3 callers
Function
_sent_tools
The `tools` array of the first request the runner sent.
tests/lib/tools/toolsets/test_runner.py:136
↓ 3 callers
Method
_should_retry
(self, response: httpx2.Response)
src/anthropic/_base_client.py:863
↓ 3 callers
Method
_signal
(self)
src/anthropic/lib/tools/_beta_session_runner.py:172
↓ 3 callers
Function
_strip_traceback
Detach the frames chained onto `err` before raising from it. Foreign frames (json decoder, httpx transport) hold raw payloads — request bodie
src/anthropic/lib/credentials/_secrets.py:104
↓ 3 callers
Method
_sync_all
(self, *, final: bool)
src/anthropic/lib/tools/_memories.py:354
↓ 3 callers
Function
_tar_special
(name: str, type: bytes, linkname: str = "")
tests/lib/tools/test_skills.py:79
↓ 3 callers
Function
_unwrap_secret
Inverse of `_wrap_secret_fields` for a single value; pass-through for values that were never wrapped (absent or non-string fields).
src/anthropic/lib/credentials/_secrets.py:83
↓ 3 callers
Function
_validate_profile_name
Reject profile names that could escape the config directory. Profile names come from user-controlled sources (`ANTHROPIC_PROFILE`, the `activ
src/anthropic/lib/credentials/_constants.py:135
↓ 3 callers
Function
_wrap_secret_fields
Wrap the secret fields of a parsed JSON object in `SecretStr`. Called at every boundary where credential material enters SDK code. Traceback
src/anthropic/lib/credentials/_secrets.py:51
↓ 3 callers
Function
action_line
The line of text a pure action returned, as written: `render_result` folds it to one line (control, line-separator and bidi characters a space) an
src/anthropic/lib/tools/_toolsets/_render.py:101
↓ 3 callers
Method
arm
(Re)start the idle countdown from now and wake the watchdog. Deferred while any gated call is held or in flight — stopping then would
src/anthropic/lib/tools/_beta_session_runner.py:192
↓ 3 callers
Function
async_mcp_tool
Convert an MCP tool to an async runnable tool for `tool_runner()`. Example: ```py from anthropic.lib.tools.mcp import async_mcp_tool
src/anthropic/lib/tools/mcp.py:380
↓ 3 callers
Method
bind_base_url
Adopt the owning client's `base_url` as a fallback for the token exchange. Slots between the config file's own `base_url` field and th
src/anthropic/lib/credentials/_providers.py:229
↓ 3 callers
Function
body
()
tests/decoders/test_jsonl.py:17
↓ 3 callers
Method
call
(self, input: object)
src/anthropic/lib/tools/_tool_dispatch.py:132
↓ 3 callers
Method
close
Close the underlying HTTPX client. The client will *not* be usable after this.
src/anthropic/_base_client.py:1070
↓ 3 callers
Method
close
Release what the toolset holds when you are done. The tool runner never calls this, so one instance can serve several runs, and a `with` block
src/anthropic/lib/tools/_toolsets/_base.py:299
↓ 3 callers
Method
close
(self)
src/anthropic/lib/credentials/_close.py:14
↓ 3 callers
Function
consume_async_iterator
(iterator: AsyncIterator[Any])
src/anthropic/_utils/_streams.py:10
↓ 3 callers
Function
consume_sync_iterator
(iterator: Iterator[Any])
src/anthropic/_utils/_streams.py:5
↓ 3 callers
Method
copy
( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] — narrows `credentials` to No
src/anthropic/lib/aws/_client.py:386
↓ 3 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/vertex/_client.py:184
↓ 3 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/vertex/_client.py:348
↓ 3 callers
Method
disarm
Cancel the idle countdown; only signals on an actual transition.
src/anthropic/lib/tools/_beta_session_runner.py:205
↓ 3 callers
Method
do
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/test_runner_eager_tools.py:1050
↓ 3 callers
Function
error_response
(message: str, status: int)
tests/lib/test_refusal_fallback_streaming.py:101
↓ 3 callers
Function
exchange_federation_assertion
Perform a single RFC 7523 `jwt-bearer` exchange and return the resulting `AccessToken`. This is a one-shot convenience wrapper around `Worklo
src/anthropic/lib/credentials/_workload.py:367
↓ 3 callers
Method
execute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_computer_interface.py:109
↓ 3 callers
Function
family_call
A call to a tool of the `family` toolset, and the timeline line for when that tool starts.
tests/lib/tools/test_runner_eager_toolsets.py:438
↓ 3 callers
Method
find_symlinks
Every symlink under `under` — listings skip them and reads refuse them, so a caller that must know they exist asks here.
src/anthropic/lib/tools/_file_store.py:178
↓ 3 callers
Function
format_code_block
(code: str)
scripts/utils/ruffen-docs.py:110
↓ 3 callers
Method
get_max_retries
(self, max_retries: int)
src/anthropic/_models.py:1000
↓ 3 callers
Function
handler
(req: httpx2.Request)
tests/lib/test_scoped_client.py:126
↓ 3 callers
Method
has_next_page
(self)
src/anthropic/pagination.py:34
↓ 3 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:75
↓ 3 callers
Function
image_block
(data: object)
tests/test_prepare.py:125
↓ 3 callers
Function
index_runnables
Index a runner's tools by `name` and its toolsets by family (`toolset_name`). A toolset's `tools[]` entry has no `name`, so toolsets are indexed
src/anthropic/lib/tools/_tool_dispatch.py:144
↓ 3 callers
Function
is_download_change
(change: StateChange)
src/anthropic/lib/tools/_toolsets/_render.py:203
↓ 3 callers
Method
is_enabled
Whether the member is offered to the model and may be dispatched.
src/anthropic/lib/tools/_toolsets/_base.py:209
↓ 3 callers
Function
is_file_content
(obj: object)
src/anthropic/_files.py:29
↓ 3 callers
Function
is_tuple_t
(obj: _TupleT | object)
src/anthropic/_utils/_utils.py:174
↓ 3 callers
Function
is_type_alias_type
Return whether the provided argument is an instance of `TypeAliasType`. ```python type Int = int is_type_alias_type(Int) # > True
src/anthropic/_utils/_typing.py:59
↓ 3 callers
Function
json_response
(body: Any, status: int)
tests/lib/test_refusal_fallback_streaming.py:97
↓ 3 callers
Function
listing_interrupted_by
Run `interrupt` once while a sync's server listing is being consumed: right after the sync has processed `after_items` listed memories, or onc
tests/lib/tools/memory_sync/conftest.py:43
↓ 3 callers
Function
log_safe
A model- or page-supplied name for a log record or an SDK-written error text: `one_line`, cut short.
src/anthropic/lib/tools/_toolsets/_sanitize.py:64
↓ 3 callers
Function
make_async_bedrock_client
(**kwargs: Any)
tests/test_middleware.py:1923
↓ 3 callers
Function
make_async_mantle_client
(**kwargs: Any)
tests/test_middleware.py:1939
↓ 3 callers
Function
make_bedrock_client
(**kwargs: Any)
tests/test_middleware.py:1919
↓ 3 callers
Function
make_jsonl_iterator
( content: Iterator[bytes], *, sync: bool, line_type: type[_T], )
tests/decoders/test_jsonl.py:79
↓ 3 callers
Function
make_mantle_client
(**kwargs: Any)
tests/test_middleware.py:1935
↓ 3 callers
Function
make_message
(message_cls: type[Union[Message, BetaMessage]])
tests/types/test_to_param.py:47
↓ 3 callers
Function
make_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1927
↓ 3 callers
Function
map_aiohttp_exceptions
()
src/anthropic/_vendor/httpx_aiohttp/transport.py:46
↓ 3 callers
Function
mcp_resource_to_file
Convert MCP resource contents to a file tuple for `files.upload()`. Returns a `(filename, content_bytes, mime_type)` tuple compatible with th
src/anthropic/lib/tools/mcp.py:277
↓ 3 callers
Method
next_page_info
(self)
src/anthropic/_base_client.py:227
↓ 3 callers
Function
not_found
(tool_use_id: str)
tests/lib/tools/test_runner_eager_tools.py:855
↓ 3 callers
Function
parse_input
Parse the model's `tool_use.input` into the member's input model. A mistyped field is the model's mistake, so it comes back as a `ToolError` the
src/anthropic/lib/tools/_toolsets/_base.py:500
↓ 3 callers
Method
read
Read and return the binary response content.
src/anthropic/_response.py:472
↓ 3 callers
Function
realpath_lenient
`path` made absolute with every existing symlink resolved and `..` collapsed. Components that do not exist yet (a download directory to be created
src/anthropic/lib/tools/_toolsets/_security.py:35
↓ 3 callers
Function
reject_unrestricted_paths
Raise `TypeError` if the deprecated `unrestricted_paths` was passed at all.
src/anthropic/lib/tools/_deprecations.py:22
↓ 3 callers
Method
release
Drop one hold; the last release applies any deferred arm. Once nothing gated is held or in flight, a deferred countdown starts now (w
src/anthropic/lib/tools/_beta_session_runner.py:222
↓ 3 callers
Function
render_result
The content blocks for a member's result, by the registry's result kind. A pure action renders as its fixed acknowledgment, then, in a text block
src/anthropic/lib/tools/_toolsets/_render.py:110
↓ 3 callers
Function
reply_ending
A reply that ends for another reason.
tests/lib/tools/test_runner_eager_tools.py:845
↓ 3 callers
Function
signature_without_evaluating_annotations
Like `inspect.signature()`, for callers that only need parameter names, kinds and defaults. Python 3.14 evaluates annotations lazily and `inspect
src/anthropic/_utils/_reflection.py:9
↓ 3 callers
Method
start
(cls, workdir: str | os.PathLike[str], *, env: Optional[Mapping[str, str]] = None)
src/anthropic/lib/tools/agent_toolset.py:464
↓ 3 callers
Method
tab
(self, tab_id: str | None)
tests/lib/tools/toolsets/_fakes.py:86
↓ 3 callers
Function
tool_results
(message: BetaMessageParam | None)
tests/lib/tools/test_runner_eager_tools.py:873
↓ 3 callers
Function
url_context
(record: CallRecord)
src/anthropic/lib/tools/_toolsets/_pipeline.py:302
↓ 3 callers
Function
validate_type
Strict validation that the given value matches the expected type
src/anthropic/_models.py:865
↓ 3 callers
Method
wait
(self, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/toolsets/test_pipeline.py:1122
← previous
next →
501–600 of 9,455, ranked by callers