Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
14,068 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
14,068
◇
Types & classes
4,501
↳
Endpoints
96
Function
test_error_raised_in_a_process_pool_reaches_the_caller
()
tests/test_exceptions.py:104
Method
test_error_response
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:976
Method
test_error_response_without_envelope
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:998
Function
test_error_result_has_the_message_of_the_refusal
(monkeypatch: pytest.MonkeyPatch, body: str, message: str)
tests/lib/tools/test_session_runner.py:1254
Function
test_error_result_is_sent_at_once_and_retried_with_the_backoff_of_a_second_failure
()
tests/lib/tools/test_session_runner.py:1265
Function
test_error_result_shares_the_retry_window_of_the_refused_result
()
tests/lib/tools/test_session_runner.py:1349
Function
test_error_that_is_not_an_api_failure_is_raised_by_the_first_read
()
tests/lib/tools/test_session_runner.py:1488
Function
test_error_type
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, )
tests/test_streaming.py:405
Method
test_error_with_retryable_cause_is_retried
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:1013
Method
test_eu_region_base_url
Test that us region uses the correct base URL.
tests/lib/test_vertex.py:363
Method
test_eu_region_base_url
Test that eu region uses the correct base URL.
tests/lib/test_vertex.py:884
Function
test_event_missing_data
(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
tests/test_streaming.py:71
Function
test_event_start_for_a_non_agent_message_preview_returns_none
()
tests/lib/sessions/test_accumulate.py:69
Function
test_event_start_returns_a_fresh_empty_snapshot_from_none
()
tests/lib/sessions/test_accumulate.py:61
Method
test_event_stream_closed_early
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2278
Method
test_event_stream_ended_by_the_server
(self, spans: Spans, respx_mock: MockRouter, raw: bool)
tests/test_open_telemetry.py:2296
Method
test_event_stream_has_the_ids_in_its_path
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:7616
Method
test_events_read_after_the_response_was_closed_leave_the_span_alone
( self, spans: Spans, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture )
tests/test_open_telemetry.py:1480
Method
test_every_attempt_has_the_qualifiers
( self, client: Anthropic, respx_mock: MockRouter, monkeypatch: pytest.MonkeyP
tests/test_client.py:1591
Method
test_every_attempt_has_the_qualifiers
( self, async_client: AsyncAnthropic, respx_mock: MockRouter, monkeypatch: pyt
tests/test_client.py:3358
Function
test_every_call_to_an_unregistered_family_in_a_turn_says_not_found
( client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, flavour: str )
tests/lib/tools/toolsets/test_runner.py:620
Function
test_every_confirmation_placeholder_has_a_template_field
()
tests/lib/tools/toolsets/test_computer_registry.py:87
Function
test_every_confirmation_placeholder_has_a_template_field
()
tests/lib/tools/toolsets/test_registry.py:115
Function
test_every_constructor_argument_is_covered
(client_class: ClientClass)
tests/lib/test_client_copy.py:241
Function
test_every_documented_name_is_exported
()
tests/lib/tools/toolsets/test_surface.py:47
Function
test_every_documented_name_is_exported
()
tests/lib/tools/toolsets/test_computer_surface.py:42
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
Function
test_every_request_has_the_extra_headers
(tmp_path: Path)
tests/lib/environments/test_worker.py:813
Function
test_every_request_has_the_extra_headers_and_the_stop_names_the_poller_as_its_helper
(sync: bool)
tests/lib/environments/test_poller.py:270
Function
test_every_request_has_the_header
(environment_key: str | None, name: str, value: str)
tests/lib/tools/test_session_runner.py:2153
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:230
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:1468
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:984
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:183
Function
test_exception_that_is_not_an_api_failure_interrupts_iteration_and_propagates_after_cleanup
( steps: list[Step], output: object, error: type[Exception], order: list[str] )
tests/lib/tools/test_session_runner.py:1560
Method
test_exchange
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1112
Method
test_exchange_federation_assertion_helper
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1207
Method
test_exchange_federation_assertion_http_rejected
(self)
tests/lib/test_credentials.py:1281
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:83
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:1816
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:1714
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:3336
Method
test_explicit_config_beats_env_api_key
Explicit `config=` is also step 1 and beats env api_key.
tests/lib/test_credentials.py:4781
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:4752
Method
test_explicit_credentials_beats_env_auth_token
( self, clean_env: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/test_credentials.py:4769
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:1032
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:3372
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:2365
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:2149
Method
test_external
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:280
Method
test_external_missing_credentials_file
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:305
Method
test_external_no_expiry
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:291
Method
test_external_rereads_credentials_on_each_call
An external process rotates the credentials file; config stays fixed.
tests/lib/test_credentials.py:295
Function
test_extra_body_anthropic_version_wins
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:373
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:391
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:663
Method
test_extra_headers_case_insensitive
(self, async_client: AsyncAnthropic)
tests/test_client.py:2413
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:262
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:186
Function
test_extract_refuses_zip_slip
(tmp_path: Path)
tests/lib/tools/test_skills.py:195
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:167
Function
test_extract_type_var
()
tests/test_utils/test_typing.py:27
← previous
next →
7,001–7,100 of 14,068, ranked by callers