Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
13,873 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
13,873
◇
Types & classes
4,472
↳
Endpoints
93
↓ 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
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
Method
threads
(self)
src/anthropic/lib/tools/_beta_session_runner.py:894
↓ 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:256
↓ 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:155
↓ 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
Method
turn_ending_idle
(self, events: list[dict[str, Any]])
tests/lib/tools/test_session_runner_properties.py:311
↓ 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
uses_control_plane
(options: FinalRequestOptions)
src/anthropic/lib/bedrock/_client.py:112
↓ 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
violations
(trace: Trace)
tests/lib/environments/test_worker_properties.py:224
↓ 2 callers
Function
virtual_clock
Makes the code that does not read the event loop's clock follow it too, and the clock wait for threads.
tests/lib/environments/_schedules.py:282
↓ 2 callers
Method
wait_ended
(self, session: FakeSession, state: CallState)
tests/lib/tools/test_session_runner_properties.py:235
↓ 2 callers
Method
waited_on
(self, session: FakeSession, state: CallState)
tests/lib/tools/test_session_runner_properties.py:204
↓ 2 callers
Method
waits_for_result
(self)
tests/lib/environments/_fake_work_api.py:209
↓ 2 callers
Method
was_terminated
(self, session: FakeSession, id: str)
tests/lib/tools/test_session_runner_properties.py:228
↓ 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
with_item_token
(client: ClientT, item: BetaSelfHostedWork)
src/anthropic/lib/environments/_poller.py:330
↓ 2 callers
Method
within_limits
(self, session: FakeSession, running: set[str], id: str)
tests/lib/tools/test_session_runner_properties.py:292
↓ 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:84
↓ 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:355
↓ 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:359
↓ 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:156
↓ 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, **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:143
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:315
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:139
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:304
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:169
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:341
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:160
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:325
↓ 1 callers
Method
_accepts_heartbeat
(self, item: Item, expected: str | None, token: Token | None)
tests/lib/environments/_fake_work_api.py:449
↓ 1 callers
Method
_act_on_view
(self)
src/anthropic/lib/tools/_beta_session_runner.py:535
↓ 1 callers
Function
_add
(tag: str | None)
src/anthropic/lib/_stainless_helpers.py:125
↓ 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
Method
_apply_call
(self, ev: DispatchedToolUseEvent)
src/anthropic/lib/tools/_beta_session_runner.py:778
↓ 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
Method
_apply_result
(self, id: str)
src/anthropic/lib/tools/_beta_session_runner.py:786
↓ 1 callers
Method
_apply_session_idle
(self, ev: BetaManagedAgentsSessionStatusIdleEvent, seen_at: float)
src/anthropic/lib/tools/_beta_session_runner.py:791
↓ 1 callers
Method
_apply_thread_idle_or_terminated
( self, ev: BetaManagedAgentsSessionThreadStatusIdleEvent | BetaManagedAgentsSessionThreadStat
src/anthropic/lib/tools/_beta_session_runner.py:806
↓ 1 callers
Method
_apply_thread_status
(self, thread: str, *, terminated: bool)
src/anthropic/lib/tools/_beta_session_runner.py:802
↓ 1 callers
Function
_apply_tool_change
Apply a single `tool_removal` / `tool_addition` block to `available`.
src/anthropic/lib/tools/_tool_dispatch.py:216
↓ 1 callers
Function
_apply_tool_reference_change
Fold one `tool_removal` / `tool_addition` block into `available`.
src/anthropic/lib/tools/_tool_dispatch.py:227
↓ 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:128
↓ 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_client_that_changes_authorization
(login: _RevocableLogin, changed_by: str)
tests/lib/test_credentials.py:3529
↓ 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:3877
↓ 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
← previous
next →
1,301–1,400 of 13,873, ranked by callers