Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,795 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,795
◇
Types & classes
4,264
↳
Endpoints
47
Function
test_every_member_is_enabled_by_default
()
tests/lib/tools/toolsets/test_computer_registry.py:40
Function
test_every_pure_action_has_confirmation_text_and_tab_members_render_state_only
()
tests/lib/tools/toolsets/test_registry.py:82
Method
test_every_request_names_the_thread_in_the_helper_telemetry_header
( self, respx_mock: MockRouter, method: str )
tests/lib/threads/test_beta_threads.py:229
Method
test_every_request_names_the_thread_in_the_helper_telemetry_header
( self, respx_mock: MockRouter, method: str )
tests/lib/threads/test_async_beta_threads.py:109
Function
test_every_state_change_kind_is_either_tab_opened_or_a_download_kind
A new change kind with a `url` in the generated union must be added to DOWNLOAD_TYPES, or the SDK neither bounds its `url` nor checks its `path` a
tests/lib/tools/toolsets/test_registry.py:123
Function
test_every_stop_reason_is_classified
()
tests/lib/tools/test_runners.py:774
Method
test_every_turn_and_a_thread_built_from_params_send_the_output_config_given_at_creation
( self, respx_mock: MockRouter, fields: dict[str, Any] )
tests/lib/threads/test_beta_threads.py:1467
Method
test_every_turn_drops_the_cache_markers_of_the_recorded_messages_once_unthreaded
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:983
Method
test_every_turn_sends_the_threads_beta_once_after_the_callers_betas
( self, respx_mock: MockRouter, betas: list[Any], expected: list[str] )
tests/lib/threads/test_beta_threads.py:182
Method
test_exchange
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1107
Method
test_exchange_federation_assertion_helper
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1202
Method
test_exchange_federation_assertion_http_rejected
(self)
tests/lib/test_credentials.py:1276
Function
test_execute_dispatches_to_the_member_method_and_refuses_unknown_names
()
tests/lib/tools/toolsets/test_interface.py:220
Function
test_execute_dispatches_to_the_member_method_and_refuses_unknown_names
()
tests/lib/tools/toolsets/test_computer_interface.py:136
Function
test_existing_text_index_appends
()
tests/lib/sessions/test_accumulate.py:78
Method
test_expired_but_nonzero_expiry_keeps_single_flight
Only exactly `expires_at=0` opts out of single-flight; any other past value is an expired token.
tests/lib/test_credentials.py:1811
Function
test_expired_credentials_refreshed
(respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:514
Method
test_expired_is_mandatory
(self)
tests/lib/test_credentials.py:1709
Function
test_explicit_aws_creds_suppress_env_api_key
Explicit SigV4 constructor args should suppress ANTHROPIC_AWS_API_KEY env var.
tests/lib/test_aws.py:336
Method
test_explicit_base_url_needs_no_location
(self)
tests/lib/test_google_cloud.py:126
Method
test_explicit_base_url_needs_no_workspace
(self)
tests/lib/test_google_cloud.py:345
Method
test_explicit_base_url_needs_no_workspace
(self)
tests/lib/test_google_cloud.py:1307
Method
test_explicit_base_url_takes_every_route
(self, respx_mock: MockRouter)
tests/lib/test_google_cloud.py:1594
Method
test_explicit_base_url_takes_every_route
(self, respx_mock: MockRouter)
tests/lib/test_google_cloud.py:1753
Method
test_explicit_config_beats_env_api_key
Explicit `config=` is step 1 and beats env `ANTHROPIC_API_KEY` (step 2). The env api_key is ignored entirely and the config-derived cr
tests/lib/test_credentials.py:3055
Method
test_explicit_config_beats_env_api_key
Explicit `config=` is also step 1 and beats env api_key.
tests/lib/test_credentials.py:4300
Function
test_explicit_credential_suppresses_adc
( respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch, kwarg: dict[str, Any] )
tests/lib/test_google_cloud.py:570
Function
test_explicit_credential_suppresses_adc_async
( respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_google_cloud.py:591
Method
test_explicit_credentials_beats_env_api_key
Per spec, explicit `credentials=` is step 1 and beats env `ANTHROPIC_API_KEY` (step 2). The credentials provider wins, env api_key is
tests/lib/test_credentials.py:4271
Method
test_explicit_credentials_beats_env_auth_token
( self, clean_env: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/test_credentials.py:4288
Method
test_explicit_creds_returns_true
(self)
tests/lib/test_aws_auth.py:52
Method
test_explicit_creds_suppress_env_api_key
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:109
Method
test_explicit_location_arg_beats_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:326
Method
test_explicit_profile
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:1027
Method
test_explicit_profile_beats_env_api_key
Explicit `profile=` is a constructor argument and beats env `ANTHROPIC_API_KEY` — the env var is not consulted.
tests/lib/test_credentials.py:3091
Method
test_explicit_profile_beats_env_federation
Step 3 (ANTHROPIC_PROFILE) sits above step 4 (env federation). An explicit profile selection wins over a federation-configured environ
tests/lib/test_credentials.py:2360
Method
test_explicit_project_arg_beats_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:312
Method
test_exposes_configured_middleware
(self)
tests/test_middleware.py:1889
Method
test_external
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:275
Method
test_external_missing_credentials_file
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:300
Method
test_external_no_expiry
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:286
Method
test_external_rereads_credentials_on_each_call
An external process rotates the credentials file; config stays fixed.
tests/lib/test_credentials.py:290
Function
test_extra_body_anthropic_version_wins
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:372
Method
test_extra_body_anthropic_version_wins
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:211
Method
test_extra_body_anthropic_version_wins
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:730
Function
test_extra_body_anthropic_version_wins_async
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:390
Function
test_extra_body_is_merged_in
(send: Send)
tests/test_prepare.py:222
Method
test_extra_body_value_wins
(self, client: AnthropicBedrockMantle, respx_mock: MockRouter)
tests/lib/test_bedrock_mantle.py:741
Method
test_extra_headers_case_insensitive
(self, client: Anthropic)
tests/test_client.py:636
Method
test_extra_headers_case_insensitive
(self, async_client: AsyncAnthropic)
tests/test_client.py:2087
Method
test_extra_headers_omit_removes_default_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:131
Method
test_extra_headers_omit_removes_sdk_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:139
Method
test_extra_headers_replace_default_headers_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:71
Method
test_extra_headers_replace_generated_header_param_case_insensitively
(self)
tests/test_header_case_sensitivity.py:78
Method
test_extra_headers_replace_sdk_header_case_insensitively
(self, client_cls: ClientClass)
tests/test_header_case_sensitivity.py:92
Method
test_extra_headers_value_is_sent_in_body
(self, client: AnthropicBedrockMantle, respx_mock: MockRouter)
tests/lib/test_bedrock_mantle.py:751
Function
test_extra_properties
()
tests/test_models.py:1054
Method
test_extra_query_iterator_survives_pagination
( self, respx_mock: MockRouter, client: Anthropic | AsyncAnthropic )
tests/test_prepare.py:835
Function
test_extra_query_omit_removes_default_query
(send: Send)
tests/test_prepare.py:520
Function
test_extract_drops_setuid_setgid_sticky
(make: ArchiveModeMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:259
Method
test_extract_files_does_not_mutate_original_nested_array_path
(self)
tests/test_files.py:175
Method
test_extract_files_does_not_mutate_original_top_level
(self)
tests/test_files.py:164
Function
test_extract_flat_archive_unchanged
(make: ArchiveMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:183
Function
test_extract_refuses_zip_slip
(tmp_path: Path)
tests/lib/tools/test_skills.py:192
Function
test_extract_response_type_binary_response
()
tests/test_response.py:51
Function
test_extract_response_type_concrete_subclasses
()
tests/test_response.py:45
Function
test_extract_response_type_direct_class_missing_type_arg
()
tests/test_response.py:37
Function
test_extract_response_type_direct_classes
()
tests/test_response.py:31
Function
test_extract_strips_skill_wrapper_dir
(make: ArchiveMaker, tmp_path: Path)
tests/lib/tools/test_skills.py:164
Function
test_extract_type_var
()
tests/test_utils/test_typing.py:27
Function
test_extract_type_var_generic_subclass
()
tests/test_utils/test_typing.py:38
Function
test_extract_type_var_generic_subclass_different_ordering_multiple
()
tests/test_utils/test_typing.py:67
Function
test_extract_type_var_generic_subclass_multiple
()
tests/test_utils/test_typing.py:58
Function
test_extract_type_var_multiple
()
tests/test_utils/test_typing.py:49
Method
test_failed_call_ends_the_loop_with_its_error
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:891
Function
test_failed_compaction_request_is_not_retried_and_frees_the_messages_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3191
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:5172
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
← previous
next →
6,401–6,500 of 12,795, ranked by callers