MCPcopy Create free account

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

Functions6,399 in github.com/anthropics/anthropic-sdk-python

↓ 2 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_streaming.py:160
↓ 2 callersMethodclose
Close the owned ``httpx2.Client`` if we created one.
src/anthropic/lib/credentials/_providers.py:437
↓ 2 callersMethodclose
Close the underlying ``httpx2.Client`` if we created it.
src/anthropic/lib/credentials/_workload.py:233
↓ 2 callersFunctioncoerce_boolean
(val: str)
src/anthropic/_utils/_utils.py:336
↓ 2 callersMethodcontent_blocks
The accumulated content blocks, in start order.
src/anthropic/lib/middleware/_fallbacks.py:1242
↓ 2 callersMethodcontinuation
(self)
src/anthropic/lib/middleware/_fallbacks.py:1124
↓ 2 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/foundry.py:208
↓ 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:479
↓ 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 callersMethodcopy
( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] — narrows `credentials` to No
src/anthropic/lib/aws/_client.py:377
↓ 2 callersMethodcreate
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:140
↓ 2 callersMethoddelete
Delete File Args: file_id: ID of the File. extra_headers: Send extra headers extra_query: Add additi
src/anthropic/resources/files.py:120
↓ 2 callersMethoddisarm
Cancel the idle countdown; only signals on an actual transition.
src/anthropic/lib/tools/_beta_session_runner.py:207
↓ 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
src/anthropic/lib/tools/_skills.py:201
↓ 2 callersFunctionerror_response
(message: str, status: int)
tests/lib/test_refusal_fallback_streaming.py:101
↓ 2 callersMethodexecute
Execute a memory command and return the result. This method dispatches to the appropriate handler method based on the command type (v
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:109
↓ 2 callersMethodfeed
Process one event, returning the frames to forward for it.
src/anthropic/lib/middleware/_fallbacks.py:840
↓ 2 callersFunctionfield_get_default
(field: FieldInfo)
src/anthropic/_compat.py:93
↓ 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:335
↓ 2 callersMethodfinish
The outcome once the hop's stream is fully consumed (or cut early).
src/anthropic/lib/middleware/_fallbacks.py:991
↓ 2 callersMethodfinish_frames
Frames still owed when the stream ends without a chainable refusal.
src/anthropic/lib/middleware/_fallbacks.py:985
↓ 2 callersFunctionflatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callersFunctionformat_code_block
(code: str)
scripts/utils/ruffen-docs.py:107
↓ 2 callersFunctionget_architecture
()
src/anthropic/_base_client.py:2402
↓ 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 callersFunctionget_helper_tag
Get the helper name from an object, if any.
src/anthropic/lib/_stainless_helpers.py:92
↓ 2 callersFunctionget_model_fields
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:116
↓ 2 callersMethodget_next_page
(self: SyncPageT)
src/anthropic/_base_client.py:285
↓ 2 callersFunctionget_platform
()
src/anthropic/_base_client.py:2323
↓ 2 callersFunctionget_tool_use_response_without_caller
()
tests/lib/streaming/test_messages.py:152
↓ 2 callersMethodhandler
(req: APIRequest)
tests/test_middleware.py:501
↓ 2 callersMethodhas_next_page
(self)
src/anthropic/_base_client.py:201
↓ 2 callersMethodhold
Pause the countdown while a gated call is held or in flight.
src/anthropic/lib/tools/_beta_session_runner.py:214
↓ 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:1127
↓ 2 callersFunctionis_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callersFunctionis_basemodel_type
(type_: type)
src/anthropic/_models.py:545
↓ 2 callersFunctionis_iterable_type
If the given type is `typing.Iterable[T]`
src/anthropic/_utils/_typing.py:34
↓ 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 callersFunctionis_required_type
(typ: type)
src/anthropic/_utils/_typing.py:44
↓ 2 callersFunctionis_sequence
(obj: object)
src/anthropic/_utils/_utils.py:178
↓ 2 callersFunctionis_sequence_t
(obj: _SequenceT | object)
src/anthropic/_utils/_utils.py:182
↓ 2 callersFunctionis_typeddict
(tp: Type[Any])
src/anthropic/_utils/_compat.py:32
↓ 2 callersFunctionis_union
(tp: type[Any] | None)
src/anthropic/_compat.py:33
↓ 2 callersMethoditer_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:383
↓ 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:375
↓ 2 callersMethodjson
(self)
src/anthropic/_streaming.py:361
↓ 2 callersFunctionmake_async_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1836
↓ 2 callersMethodmark_opened
(self)
src/anthropic/lib/middleware/_fallbacks.py:1120
↓ 2 callersFunctionmodel_parse
(model: type[_ModelT], data: Any)
src/anthropic/_compat.py:175
↓ 2 callersMethodon_claim
(self)
src/anthropic/lib/environments/_poller.py:72
↓ 2 callersMethodon_empty_poll
(self)
src/anthropic/lib/environments/_poller.py:61
↓ 2 callersFunctionparse_beta_response
( *, output_format: ResponseFormatT | NotGiven, response: BetaMessage, )
src/anthropic/lib/_parse/_response.py:23
↓ 2 callersFunctionparse_response
( *, output_format: ResponseFormatT | NotGiven, response: Message, )
src/anthropic/lib/_parse/_response.py:49
↓ 2 callersMethodpending_seam_frames
(self)
src/anthropic/lib/middleware/_fallbacks.py:1117
↓ 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:397
↓ 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
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:1093
↓ 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:55
↓ 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_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
src/anthropic/lib/tools/_tool_dispatch.py:124
↓ 2 callersMethodset_messages_params
Update the parameters for the next API call. This invalidates any cached tool responses. Args: params (ParsedMessageCrea
src/anthropic/lib/tools/_beta_runner.py:123
↓ 2 callersFunctionshort_circuit_message
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:361
↓ 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:51
↓ 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 determini
src/anthropic/lib/tools/_memories.py:433
↓ 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:1161
↓ 2 callersFunctionto_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:249
↓ 2 callersMethodtoken
Return a valid access token, loading ADC / refreshing as needed. Blocking.
src/anthropic/lib/google_cloud/_client.py:63
↓ 2 callersFunctiontool_registry
Index ``tools`` by their ``name`` for O(1) dispatch lookup. On a duplicate name the later tool wins, matching a plain dict comprehension.
src/anthropic/lib/tools/_tool_dispatch.py:49
↓ 2 callersMethodunwrap
Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and `webhook-signature` headers using your webhook signing
src/anthropic/resources/beta/webhooks.py:31
↓ 2 callersFunctionvalidate_type
Strict validation that the given value matches the expected type
src/anthropic/_models.py:834
↓ 1 callersMethod__aenter__
(self)
src/anthropic/lib/tools/agent_toolset.py:330
↓ 1 callersMethod__aexit__
(self, *exc: object)
src/anthropic/lib/tools/_file_store.py:132
↓ 1 callersMethod__aexit__
(self, *exc: object)
src/anthropic/lib/tools/agent_toolset.py:334
↓ 1 callersMethod__as_proxied__
Helper method that returns the current proxy, typed as the loaded object
src/anthropic/_utils/_proxy.py:60
↓ 1 callersMethod__decode__
(self)
src/anthropic/_decoders/jsonl.py:43
↓ 1 callersMethod__decode__
(self)
src/anthropic/_decoders/jsonl.py:99
↓ 1 callersMethod__enter__
(self)
src/anthropic/lib/streaming/_messages.py:74
↓ 1 callersMethod__init__
Construct a new synchronous Anthropic client instance. Credentials are resolved in the following order (first match wins): 1. Explic
src/anthropic/_client.py:133
↓ 1 callersMethod__init__
(self, root: Path, removed_on_dispose: bool, utf8_only: bool = False)
src/anthropic/lib/tools/_file_store.py:87
↓ 1 callersMethod__init__
(self, content: BetaFunctionToolResultType)
src/anthropic/lib/tools/_beta_functions.py:48
↓ 1 callersMethod__init__
( self, *, cast_to: type[_T], response: httpx2.Response, client: Anthr
src/anthropic/lib/bedrock/_stream.py:15
↓ 1 callersMethod__init__
( self, *, aws_access_key: str | None = None, aws_secret_key: str | None = Non
src/anthropic/lib/bedrock/_mantle.py:177
↓ 1 callersMethod__init__
( self, aws_secret_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/bedrock/_client.py:136
↓ 1 callersMethod__init__
( self, *, api_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/aws/_client.py:35
↓ 1 callersMethod__init__
( self, *, region: str | NotGiven = not_given, project_id: str | NotGiven = no
src/anthropic/lib/vertex/_client.py:96
↓ 1 callersMethod__init__
Construct a new synchronous Claude Platform on Google Cloud client. Auth precedence (first match wins, unless ``skip_auth=True``):
src/anthropic/lib/google_cloud/_client.py:201
↓ 1 callersMethod__init__
( self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_re
src/anthropic/_decoders/jsonl.py:23
↓ 1 callersMethod__load__
(self)
src/anthropic/_utils/_proxy.py:65
↓ 1 callersMethod__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:203
↓ 1 callersMethod__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:395
↓ 1 callersMethod__stream__
(self)
src/anthropic/_streaming.py:211
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:135
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:288
← previousnext →601–700 of 6,399, ranked by callers