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
↓ 2 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_mantle.py:464
↓ 2 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_client.py:238
↓ 2 callers
Function
copy_tree
Returns `[copied data]` and the slots whose file input is still to be read (in a body only).
src/anthropic/_utils/_prepare.py:85
↓ 2 callers
Method
create
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:140
↓ 2 callers
Method
cursor_position
( self, context: BetaToolsetCallContext, input: BetaComputerCursorPositionInput )
tests/lib/tools/toolsets/_computer_fakes.py:60
↓ 2 callers
Method
delete
Delete File Args: file_id: ID of the File. workspace_id: Optional header to select the Workspace for this reque
src/anthropic/resources/files.py:123
↓ 2 callers
Function
download_session_skills
Download the session agent's skills into `{workdir}/skills/<name>/`. Reads the resolved agent off `session`, and for each skill fetches its f
src/anthropic/lib/tools/_skills.py:201
↓ 2 callers
Function
empty_message
()
tests/lib/tools/test_runner_eager_tools.py:896
↓ 2 callers
Function
ends_turn
Whether `ev` is a `session.status_idle` whose turn is over. Only `requires_action` leaves the turn open: the session resumes once a client re
src/anthropic/lib/tools/_beta_session_runner.py:989
↓ 2 callers
Function
error_content
(error: ToolError)
src/anthropic/lib/tools/_toolsets/_base.py:546
↓ 2 callers
Function
error_text_content
The text blocks of a `ToolError`'s content. Deliberate: the API accepts only text on an `is_error` result and answers anything else with a 400 tha
src/anthropic/lib/tools/_toolsets/_sanitize.py:81
↓ 2 callers
Function
event_by_event
(canned: Reply, *, fails_before: str | None = None)
tests/lib/tools/test_runner_eager_tools.py:995
↓ 2 callers
Function
fallback
The block a refusal starts when it hands the reply to a fallback model.
tests/lib/tools/test_runner_eager_tools.py:825
↓ 2 callers
Method
feed
Process one event, returning the frames to forward for it.
src/anthropic/lib/middleware/_fallbacks.py:845
↓ 2 callers
Function
field_get_default
(field: FieldInfo)
src/anthropic/_compat.py:88
↓ 2 callers
Function
file_name
(file: FileContent)
src/anthropic/_files.py:80
↓ 2 callers
Method
finish
The session's last sync — once, at a clean end. Same reconciliation as the cadence syncs, but server deletes skip the waiting window
src/anthropic/lib/tools/_memories.py:342
↓ 2 callers
Method
finish
The outcome once the hop's stream is fully consumed (or cut early).
src/anthropic/lib/middleware/_fallbacks.py:1006
↓ 2 callers
Method
finish_frames
Frames still owed when the stream ends without a chainable refusal.
src/anthropic/lib/middleware/_fallbacks.py:1000
↓ 2 callers
Function
flatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callers
Function
format_str
( src: str, format_code_block: Callable[[str], str], )
scripts/utils/ruffen-docs.py:35
↓ 2 callers
Function
get_architecture
()
src/anthropic/_base_client.py:2489
↓ 2 callers
Function
get_auth_headers
( *, method: str, url: str, headers: httpx2.Headers, aws_access_key: str | None, aws_s
src/anthropic/lib/bedrock/_auth.py:33
↓ 2 callers
Method
get_credentials
(self)
tests/lib/test_aws_auth.py:590
↓ 2 callers
Function
get_environment_proxies
Gets the proxy mappings based on environment variables. We use our own logic to parse these variables, as HTTPX doesn’t allow full config
src/anthropic/_utils/_httpx.py:32
↓ 2 callers
Method
get_next_page
(self: SyncPageT)
src/anthropic/_base_client.py:305
↓ 2 callers
Method
get_page_text
(self, context: BetaToolsetCallContext, input: BetaBrowserGetPageTextInput)
tests/lib/tools/toolsets/_fakes.py:116
↓ 2 callers
Function
get_platform
()
src/anthropic/_base_client.py:2410
↓ 2 callers
Function
get_tool_use_response_without_caller
()
tests/lib/streaming/test_messages.py:175
↓ 2 callers
Method
handler
(req: APIRequest)
tests/test_middleware.py:502
↓ 2 callers
Method
has_next_page
(self)
src/anthropic/_base_client.py:221
↓ 2 callers
Method
held
(self)
src/anthropic/lib/tools/_beta_runner.py:1199
↓ 2 callers
Function
helper_tags
(index: int)
tests/lib/tools/toolsets/test_runner.py:814
↓ 2 callers
Method
hold
(self, tool_use: BetaToolUseBlock | str)
src/anthropic/lib/tools/_beta_runner.py:1191
↓ 2 callers
Method
hold
Pause the countdown while a gated call is held or in flight.
src/anthropic/lib/tools/_beta_session_runner.py:212
↓ 2 callers
Method
hop_body
The hop's request body: the entry applied as a patch against the ORIGINAL request params (never a previous hop's patched body), extended
src/anthropic/lib/middleware/_fallbacks.py:1142
↓ 2 callers
Function
is_async_callable
Whether calling `obj` returns a coroutine: an `async def` function, an object whose `__call__` is one, or a `functools.partial` of either.
src/anthropic/lib/tools/_toolsets/_base.py:445
↓ 2 callers
Function
is_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callers
Function
is_basemodel_type
(type_: type)
src/anthropic/_models.py:546
↓ 2 callers
Method
is_held
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:1196
↓ 2 callers
Function
is_literal_type
(type_: type[Any])
src/anthropic/_compat.py:39
↓ 2 callers
Method
is_path_legal
True for a path usable verbatim as a store location: absolute, no `..`.
src/anthropic/lib/tools/_file_store.py:94
↓ 2 callers
Method
is_path_visible
(self, path: str)
tests/lib/tools/toolsets/test_pipeline.py:281
↓ 2 callers
Function
is_sent_as_list
Whether a value that is not a mapping is sent as a JSON array, or as `key[]=` entries in a query. Sequences, sets, dict views and iterators (gene
src/anthropic/_utils/_json.py:35
↓ 2 callers
Function
is_sequence_t
(obj: _SequenceT | object)
src/anthropic/_utils/_utils.py:182
↓ 2 callers
Function
is_union
(tp: type[Any] | None)
src/anthropic/_compat.py:33
↓ 2 callers
Function
is_union_type
(typ: type)
src/anthropic/_utils/_typing.py:40
↓ 2 callers
Method
iter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:406
↓ 2 callers
Function
jitter
Uniform random delay in `[low, high)` — spreads out retry storms.
src/anthropic/lib/_retry.py:37
↓ 2 callers
Method
json
Read and decode the JSON response content.
src/anthropic/_response.py:376
↓ 2 callers
Method
json
(self)
src/anthropic/_streaming.py:384
↓ 2 callers
Function
label_of
Names a stream event, given as JSON, after the block it belongs to, such as `a: content_block_stop`.
tests/lib/tools/test_runner_eager_tools.py:884
↓ 2 callers
Function
lexically_under
Whether `candidate`, normalised as text, is `directory` (as written or as it resolves) or below it.
src/anthropic/lib/tools/_toolsets/_security.py:134
↓ 2 callers
Method
list_tabs
( self, context: BetaToolsetCallContext, input: BetaBrowserListTabsInput )
tests/lib/tools/toolsets/_fakes.py:133
↓ 2 callers
Function
lookup_tool
A `lookup` tool that writes to `timeline` when it starts, and returns `value of <key>` unless `lookup` says otherwise.
tests/lib/tools/test_runner_eager_tools.py:999
↓ 2 callers
Function
make_async_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1931
↓ 2 callers
Function
malformed_toolset_call_result
Build the error result for a call that is named after a toolset in the run but has no `toolset_name`. Its input holds actions for that toolset in
src/anthropic/lib/tools/_beta_runner.py:1237
↓ 2 callers
Method
mark_opened
(self)
src/anthropic/lib/middleware/_fallbacks.py:1135
↓ 2 callers
Function
member_error_result
`classify` for the runner: the refusal as an `is_error` result, an unexpected exception logged first.
src/anthropic/lib/tools/_toolsets/_runnable.py:247
↓ 2 callers
Function
members_from_union
One `(name, input model)` per variant of a generated `tool_use` union, in its order. A variant whose `input` is typed as a bare object (a member t
src/anthropic/lib/tools/_toolsets/_base.py:424
↓ 2 callers
Function
model_parse
(model: type[_ModelT], data: Any)
src/anthropic/_compat.py:170
↓ 2 callers
Method
mouse_move
(self, context: BetaToolsetCallContext, input: BetaComputerMouseMoveInput)
tests/lib/tools/toolsets/_computer_fakes.py:66
↓ 2 callers
Method
navigate
(self, context: BetaToolsetCallContext, input: BetaBrowserNavigateInput)
tests/lib/tools/toolsets/_fakes.py:94
↓ 2 callers
Function
navigate_url
The `url` of a `navigate` call exactly as the model wrote it, for the URL policy. `None` for the history words `back` / `forward` / `reload` (the
src/anthropic/lib/tools/_toolsets/_pipeline.py:310
↓ 2 callers
Method
new_tab
(self, context: BetaToolsetCallContext, input: BetaBrowserNewTabInput)
tests/lib/tools/toolsets/_fakes.py:120
↓ 2 callers
Function
not_executed_result
(tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_toolsets/_runnable.py:212
↓ 2 callers
Method
on_claim
(self)
src/anthropic/lib/environments/_poller.py:72
↓ 2 callers
Method
on_empty_poll
(self)
src/anthropic/lib/environments/_poller.py:61
↓ 2 callers
Function
openapi_model_dump
Dump a model as it is sent in a request body, without the fields named in `__api_exclude__`.
src/anthropic/_utils/_json.py:53
↓ 2 callers
Function
parse_beta_response
( *, output_format: ResponseFormatT | NotGiven, response: BetaMessage, )
src/anthropic/lib/_parse/_response.py:23
↓ 2 callers
Function
parse_computer_input
`parse_input` for a computer member, plus the shape of each coordinate list: the generated models type them as lists of integers of any length, an
src/anthropic/lib/tools/_toolsets/_computer.py:396
↓ 2 callers
Function
parse_response
( *, output_format: ResponseFormatT | NotGiven, response: Message, )
src/anthropic/lib/_parse/_response.py:49
↓ 2 callers
Function
paths
(browser: FakeBrowser)
tests/lib/tools/toolsets/test_enforcement.py:293
↓ 2 callers
Method
pending_seam_frames
(self)
src/anthropic/lib/middleware/_fallbacks.py:1132
↓ 2 callers
Function
policy
(ctx: object, url: str)
tests/lib/tools/toolsets/test_interface.py:190
↓ 2 callers
Function
policy_outcome
Turn what the `url_policy` callable did into the pipeline's decision: return to proceed, or raise the refusal the model reads. A `ToolError` it ra
src/anthropic/lib/tools/_toolsets/_pipeline.py:326
↓ 2 callers
Method
poll
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:409
↓ 2 callers
Method
put
Write `str` (UTF-8) or `bytes` atomically to the file at `rel_path`. Missing directories below the root are created; a missing root is not —
src/anthropic/lib/tools/_file_store.py:135
↓ 2 callers
Method
queue_seam
Queue the reached hop's `fallback` seam block at the next monotonic index. Queued seams are flushed by the hop reader once output reaches the
src/anthropic/lib/middleware/_fallbacks.py:1108
↓ 2 callers
Function
raised_content
The content `call()` raises for a refusal or failure. A string becomes one text block. A list of blocks is kept as raised, images included. `tool_
src/anthropic/lib/tools/_toolsets/_computer.py:418
↓ 2 callers
Method
range_is_collected
(self)
src/anthropic/lib/tools/_files.py:52
↓ 2 callers
Method
raw_events
Iterate the raw Server-Sent Events from `response`, before any JSON parsing or event-name filtering. This reads the response body dir
src/anthropic/_streaming.py:56
↓ 2 callers
Function
readable
The file object to read; any other `os.PathLike` is rejected without touching the filesystem.
src/anthropic/_utils/_prepare.py:195
↓ 2 callers
Method
refresh
(self, _request: object)
tests/lib/test_vertex.py:258
↓ 2 callers
Function
resolve_identity_token_path
ctor arg → `ANTHROPIC_IDENTITY_TOKEN_FILE` → `None`.
src/anthropic/lib/credentials/_constants.py:220
↓ 2 callers
Function
run
(key: str)
tests/lib/tools/test_runner_eager_tools.py:1005
↓ 2 callers
Function
run_runnable_tool
Call `tool` with `input`, awaiting the result if the tool is async. Sync tools run on a worker thread. If the caller cancels (for example on a
src/anthropic/lib/tools/_tool_dispatch.py:286
↓ 2 callers
Method
screenshot
(self, context: BetaToolsetCallContext, input: BetaBrowserScreenshotInput)
tests/lib/tools/toolsets/_fakes.py:106
↓ 2 callers
Method
screenshot
(self, context: BetaToolsetCallContext, input: BetaComputerScreenshotInput)
tests/lib/tools/toolsets/_computer_fakes.py:54
↓ 2 callers
Function
short_circuit_message
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:362
↓ 2 callers
Function
start
(event_id: str)
tests/lib/sessions/test_accumulate.py:21
↓ 2 callers
Method
stringify_items
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:52
↓ 2 callers
Method
switch_tab
( self, context: BetaToolsetCallContext, input: BetaBrowserSwitchTabInput )
tests/lib/tools/toolsets/_fakes.py:142
↓ 2 callers
Method
sync_if_due
Run one sync when `sync_interval` has elapsed since the last. Stores sync in parallel; a store's own paths reconcile in a determinist
src/anthropic/lib/tools/_memories.py:441
↓ 2 callers
Method
terminal_failure_frames
Degrade to the suppressed refusal when every remaining entry failed over HTTP: replay its message_delta verbatim — `recommended_model`
src/anthropic/lib/middleware/_fallbacks.py:1176
↓ 2 callers
Function
text_block
(text: str)
src/anthropic/lib/tools/_toolsets/_render.py:91
↓ 2 callers
Function
to_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:249
↓ 2 callers
Function
to_events
The reply as the stream events the API sends for it.
tests/lib/tools/test_runner_eager_tools.py:909
↓ 2 callers
Method
token
Return a valid access token, loading ADC / refreshing as needed. Blocking.
src/anthropic/lib/google_cloud/_client.py:63
↓ 2 callers
Method
track
Follows the reply, and returns the call that `event` shows the model has moved on from, if any. A call's own `content_block_stop` isn't enoug
src/anthropic/lib/tools/_beta_runner.py:1206
← previous
next →
801–900 of 9,455, ranked by callers