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
Function
test_without_the_option_the_tools_run_again_after_append_messages_as_before
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:202
Function
test_without_the_option_there_is_nothing_to_defer
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:190
Function
test_work_resource_worker_and_poller_async_only
`worker()` / `poller()` build an async-only `EnvironmentWorker` / `aiter_work` generator, so they live on `AsyncWork` and are NOT exposed on t
tests/lib/environments/test_worker.py:956
Function
test_work_resource_worker_builds_environment_worker
`client.beta.environments.work.worker(...)` builds an `EnvironmentWorker` bound to the client, with the options threaded through (mirrors `poller`
tests/lib/environments/test_worker.py:907
Function
test_work_resource_worker_defaults
()
tests/lib/environments/test_worker.py:942
Function
test_worker_can_turn_sync_deletions_off
`memory_sync_deletions="disabled"` reaches the stores: a local deletion never propagates however many syncs run, while uploads still do.
tests/lib/tools/memory_sync/test_e2e_memory.py:457
Function
test_worker_clean_end_syncs_once_and_the_flush_adds_nothing
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_e2e_memory.py:278
Function
test_worker_fails_the_item_when_a_memory_store_cannot_be_downloaded
A folder already at the store's path is debris from a run that died. The download refuses it and the ITEM fails — rather than serving a session wh
tests/lib/tools/memory_sync/test_e2e_memory.py:210
Function
test_worker_fails_the_item_when_the_sessions_token_is_missing
The session has memory stores attached but the work item carried no sessions token, so its memories cannot be mounted. The ITEM fails before a
tests/lib/tools/memory_sync/test_e2e_memory.py:165
Function
test_worker_final_sync_is_bounded_and_the_flush_still_runs
A final sync that hangs is cut off at MEMORY_FLUSH_TIMEOUT and says so; the flush after it still uploads the last edit.
tests/lib/tools/memory_sync/test_e2e_memory.py:370
Function
test_worker_flush_is_bounded_and_teardown_still_runs
A flush that hangs is cut off at MEMORY_FLUSH_TIMEOUT and says so; dispose still runs.
tests/lib/tools/memory_sync/test_e2e_memory.py:334
Function
test_worker_flushes_after_a_clean_final_sync_that_failed
sync() swallows its own failures, so a clean stream end whose final sync broke would silently lose the last edits — the teardown flush is thei
tests/lib/tools/memory_sync/test_e2e_memory.py:310
Function
test_worker_flushes_and_disposes_even_when_env_teardown_raises
A raising env.__aexit__ must not skip the flush or leave the folder behind for the next work item to trip over.
tests/lib/tools/memory_sync/test_e2e_memory.py:487
Function
test_worker_flushes_writes_when_the_stream_raises
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_e2e_memory.py:236
Function
test_worker_grants_file_tools_access_to_store_folders
The tool context handed to the tools factory carries the downloaded store folders as allowed roots, so the file tools can reach a memory mount
tests/lib/tools/memory_sync/test_e2e_memory.py:581
Function
test_worker_lifecycle_cadence_and_dispose
The worker's call sequence: download → sync_if_due per call → finish → dispose.
tests/lib/tools/memory_sync/test_memory_sync.py:163
Function
test_worker_logs_what_a_cut_off_flush_left_behind
One upload never completes: the flush is cut off, the store logs that one of its two changed files did not make it, and the other one did.
tests/lib/tools/memory_sync/test_e2e_memory.py:401
Function
test_worker_rejects_a_sub_floor_interval
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/memory_sync/test_e2e_memory.py:203
Function
test_worker_skips_memory_when_the_interval_is_none
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_e2e_memory.py:188
Function
test_worker_stays_quiet_when_no_memory_store_is_attached
Most sessions have no memory at all. Missing a sessions token is only worth shouting about when there is memory the session cannot reach.
tests/lib/tools/memory_sync/test_e2e_memory.py:441
Function
test_worker_syncs_on_cadence_finishes_and_disposes
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/memory_sync/test_e2e_memory.py:135
Function
test_worker_threads_extra_headers_into_poll_heartbeat_stop_and_runner
A worker-level `extra_headers` is threaded, unchanged, into every per-request call the worker drives: the poll loop (forwarded to `aiter_work`
tests/lib/environments/test_worker.py:851
Method
test_workload_delegate_borrows_parent_http_client
The workload delegate must borrow CredentialsFile's owned httpx2.Client rather than creating its own. CredentialsFile.close() then has a singl
tests/lib/test_credentials.py:562
Method
test_workload_identity_disk_cache_corrupt_expires_at_reexchange
A non-numeric expires_at in the on-disk credentials file falls through to re-exchange instead of raising.
tests/lib/test_credentials.py:529
Method
test_workload_identity_disk_cache_stale_reexchange
A stale on-disk credentials file is ignored — fresh exchange happens and the file is rewritten.
tests/lib/test_credentials.py:501
Method
test_workload_identity_dispatch
(self, respx_mock: MockRouter, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:340
Method
test_workload_identity_error_body_redacted
(self)
tests/lib/test_credentials.py:935
Method
test_workload_identity_error_propagates_through_request_flow
A WorkloadIdentityError raised from the credential provider must bubble out of messages.create() as-is, not wrapped in APIConnectionEr
tests/lib/test_credentials.py:2980
Method
test_workload_identity_http_rejected
(self)
tests/lib/test_credentials.py:811
Method
test_workload_identity_inherits_client_base_url
An explicitly-passed WorkloadIdentityCredentials with no `base_url` adopts the client's `base_url` for the token exchange, so the user
tests/lib/test_credentials.py:2357
Method
test_workload_identity_literal_token
(self, clean_env: pytest.MonkeyPatch)
tests/lib/test_credentials.py:2139
Method
test_workload_identity_literal_token_reads_fresh
Fix 4: ANTHROPIC_IDENTITY_TOKEN must be re-read on every provider invocation, not captured into a closure at chain-construction time.
tests/lib/test_credentials.py:2188
Method
test_workload_identity_missing_required_fields
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:554
Method
test_workload_identity_requires_all_three
(self, clean_env: pytest.MonkeyPatch)
tests/lib/test_credentials.py:2203
Method
test_workload_identity_scope_env
(self, clean_env: pytest.MonkeyPatch)
tests/lib/test_credentials.py:2147
Method
test_workload_identity_tier
(self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:2129
Method
test_workload_identity_token_omitted_uses_env
( self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_credentials.py:607
Method
test_workload_identity_unknown_source_raises
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:593
Method
test_workload_identity_workspace_id_env
(self, clean_env: pytest.MonkeyPatch)
tests/lib/test_credentials.py:2157
Method
test_workload_identity_workspace_id_env_empty_treated_unset
`ANTHROPIC_WORKSPACE_ID=""` (a defaulted-but-empty CI variable) is treated as unset — never put `"workspace_id": ""` on the wire.
tests/lib/test_credentials.py:2169
Method
test_workspace_id_default_sentinel
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1113
Function
test_workspace_id_header
(respx_mock: MockRouter, request_workspace_id: Optional[str], expected: str)
tests/lib/test_aws.py:452
Function
test_workspace_id_header_async
( respx_mock: MockRouter, request_workspace_id: Optional[str], expected: str )
tests/lib/test_aws.py:476
Method
test_workspace_id_header_from_config
workspace_id in the config file → anthropic-workspace-id header on API requests.
tests/lib/test_credentials.py:2575
Method
test_workspace_id_header_from_config
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:3206
Method
test_workspace_id_included
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1100
Method
test_workspace_required
(self)
tests/lib/test_google_cloud.py:156
Method
test_workspace_required
(self)
tests/lib/test_google_cloud.py:1062
Function
test_write_and_edit_tools_refuse_read_only_roots
(tmp_path: Path)
tests/lib/tools/memory_sync/test_memory_sync.py:199
Function
test_write_creates_deeply_nested_missing_directories
Missing path components are not symlink hops, so any depth is allowed.
tests/lib/tools/test_agent_toolset.py:848
Function
test_write_preserves_content_bytes
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:277
Function
test_write_text_exact_writes_verbatim
(tmp_path: Path)
tests/lib/tools/test_files.py:15
Function
test_write_through_dangling_symlink_inside_workdir
A dangling link whose target is inside the workdir is followed: the target and its missing parent directory are created.
tests/lib/tools/test_agent_toolset.py:827
Function
test_write_under_symlink_loop_creates_nothing
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:816
Method
test_wrong_decorator_raises
(self)
tests/lib/tools/test_functions.py:534
Function
test_yields_completed_custom_tool_call
A CUSTOM (user-defined) tool call arrives as `agent.custom_tool_use` and must be answered with `user.custom_tool_result` — keyed by `custom_to
tests/lib/tools/test_session_runner.py:427
Function
test_yields_completed_tool_call
()
tests/lib/tools/test_session_runner.py:309
Function
test_yields_error_for_failing_tool
()
tests/lib/tools/test_session_runner.py:369
Function
test_yields_the_stream_that_messages_stream_returns
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:229
Function
test_yields_with_posted_false_on_permanent_4xx
A permanent 4xx (e.g. 400) on send should short-circuit the retry loop after a single attempt and still yield with posted=False.
tests/lib/tools/test_session_runner.py:1431
Function
test_yields_with_posted_false_on_retry_window_exhaust
If `events.send` keeps failing for the whole retry window, the consumer should still receive the `DispatchedToolCall` with `posted=False` so t
tests/lib/tools/test_session_runner.py:1366
Method
test_zero_arg_provider_backward_compat
Providers from before the force_refresh kwarg was added (the old `Callable[[], AccessToken]` shape) must still work — their signature
tests/lib/test_credentials.py:1869
Method
test_zero_arg_provider_behind_a_decorator_or_call_method
`inspect.signature` follows `functools.wraps`, so it sees that the wrapped function takes no arguments.
tests/lib/test_credentials.py:3579
Method
test_zero_config_credentials_file_from_env
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:2499
Method
test_zero_config_workload_identity_from_env
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:2475
Method
test_zero_expiry_token_is_not_reused
A token with `expires_at=0` is not reused, so the provider is called again until it returns a later expiry.
tests/lib/test_credentials.py:1775
Method
test_zero_expiry_token_is_not_reused
(self)
tests/lib/test_credentials.py:3727
Method
test_zero_expiry_tokens_are_fetched_concurrently
Callers don't queue behind each other for a token that can't be shared.
tests/lib/test_credentials.py:1785
Method
test_zero_expiry_tokens_are_fetched_concurrently
Requests don't queue behind each other for a token that can't be shared.
tests/lib/test_credentials.py:3739
Function
test_zip_entries_without_type_bits_are_regular_files
(tmp_path: Path)
tests/lib/tools/test_skills.py:341
Function
test_zip_non_unix_host_type_bits_are_plain_data
Only a Unix creator host makes `external_attr` a mode; the same bits from a FAT/NTFS archiver describe an ordinary file.
tests/lib/tools/test_skills.py:299
Function
test_zip_preserves_executable_bit
(tmp_path: Path)
tests/lib/tools/test_skills.py:176
Function
test_zip_unix_directory_bits_without_trailing_slash_make_a_directory
(tmp_path: Path)
tests/lib/tools/test_skills.py:353
Function
test_zip_unix_special_entries_are_skipped_not_written_as_files
(tmp_path: Path)
tests/lib/tools/test_skills.py:280
Function
test_zip_without_unix_attrs_is_not_executable
(tmp_path: Path)
tests/lib/tools/test_skills.py:196
Method
text
Read and decode the response content into a string.
src/anthropic/_response.py:371
Method
text
Read and decode the response content into a string.
src/anthropic/_response.py:482
Method
thread_a
()
tests/lib/test_refusal_fallback.py:784
Method
thread_b
()
tests/lib/test_refusal_fallback.py:795
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:68
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:582
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:1118
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:1154
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:1190
Method
threads
(self)
src/anthropic/resources/beta/sessions/sessions.py:1226
Method
timeout
(self)
src/anthropic/_request.py:62
Method
timeout
(self)
src/anthropic/_base_client.py:757
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:93
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:206
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_functions.py:191
Method
to_dict
The `tools[]` entry to send. SDK-side behaviour options never appear here.
src/anthropic/lib/tools/_toolsets/_runnable.py:96
Method
to_dict
(self)
tests/lib/tools/toolsets/_stubs.py:76
Method
to_param
Convert this response BetaMessage to a BetaMessageParam so it can be passed back to the API as an input message, e.g. in the `messages` param.
src/anthropic/types/beta/beta_message.py:173
Function
to_tool_params
Replace every `to_dict()`-bearing object in `tools` with its entry, keeping order and helper tags.
src/anthropic/lib/tools/_tool_params.py:31
Method
token_provider
()
tests/lib/test_azure.py:33
Method
token_provider
()
tests/lib/test_azure.py:214
Method
token_provider
()
tests/lib/test_azure.py:263
Method
tool_result
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_toolsets/_runnable.py:181
Method
tool_runner
Dispatch a self-hosted session's tool-call events. The sessions-side counterpart to `client.beta.messages.tool_runner`: returns a `an
src/anthropic/resources/beta/sessions/events.py:559
Method
tool_runner
( self, *, max_tokens: int, messages: Iterable[BetaMessageParam], mode
src/anthropic/resources/beta/messages/messages.py:3342
← previous
next →
8,701–8,800 of 9,455, ranked by callers