MCPcopy Create free account

hub / github.com/anthropics/anthropic-sdk-python / functions

Functions9,455 in github.com/anthropics/anthropic-sdk-python

↓ 2 callersMethodcopy
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 callersMethodcopy
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 callersFunctioncopy_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 callersMethodcreate
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:140
↓ 2 callersMethodcursor_position
( self, context: BetaToolsetCallContext, input: BetaComputerCursorPositionInput )
tests/lib/tools/toolsets/_computer_fakes.py:60
↓ 2 callersMethoddelete
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 callersFunctiondownload_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 callersFunctionempty_message
()
tests/lib/tools/test_runner_eager_tools.py:896
↓ 2 callersFunctionends_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 callersFunctionerror_content
(error: ToolError)
src/anthropic/lib/tools/_toolsets/_base.py:546
↓ 2 callersFunctionerror_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 callersFunctionevent_by_event
(canned: Reply, *, fails_before: str | None = None)
tests/lib/tools/test_runner_eager_tools.py:995
↓ 2 callersFunctionfallback
The block a refusal starts when it hands the reply to a fallback model.
tests/lib/tools/test_runner_eager_tools.py:825
↓ 2 callersMethodfeed
Process one event, returning the frames to forward for it.
src/anthropic/lib/middleware/_fallbacks.py:845
↓ 2 callersFunctionfield_get_default
(field: FieldInfo)
src/anthropic/_compat.py:88
↓ 2 callersFunctionfile_name
(file: FileContent)
src/anthropic/_files.py:80
↓ 2 callersMethodfinish
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 callersMethodfinish
The outcome once the hop's stream is fully consumed (or cut early).
src/anthropic/lib/middleware/_fallbacks.py:1006
↓ 2 callersMethodfinish_frames
Frames still owed when the stream ends without a chainable refusal.
src/anthropic/lib/middleware/_fallbacks.py:1000
↓ 2 callersFunctionflatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callersFunctionformat_str
( src: str, format_code_block: Callable[[str], str], )
scripts/utils/ruffen-docs.py:35
↓ 2 callersFunctionget_architecture
()
src/anthropic/_base_client.py:2489
↓ 2 callersFunctionget_auth_headers
( *, method: str, url: str, headers: httpx2.Headers, aws_access_key: str | None, aws_s
src/anthropic/lib/bedrock/_auth.py:33
↓ 2 callersMethodget_credentials
(self)
tests/lib/test_aws_auth.py:590
↓ 2 callersFunctionget_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 callersMethodget_next_page
(self: SyncPageT)
src/anthropic/_base_client.py:305
↓ 2 callersMethodget_page_text
(self, context: BetaToolsetCallContext, input: BetaBrowserGetPageTextInput)
tests/lib/tools/toolsets/_fakes.py:116
↓ 2 callersFunctionget_platform
()
src/anthropic/_base_client.py:2410
↓ 2 callersFunctionget_tool_use_response_without_caller
()
tests/lib/streaming/test_messages.py:175
↓ 2 callersMethodhandler
(req: APIRequest)
tests/test_middleware.py:502
↓ 2 callersMethodhas_next_page
(self)
src/anthropic/_base_client.py:221
↓ 2 callersMethodheld
(self)
src/anthropic/lib/tools/_beta_runner.py:1199
↓ 2 callersFunctionhelper_tags
(index: int)
tests/lib/tools/toolsets/test_runner.py:814
↓ 2 callersMethodhold
(self, tool_use: BetaToolUseBlock | str)
src/anthropic/lib/tools/_beta_runner.py:1191
↓ 2 callersMethodhold
Pause the countdown while a gated call is held or in flight.
src/anthropic/lib/tools/_beta_session_runner.py:212
↓ 2 callersMethodhop_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 callersFunctionis_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 callersFunctionis_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callersFunctionis_basemodel_type
(type_: type)
src/anthropic/_models.py:546
↓ 2 callersMethodis_held
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:1196
↓ 2 callersFunctionis_literal_type
(type_: type[Any])
src/anthropic/_compat.py:39
↓ 2 callersMethodis_path_legal
True for a path usable verbatim as a store location: absolute, no `..`.
src/anthropic/lib/tools/_file_store.py:94
↓ 2 callersMethodis_path_visible
(self, path: str)
tests/lib/tools/toolsets/test_pipeline.py:281
↓ 2 callersFunctionis_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 callersFunctionis_sequence_t
(obj: _SequenceT | object)
src/anthropic/_utils/_utils.py:182
↓ 2 callersFunctionis_union
(tp: type[Any] | None)
src/anthropic/_compat.py:33
↓ 2 callersFunctionis_union_type
(typ: type)
src/anthropic/_utils/_typing.py:40
↓ 2 callersMethoditer_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:406
↓ 2 callersFunctionjitter
Uniform random delay in `[low, high)` — spreads out retry storms.
src/anthropic/lib/_retry.py:37
↓ 2 callersMethodjson
Read and decode the JSON response content.
src/anthropic/_response.py:376
↓ 2 callersMethodjson
(self)
src/anthropic/_streaming.py:384
↓ 2 callersFunctionlabel_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 callersFunctionlexically_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 callersMethodlist_tabs
( self, context: BetaToolsetCallContext, input: BetaBrowserListTabsInput )
tests/lib/tools/toolsets/_fakes.py:133
↓ 2 callersFunctionlookup_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 callersFunctionmake_async_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1931
↓ 2 callersFunctionmalformed_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 callersMethodmark_opened
(self)
src/anthropic/lib/middleware/_fallbacks.py:1135
↓ 2 callersFunctionmember_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 callersFunctionmembers_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 callersFunctionmodel_parse
(model: type[_ModelT], data: Any)
src/anthropic/_compat.py:170
↓ 2 callersMethodmouse_move
(self, context: BetaToolsetCallContext, input: BetaComputerMouseMoveInput)
tests/lib/tools/toolsets/_computer_fakes.py:66
↓ 2 callersMethodnavigate
(self, context: BetaToolsetCallContext, input: BetaBrowserNavigateInput)
tests/lib/tools/toolsets/_fakes.py:94
↓ 2 callersFunctionnavigate_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 callersMethodnew_tab
(self, context: BetaToolsetCallContext, input: BetaBrowserNewTabInput)
tests/lib/tools/toolsets/_fakes.py:120
↓ 2 callersFunctionnot_executed_result
(tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_toolsets/_runnable.py:212
↓ 2 callersMethodon_claim
(self)
src/anthropic/lib/environments/_poller.py:72
↓ 2 callersMethodon_empty_poll
(self)
src/anthropic/lib/environments/_poller.py:61
↓ 2 callersFunctionopenapi_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 callersFunctionparse_beta_response
( *, output_format: ResponseFormatT | NotGiven, response: BetaMessage, )
src/anthropic/lib/_parse/_response.py:23
↓ 2 callersFunctionparse_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 callersFunctionparse_response
( *, output_format: ResponseFormatT | NotGiven, response: Message, )
src/anthropic/lib/_parse/_response.py:49
↓ 2 callersFunctionpaths
(browser: FakeBrowser)
tests/lib/tools/toolsets/test_enforcement.py:293
↓ 2 callersMethodpending_seam_frames
(self)
src/anthropic/lib/middleware/_fallbacks.py:1132
↓ 2 callersFunctionpolicy
(ctx: object, url: str)
tests/lib/tools/toolsets/test_interface.py:190
↓ 2 callersFunctionpolicy_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 callersMethodpoll
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 callersMethodput
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 callersMethodqueue_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 callersFunctionraised_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 callersMethodrange_is_collected
(self)
src/anthropic/lib/tools/_files.py:52
↓ 2 callersMethodraw_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 callersFunctionreadable
The file object to read; any other `os.PathLike` is rejected without touching the filesystem.
src/anthropic/_utils/_prepare.py:195
↓ 2 callersMethodrefresh
(self, _request: object)
tests/lib/test_vertex.py:258
↓ 2 callersFunctionresolve_identity_token_path
ctor arg → `ANTHROPIC_IDENTITY_TOKEN_FILE` → `None`.
src/anthropic/lib/credentials/_constants.py:220
↓ 2 callersFunctionrun
(key: str)
tests/lib/tools/test_runner_eager_tools.py:1005
↓ 2 callersFunctionrun_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 callersMethodscreenshot
(self, context: BetaToolsetCallContext, input: BetaBrowserScreenshotInput)
tests/lib/tools/toolsets/_fakes.py:106
↓ 2 callersMethodscreenshot
(self, context: BetaToolsetCallContext, input: BetaComputerScreenshotInput)
tests/lib/tools/toolsets/_computer_fakes.py:54
↓ 2 callersFunctionshort_circuit_message
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:362
↓ 2 callersFunctionstart
(event_id: str)
tests/lib/sessions/test_accumulate.py:21
↓ 2 callersMethodstringify_items
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:52
↓ 2 callersMethodswitch_tab
( self, context: BetaToolsetCallContext, input: BetaBrowserSwitchTabInput )
tests/lib/tools/toolsets/_fakes.py:142
↓ 2 callersMethodsync_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 callersMethodterminal_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 callersFunctiontext_block
(text: str)
src/anthropic/lib/tools/_toolsets/_render.py:91
↓ 2 callersFunctionto_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:249
↓ 2 callersFunctionto_events
The reply as the stream events the API sends for it.
tests/lib/tools/test_runner_eager_tools.py:909
↓ 2 callersMethodtoken
Return a valid access token, loading ADC / refreshing as needed. Blocking.
src/anthropic/lib/google_cloud/_client.py:63
↓ 2 callersMethodtrack
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
← previousnext →801–900 of 9,455, ranked by callers