Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,824 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,824
◇
Types & classes
4,274
↳
Endpoints
47
Function
test_failed_compaction_request_is_not_retried_and_frees_the_messages_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3170
Method
test_failed_create_has_no_id
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7458
Method
test_failed_replay_clears_previous_message_id
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:752
Method
test_failed_send_lets_the_next_send_run
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1574
Method
test_failed_send_lets_the_next_send_run
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:385
Function
test_failed_skill_keeps_the_directory_it_would_have_replaced
( tmp_path: Path, async_client: AsyncAnthropic, respx_mock: MockRouter, failing_download: httpx2.Response
tests/lib/tools/test_skills.py:497
Method
test_failed_streamed_call_ends_the_loop_with_its_error
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:908
Method
test_failed_writeback_after_refresh_does_not_retain_tokens
A refresh that succeeds but fails to persist raises the write error (the refresh token may have rotated server-side) — but the propagating
tests/lib/test_credentials.py:5497
Method
test_fallback_credit_usage_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:638
Method
test_fallback_credit_usage_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:960
Method
test_fallback_on_overloaded_error
(self, respx_mock: MockRouter)
tests/test_middleware.py:710
Method
test_fallback_on_overloaded_error
(self, respx_mock: MockRouter)
tests/test_middleware.py:1467
Method
test_fallback_relabels_model
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:623
Method
test_fallback_relabels_model
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:944
Method
test_fallback_retry_sees_identical_request_state
(self, respx_mock: MockRouter)
tests/test_middleware.py:1137
Method
test_fallback_retry_sees_identical_request_state
(self, respx_mock: MockRouter)
tests/test_middleware.py:1660
Method
test_falls_back_to_aws_api_key_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:145
Method
test_false_keeps_a_span_that_the_sampler_dropped_current_for_the_requests
( self, sync: bool, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_open_telemetry.py:4199
Method
test_false_sends_no_trace_context_and_keeps_the_span
( self, provider: str, sync: bool, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPat
tests/test_open_telemetry.py:4170
Function
test_family_or_type_named_block_without_toolset_name_is_not_a_member_call
( client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, flavour: str )
tests/lib/tools/toolsets/test_runner.py:328
Function
test_field_named_cls
()
tests/test_models.py:967
Method
test_file_input_is_read_when_the_stream_is_entered
( self, respx_mock: MockRouter, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/streaming/test_messages.py:515
Method
test_file_input_is_read_when_the_stream_is_entered
( self, respx_mock: MockRouter, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/streaming/test_beta_messages.py:694
Method
test_file_input_markers
(self, respx_mock: MockRouter, client: Anthropic | AsyncAnthropic)
tests/test_prepare.py:793
Function
test_file_objects_must_read_as_bytes
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:661
Function
test_file_tools_confinement_matrix
The full path policy through the real tools: the workdir works, a memory folder mounted outside it works, a read-only memory folder reads but
tests/lib/tools/test_agent_toolset.py:1215
Method
test_file_upload_tag_is_appended_not_clobbered
(self, client: Anthropic, respx_mock: respx.MockRouter)
tests/lib/test_stainless_helpers.py:85
Method
test_file_upload_tag_is_appended_not_clobbered
( self, async_client: AsyncAnthropic, respx_mock: respx.MockRouter )
tests/lib/test_stainless_helpers.py:184
Method
test_file_upload_with_request_copying_middleware
(self, respx_mock: MockRouter, tmp_path: Path)
tests/test_middleware.py:1210
Method
test_file_value_is_same_reference
(self)
tests/test_files.py:121
Function
test_file_without_a_name_is_sent_unnamed
()
tests/test_files.py:88
Function
test_files_without_a_marker_are_neither_pushed_nor_pulled_over
Only the marker was deleted (a dotfile cleanup): the remaining files may hold un-pushed edits, so the pass must neither upload them, nor delete by
tests/lib/tools/memory_sync/test_folder_trust.py:149
Function
test_filestore_async_with_removes_root_only_if_created
(tmp_path: Path)
tests/lib/tools/test_file_store.py:333
Function
test_filestore_create_root_makes_the_folder_owner_only
(tmp_path: Path)
tests/lib/tools/test_file_store.py:507
Function
test_filestore_creates_every_parent_owner_only_under_permissive_umask
Every directory the store creates — including intermediate parents, which `mkdir(parents=True, mode=...)` would leave at the umask default — is 0o
tests/lib/tools/test_file_store.py:72
Function
test_filestore_dispose_removes_the_root_it_created_and_keeps_preexisting
(tmp_path: Path)
tests/lib/tools/test_file_store.py:347
Function
test_filestore_every_verb_refuses_an_escaping_path
`..` (and absolute) paths raise FileStoreError on every verb; nothing is read or written outside the root.
tests/lib/tools/test_file_store.py:88
Function
test_filestore_find_symlinks_reports_every_symlink
Listings skip symlinks silently; `find_symlinks` is how a caller sees them.
tests/lib/tools/test_file_store.py:177
Function
test_filestore_get_does_not_follow_a_symlink_leaf
A symlink at the target is refused on read and replaced — not written through — on put.
tests/lib/tools/test_file_store.py:117
Function
test_filestore_get_refuses_a_non_regular_file
A present-but-non-regular leaf (fifo, symlink, ...) raises FileStoreError instead of hanging or being read.
tests/lib/tools/test_file_store.py:132
Function
test_filestore_get_returns_none_when_absent
(store: FileStore)
tests/lib/tools/test_file_store.py:152
Function
test_filestore_hash_file_hashes_one_file_and_shares_the_cache
( store: FileStore, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_file_store.py:241
Function
test_filestore_hashtree_distrusts_fresh_stamps
Filesystems stamp times with coarse clocks, so a same-tick rewrite can reuse the exact stat identity of the version just hashed. A file whose
tests/lib/tools/test_file_store.py:461
Function
test_filestore_hashtree_hashes_regular_files_and_skips_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:196
Function
test_filestore_hashtree_refuses_a_symlinked_prefix
A prefix that is a symlink (here to a directory outside the root) is refused, not silently listed as empty.
tests/lib/tools/test_file_store.py:228
Function
test_filestore_hashtree_rehashes_only_what_changed
A file whose stat identity (mtime, ctime, size) is unchanged since the last walk is served from the cache; a changed file is re-read. The trust
tests/lib/tools/test_file_store.py:419
Function
test_filestore_is_path_legal
()
tests/lib/tools/test_file_store.py:411
Function
test_filestore_listings_raise_on_an_unreadable_subdirectory
An unreadable subdirectory fails the listing rather than dropping out of it.
tests/lib/tools/test_file_store.py:209
Function
test_filestore_ls_lists_recursively_and_never_descends_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:159
Function
test_filestore_move_never_creates_a_missing_root
(store: FileStore)
tests/lib/tools/test_file_store.py:549
Function
test_filestore_move_renames_within_root_and_refuses_existing_dest
(store: FileStore)
tests/lib/tools/test_file_store.py:269
Function
test_filestore_open_raises_on_an_unreadable_mount_path
A mount path the process cannot stat raises at open — it is never read as absent, which would mark a real directory ours to remove on dispose.
tests/lib/tools/test_file_store.py:319
Function
test_filestore_put_executable_sets_owner_exec
(store: FileStore)
tests/lib/tools/test_file_store.py:58
Function
test_filestore_put_is_atomic_and_leaves_no_temp_on_success
(store: FileStore)
tests/lib/tools/test_file_store.py:64
Function
test_filestore_put_never_creates_a_missing_root
Only create_root() makes the folder: a put into a store that was never created, or whose folder was removed, raises and re-creates nothing — not
tests/lib/tools/test_file_store.py:516
Function
test_filestore_put_refuses_a_directory_rel
(store: FileStore, bad: str)
tests/lib/tools/test_file_store.py:376
Function
test_filestore_put_writes_archive_bytes_verbatim
Archive-shaped bytes land as a single byte-identical file — extraction is never inferred from the content.
tests/lib/tools/test_file_store.py:361
Function
test_filestore_put_writes_text_and_creates_owner_only_parents
`put` creates nested parents 0o700 and stores text as UTF-8 (file 0o600).
tests/lib/tools/test_file_store.py:47
Function
test_filestore_remove_deletes_file_and_subtree
(store: FileStore)
tests/lib/tools/test_file_store.py:298
Function
test_filestore_remove_unlinks_a_dangling_symlink
(store: FileStore)
tests/lib/tools/test_file_store.py:310
Function
test_filestore_root_path_is_banned_from_the_interface
A rel_path resolving to the root: put/get refuse, move/remove do nothing.
tests/lib/tools/test_file_store.py:281
Function
test_filestore_utf8_restriction_refuses_binary_content
A store opened with `utf8_only=True` refuses binary content on both verbs that touch it: a put of invalid bytes writes nothing, and a get of a
tests/lib/tools/test_file_store.py:383
Function
test_finish_runs_once_and_a_second_call_raises
(tmp_path: Path)
tests/lib/tools/memory_sync/test_delete_discipline.py:242
Method
test_first_call_fetches
(self)
tests/lib/test_credentials.py:1605
Method
test_first_send_creates_a_thread_with_the_seed_and_the_new_messages
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:115
Function
test_flush_adopts_a_file_the_server_already_holds
A final sync cut off after uploading a file leaves the baseline stale; the flush sees the server already has those bytes and records that inst
tests/lib/tools/memory_sync/test_final_flush.py:172
Function
test_flush_never_pushes_a_read_only_store
(tmp_path: Path)
tests/lib/tools/memory_sync/test_final_flush.py:192
Function
test_flush_never_raises
(tmp_path: Path, caplog: pytest.LogCaptureFixture)
tests/lib/tools/memory_sync/test_final_flush.py:240
Function
test_flush_pushes_new_and_changed_files_and_nothing_else
( tmp_path: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_final_flush.py:37
Function
test_flush_pushes_nothing_when_the_marker_check_fails
( tmp_path: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_final_flush.py:221
Function
test_flush_skips_files_the_server_already_refused
(tmp_path: Path)
tests/lib/tools/memory_sync/test_final_flush.py:205
Function
test_flush_uploads_several_files_at_once_up_to_the_bound
Two uploads are in flight together, and never more than the bound — a serial flush would time out waiting for the second to start.
tests/lib/tools/memory_sync/test_final_flush.py:92
Method
test_follow_redirects
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1571
Method
test_follow_redirects
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:3075
Method
test_follow_redirects_disabled
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1583
Method
test_follow_redirects_disabled
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:3087
Method
test_for_base_url
The first bind (and re-binds to the same host) happen in place; a bind to another host yields a separate provider and leaves the origi
tests/lib/test_credentials.py:1255
Method
test_for_base_url_federation_profile
A second host gets its own provider exchanging there; the original keeps exchanging at the first host, and only the original uses the
tests/lib/test_credentials.py:468
Method
test_for_base_url_http_rejected
(self)
tests/lib/test_credentials.py:1275
Method
test_for_base_url_returns_self_when_bind_is_moot
No per-host provider is made when the bind can't change where the tokens come from: the profile pins its own `base_url`, or it is a us
tests/lib/test_credentials.py:501
Method
test_fork_and_original_continue_independently
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1356
Method
test_fork_and_original_continue_independently
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:181
Method
test_fork_creates_a_thread_with_the_full_history_and_the_same_fields
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1333
Method
test_fork_during_a_turn_has_the_history_that_set_messages_params_replaced_the_threads_with
( self, respx_mock: MockRouter )
tests/lib/threads/test_thread_tool_runner.py:237
Method
test_fork_during_a_turn_has_the_history_that_set_messages_params_replaced_the_threads_with
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:1262
Function
test_fork_during_build_does_not_block_child
()
tests/test_models.py:1232
Method
test_fork_keeps_the_unsupported_request_behavior
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1346
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_it_ahead_of_a_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:1410
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_it_ahead_of_a_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:235
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_the_turn_again_without_it
( self, respx_mock: MockRouter, forks: int, method: str )
tests/lib/threads/test_beta_threads.py:1380
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_the_turn_again_without_it
( self, respx_mock: MockRouter, forks: int, method: str )
tests/lib/threads/test_async_beta_threads.py:205
Method
test_fork_of_a_thread_that_ends_in_a_whole_reply_sends_the_full_history_with_no_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:1423
Method
test_fork_of_a_thread_that_ends_in_a_whole_reply_sends_the_full_history_with_no_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:248
Method
test_fork_returns_a_thread_with_no_previous_message_id_without_a_request
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1321
Function
test_forwards_compat_model_dump_json_method
()
tests/test_models.py:637
Function
test_forwards_compat_model_dump_method
()
tests/test_models.py:573
Method
test_foundry_clients_accept_middleware
(self)
tests/test_middleware.py:2107
Method
test_foundry_runner_threads_by_default
(self, respx_mock: MockRouter)
tests/lib/threads/test_tool_runner_threading.py:860
Method
test_fresh_token_not_refetched
(self)
tests/lib/test_credentials.py:1654
Method
test_full_fixture_tool_wire
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1470
← previous
next →
6,501–6,600 of 12,824, ranked by callers