Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,274 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,274
◇
Types & classes
3,937
↳
Endpoints
46
↓ 2 callers
Function
stored_state
(client: object)
tests/lib/test_client_copy.py:212
↓ 2 callers
Function
stream_error_response
A stream whose first event is an error.
tests/lib/threads/helpers.py:779
↓ 2 callers
Function
streamed_message
What records `stream` on the span of its API call, or `None` when the call has no span.
src/anthropic/lib/_tracing/_streaming.py:167
↓ 2 callers
Method
stringify_items
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:52
↓ 2 callers
Function
subprocess_env
()
tests/test_detect_breaking_changes.py:38
↓ 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:1190
↓ 2 callers
Function
text_block
(text: str)
src/anthropic/lib/tools/_toolsets/_render.py:91
↓ 2 callers
Function
thread_arguments
The arguments of a `thread()` call as the params a thread's state starts from.
src/anthropic/lib/threads/_params.py:75
↓ 2 callers
Function
to_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:359
↓ 2 callers
Function
to_aiter
(iter: Iterator[bytes])
tests/decoders/test_jsonl.py:122
↓ 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:84
↓ 2 callers
Function
tool_family
A tool definition's family, as the API computes it for a toolset: its `type` ("custom" when absent) without a trailing `_YYYYMMDD` date and then w
src/anthropic/lib/tools/_tool_dispatch.py:240
↓ 2 callers
Function
tool_registry
Index the named `tools` by their `name`. On a duplicate name the later tool wins.
src/anthropic/lib/tools/_tool_dispatch.py:139
↓ 2 callers
Function
tool_result_content
(content: object)
src/anthropic/lib/_tracing/_content.py:339
↓ 2 callers
Function
tool_use_span
Runs the block in the span of one client tool run, which ends with the result that the block set on the run. The span is named `anthropic.tool_us
src/anthropic/lib/_tracing/_tools.py:91
↓ 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:1711
↓ 2 callers
Method
transport
(self)
tests/utils.py:212
↓ 2 callers
Function
unnamed_file
(file: HttpxFileContent)
src/anthropic/_files.py:87
↓ 2 callers
Method
unwrap
Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and `webhook-signature` headers using your webhook signing
src/anthropic/resources/beta/webhooks.py:29
↓ 2 callers
Function
valid_access_token
(value: object)
src/anthropic/lib/credentials/_cache.py:30
↓ 2 callers
Function
version_bounds
(text: str)
scripts/utils/check-dist.py:61
↓ 2 callers
Function
with_bounded_tab_urls
The report with each tab's and each download's page-supplied URL as the model will read it, folded to one line and held to the API's limit (see `b
src/anthropic/lib/tools/_toolsets/_pipeline.py:110
↓ 2 callers
Function
without
(value: dict[str, Any], *keys: str)
tests/test_open_telemetry.py:7731
↓ 2 callers
Function
without_collection
()
tests/utils.py:261
↓ 2 callers
Function
without_data
`value` without its `encrypted_` fields, which are opaque, and without image and document data, which is large and binary, at any depth.
src/anthropic/lib/_tracing/_content.py:371
↓ 2 callers
Function
without_rejected_fast_speed
The hop's `request` to resend, or `None` when its result stands. `speed` is dropped, not set to `standard`: a model without fast mode rejects the
src/anthropic/lib/middleware/_fallbacks.py:1527
↓ 2 callers
Function
wrong_flavour_error
The error for a sync tool or toolset handed to the async runner (or the reverse), raised when the runner is built. A toolset mismatch is a `Toolse
src/anthropic/lib/tools/_tool_dispatch.py:68
↓ 2 callers
Method
zoom
(self, context: BetaToolsetCallContext, input: BetaComputerZoomInput)
tests/lib/tools/toolsets/_computer_fakes.py:57
↓ 1 callers
Method
__aenter__
(self)
src/anthropic/lib/tools/agent_toolset.py:333
↓ 1 callers
Method
__aexit__
(self, *exc: object)
src/anthropic/lib/tools/_file_store.py:132
↓ 1 callers
Method
__aexit__
(self, *exc: object)
src/anthropic/lib/tools/agent_toolset.py:337
↓ 1 callers
Method
__apply_policy
Run the `url_policy` callable on one address, raising the refusal unless it passes or there is no policy.
src/anthropic/lib/tools/_toolsets/_browser.py:299
↓ 1 callers
Method
__apply_policy
(self, url: str, context: BetaURLContext)
src/anthropic/lib/tools/_toolsets/_browser.py:549
↓ 1 callers
Method
__as_proxied__
Helper method that returns the current proxy, typed as the loaded object
src/anthropic/_utils/_proxy.py:60
↓ 1 callers
Method
__browser_state
(self, context: BetaToolsetCallContext)
src/anthropic/lib/tools/_toolsets/_browser.py:289
↓ 1 callers
Method
__browser_state
(self, context: BetaToolsetCallContext)
src/anthropic/lib/tools/_toolsets/_browser.py:541
↓ 1 callers
Method
__decode__
(self)
tests/decoders/test_jsonl.py:98
↓ 1 callers
Method
__enter__
(self)
src/anthropic/lib/tools/_toolsets/_runnable.py:125
↓ 1 callers
Method
__init__
Construct a new synchronous Anthropic client instance. Credentials are resolved in the following order (first match wins): 1. An exp
src/anthropic/_client.py:164
↓ 1 callers
Method
__init__
(self, observer: StreamObserver)
src/anthropic/_tracing.py:518
↓ 1 callers
Method
__init__
(self, root: Path, removed_on_dispose: bool, utf8_only: bool = False)
src/anthropic/lib/tools/_file_store.py:87
↓ 1 callers
Method
__init__
(self, content: BetaFunctionToolResultType)
src/anthropic/lib/tools/_beta_functions.py:50
↓ 1 callers
Method
__init__
( self, *, cast_to: type[_T], response: httpx2.Response, client: Anthr
src/anthropic/lib/bedrock/_stream.py:15
↓ 1 callers
Method
__init__
( self, *, aws_access_key: str | None = None, aws_secret_key: str | None = Non
src/anthropic/lib/bedrock/_mantle.py:157
↓ 1 callers
Method
__init__
( self, aws_secret_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/bedrock/_client.py:112
↓ 1 callers
Method
__init__
( self, *, api_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/aws/_client.py:35
↓ 1 callers
Method
__init__
( self, thread: BetaMessageThread[ResponseFormatT], messages: Iterable[BetaMessagePara
src/anthropic/lib/threads/_stream_managers.py:27
↓ 1 callers
Method
__init__
( self, *, region: str | NotGiven = not_given, project_id: str | NotGiven = no
src/anthropic/lib/vertex/_client.py:59
↓ 1 callers
Method
__init__
Construct a new synchronous Claude Models on Google Cloud (Anthropic managed) client. Auth precedence (first match wins, unless `skip_auth=Tr
src/anthropic/lib/google_cloud/_client.py:252
↓ 1 callers
Method
__init__
( self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_re
src/anthropic/_decoders/jsonl.py:25
↓ 1 callers
Method
__init__
(self, *, retried: bool = False)
tests/test_tracing.py:105
↓ 1 callers
Method
__init__
(self, **kwargs: Any)
tests/test_streaming.py:250
↓ 1 callers
Method
__init__
(self)
tests/lib/environments/test_worker.py:1192
↓ 1 callers
Method
__init__
(self, **kwargs: Any)
tests/decoders/test_jsonl.py:93
↓ 1 callers
Method
__load__
(self)
src/anthropic/_utils/_proxy.py:65
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:685
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:1222
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:142
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:314
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:137
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:302
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:168
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:340
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:158
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:323
↓ 1 callers
Function
_add
(tag: str | None)
src/anthropic/lib/_stainless_helpers.py:125
↓ 1 callers
Function
_aforce_stop_quietly
Async version of `_force_stop_quietly`.
src/anthropic/lib/environments/_poller.py:352
↓ 1 callers
Method
_aiter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:381
↓ 1 callers
Function
_append
(*messages: BetaMessageParam)
tests/lib/threads/helpers.py:568
↓ 1 callers
Function
_apply_delta
Apply a content_block_delta to the accumulating block at `index`.
src/anthropic/lib/middleware/_fallbacks.py:1327
↓ 1 callers
Function
_apply_tool_change
Apply a single `tool_removal` / `tool_addition` block to `available`.
src/anthropic/lib/tools/_tool_dispatch.py:200
↓ 1 callers
Function
_apply_tool_reference_change
Fold one `tool_removal` / `tool_addition` block into `available`.
src/anthropic/lib/tools/_tool_dispatch.py:211
↓ 1 callers
Function
_archive_file_mode
Reduce an archive entry's Unix mode to `0o755` if it is executable, `0o644` otherwise. Skill bundles can ship executable scripts (e.g. `scrip
src/anthropic/lib/tools/_skills.py:126
↓ 1 callers
Function
_array_suffix
(array_format: ArrayFormat, array_index: int)
src/anthropic/_utils/_utils.py:61
↓ 1 callers
Function
_assert_list_type
(type_: type[object], value: object)
tests/utils.py:156
↓ 1 callers
Method
_async_call_provider
Async version of `_call_provider`.
src/anthropic/lib/credentials/_cache.py:169
↓ 1 callers
Function
_async_collect_files
(directory: anyio.Path, relative_to: anyio.Path, files: list[FileTypes])
src/anthropic/lib/_files.py:36
↓ 1 callers
Method
_async_invoke_provider
Async version of `_invoke_provider`.
src/anthropic/lib/credentials/_cache.py:153
↓ 1 callers
Function
_async_provider_function
(*, force_refresh: bool = False)
tests/lib/test_credentials.py:3552
↓ 1 callers
Function
_async_transform_file
(file: FileTypes)
src/anthropic/_files.py:120
↓ 1 callers
Function
_backfill
Fill `None` fields on `primary` from `fallback`.
src/anthropic/lib/middleware/_fallbacks.py:1664
↓ 1 callers
Function
_basic_config
()
src/anthropic/_utils/_logs.py:8
↓ 1 callers
Function
_bedrock_message
(content: t.List[t.Dict[str, t.Any]], stop_reason: str)
tests/lib/test_bedrock.py:739
↓ 1 callers
Method
_browser_state
The browser after a call: the open tabs (one marked active) and the state changes since the previous report. Every driver implements it. The S
src/anthropic/lib/tools/_toolsets/_browser.py:329
↓ 1 callers
Method
_browser_state
The browser after a call. See the synchronous class's `_browser_state`. Awaited, so a sync method here is a contract error.
src/anthropic/lib/tools/_toolsets/_browser.py:573
↓ 1 callers
Function
_build_discriminated_union_meta
(*, union: type, meta_annotations: tuple[Any, ...])
src/anthropic/_models.py:867
↓ 1 callers
Function
_build_federation_result
Build a `CredentialResult` for the env-var federation path (step 4 in the precedence spec). Returns `None` if the required trio isn't fully se
src/anthropic/lib/credentials/_chain.py:29
↓ 1 callers
Method
_build_headers
(self, options: FinalRequestOptions, *, retries_taken: int = 0)
src/anthropic/_base_client.py:553
↓ 1 callers
Function
_build_result_event
Build the result-event params matching `ev`'s tool-call kind. A custom tool call (`agent.custom_tool_use`) is answered with a `user.custom_to
src/anthropic/lib/tools/_beta_session_runner.py:358
↓ 1 callers
Method
_call_oidc_federation
(self, auth: Dict[str, Any], *, force_refresh: bool = False)
src/anthropic/lib/credentials/_providers.py:644
↓ 1 callers
Method
_call_provider
Call the provider, retrying once on a 401 from the token endpoint.
src/anthropic/lib/credentials/_cache.py:159
↓ 1 callers
Method
_call_tool
Runs `tool` for `ev` and builds the result event, turning a timeout or an error into an error result. Also returns the result's content as th
src/anthropic/lib/tools/_beta_session_runner.py:1029
↓ 1 callers
Method
_call_user_oauth
Interactive-login profile. With a `client_id` in the auth block, we run the refresh_token grant on expiry; without one, we treat the c
src/anthropic/lib/credentials/_providers.py:521
↓ 1 callers
Function
_calls
()
tests/lib/tools/memory_sync/test_e2e_memory.py:103
↓ 1 callers
Function
_changed_tool_name
The locally runnable tool name a tool-change ``tool`` resolves to. `tool_reference` names one directly and `tool_definition` carries one by v
src/anthropic/lib/tools/_tool_dispatch.py:224
↓ 1 callers
Method
_cleanup_skills
Remove the skill directories `setup_skills` downloaded. Only the directories this context created are removed — a pre-existing `{work
src/anthropic/lib/tools/agent_toolset.py:319
↓ 1 callers
Function
_coerce_expires_at
Parse a credentials-file `expires_at` field into Unix seconds.
src/anthropic/lib/credentials/_providers.py:59
← previous
next →
1,201–1,300 of 12,274, ranked by callers