Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,274 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,274
◇
Types & classes
3,937
↳
Endpoints
46
Method
test_request_body_that_cannot_be_prepared_has_no_span
(self, spans: Spans, tmp_path: pathlib.Path)
tests/test_open_telemetry.py:1007
Method
test_request_data_prepared_before_prepare_options
( self, respx_mock: MockRouter, client: Anthropic, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
tests/test_client.py:756
Method
test_request_data_prepared_before_prepare_options
( self, respx_mock: MockRouter, async_client: AsyncAnthropic, tmp_path: Path, monkeypatch: pytest.Monk
tests/test_client.py:2192
Method
test_request_does_not_modify_the_options_it_is_given
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:798
Method
test_request_does_not_modify_the_options_it_is_given
( self, respx_mock: MockRouter, async_client: AsyncAnthropic )
tests/test_client.py:2234
Method
test_request_extra_headers
(self, client: Anthropic)
tests/test_client.py:822
Method
test_request_extra_headers
(self, client: Anthropic)
tests/test_client.py:2260
Method
test_request_extra_headers_httpx_headers
(self, client: Anthropic)
tests/test_client.py:844
Method
test_request_extra_headers_httpx_headers
(self, async_client: AsyncAnthropic)
tests/test_client.py:2282
Method
test_request_extra_json
(self, client: Anthropic)
tests/test_client.py:695
Method
test_request_extra_json
(self, client: Anthropic)
tests/test_client.py:2131
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:730
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:2166
Method
test_request_extra_query
(self, client: Anthropic)
tests/test_client.py:926
Method
test_request_extra_query
(self, client: Anthropic)
tests/test_client.py:2364
Method
test_request_id_surfaced_on_error
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1332
Method
test_request_modifications_do_not_persist_across_attempts
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:927
Method
test_request_mutation_changes_outgoing_request
(self, respx_mock: MockRouter)
tests/test_middleware.py:690
Method
test_request_mutation_changes_outgoing_request
(self, respx_mock: MockRouter)
tests/test_middleware.py:1448
Method
test_request_that_sends_a_tools_result_has_the_environment_keys_credentials_alone
( self, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_open_telemetry.py:2458
Method
test_request_that_sends_a_tools_result_has_the_tools_conversation_id
( self, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_open_telemetry.py:2356
Method
test_request_timeout
(self, client: Anthropic)
tests/test_client.py:344
Method
test_request_timeout
(self, async_client: AsyncAnthropic)
tests/test_client.py:1772
Method
test_request_x_stainless_helper_header_appends
(self, client: Anthropic)
tests/test_client.py:857
Method
test_request_x_stainless_helper_header_appends
(self, async_client: AsyncAnthropic)
tests/test_client.py:2295
Method
test_request_x_stainless_helper_header_collapses_case_variants
(self, client: Anthropic)
tests/test_client.py:880
Method
test_request_x_stainless_helper_header_collapses_case_variants
(self, async_client: AsyncAnthropic)
tests/test_client.py:2318
Method
test_request_x_stainless_helper_header_dedupes
(self, client: Anthropic)
tests/test_client.py:869
Method
test_request_x_stainless_helper_header_dedupes
(self, async_client: AsyncAnthropic)
tests/test_client.py:2307
Method
test_request_x_stainless_helper_header_dedupes_multi_value
(self, client: Anthropic)
tests/test_client.py:895
Method
test_request_x_stainless_helper_header_dedupes_multi_value
(self, async_client: AsyncAnthropic)
tests/test_client.py:2333
Method
test_requests
(self, sync: bool, respx_mock: MockRouter)
tests/lib/test_azure.py:358
Method
test_requests_carry_the_trace_context_by_default
( self, provider: str, sync: bool, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:4148
Function
test_requires_action_idle_does_not_end_iteration
(in_history: bool)
tests/lib/tools/test_session_runner.py:1274
Method
test_rereads_on_each_call
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:224
Function
test_resolvable_profile_cannot_leak
( respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch, profile_config_dir: pathlib.Path )
tests/lib/test_google_cloud.py:1254
Function
test_resolvable_profile_cannot_leak_async
( respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch, profile_config_dir: pathlib.Path )
tests/lib/test_google_cloud.py:1280
Function
test_resolve_path
(tmp_path: Path, description: str, p: str, expect_error: bool)
tests/lib/tools/test_agent_toolset.py:49
Function
test_resolve_path_absolute_inside_workdir
An absolute path that canonicalises inside the workdir is permitted in confined mode — the containment check is what guards the jail, not the
tests/lib/tools/test_agent_toolset.py:64
Function
test_resolve_path_allowed_roots
A path inside an allowed root resolves; one outside the workdir and every allowed root is refused, and the refusal names no internal options.
tests/lib/tools/test_agent_toolset.py:146
Function
test_resolve_path_dotdot_is_lexical_before_symlinks
`a/../b` never touches `a`, so a cycle at `a` cannot carry `b` past the containment check on any interpreter.
tests/lib/tools/test_agent_toolset.py:122
Function
test_resolve_path_rejects_symlink_escape_live_and_dangling
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:137
Function
test_resolve_path_rejects_symlink_loop
(tmp_path: Path, p: str)
tests/lib/tools/test_agent_toolset.py:109
Function
test_resolve_path_segment_aware_sibling
A sibling directory sharing a prefix (workdir vs workdir2) must not satisfy the jail.
tests/lib/tools/test_agent_toolset.py:177
Function
test_resolve_path_symlink_out_of_allowed_root_is_rejected
Symlinks are canonicalised before the containment check, so a link inside an allowed root cannot reach outside it.
tests/lib/tools/test_agent_toolset.py:162
Method
test_resource_link_unsupported
(self)
tests/lib/tools/test_mcp_tool.py:142
Function
test_response_basemodel_request_id
(client: Anthropic)
tests/test_response.py:159
Function
test_response_parse_annotated_type
(client: Anthropic)
tests/test_response.py:202
Function
test_response_parse_bool
(client: Anthropic, content: str, expected: bool)
tests/test_response.py:247
Function
test_response_parse_custom_model
(client: Anthropic)
tests/test_response.py:128
Function
test_response_parse_custom_stream
(client: Anthropic)
tests/test_response.py:94
Function
test_response_parse_expect_model_union_non_json_content
(client: Anthropic)
tests/test_response.py:291
Function
test_response_parse_json_content_type_case_insensitive
(client: Anthropic)
tests/test_response.py:354
Function
test_response_parse_mismatched_basemodel
(client: Anthropic)
tests/test_response.py:59
Function
test_response_parse_pep604_union
(client: Anthropic)
tests/test_response.py:323
Method
test_response_wrapper_cast_to_is_returned_unparsed
(self, respx_mock: MockRouter)
tests/test_middleware.py:1117
Method
test_response_wrapper_cast_to_is_returned_unparsed
(self, respx_mock: MockRouter)
tests/test_middleware.py:1640
Function
test_result_block_list_types_all_keep_their_fields_or_only_their_type
( blocks: tuple[Any, ...], keep_their_fields: set[str] )
tests/test_open_telemetry.py:8460
Function
test_result_is_not_posted_when_thread_terminates_while_tool_runs
When a thread terminates while its tool runs, the runner posts no result and yields the call with `posted=False`. The approved call of the same th
tests/lib/tools/test_session_runner.py:1486
Function
test_result_kinds_and_confirmation_texts
()
tests/lib/tools/toolsets/test_computer_registry.py:63
Function
test_result_kinds_confirmations_and_default_flags_match_the_published_toolset
()
tests/lib/tools/toolsets/test_registry.py:48
Method
test_resume_stream_that_ends_before_any_content_keeps_the_paused_reply_resumable
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:359
Method
test_resume_stream_that_ends_mid_text_keeps_the_paused_reply_resumable
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1776
Method
test_resume_that_finds_the_thread_gone_replays_the_history_ending_in_the_paused_reply
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:379
Method
test_resuming_after_a_break_continues_the_span
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:928
Method
test_resuming_after_an_async_break_continues_the_span
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:1119
Function
test_retries
(respx_mock: MockRouter)
tests/lib/test_aws.py:511
Method
test_retries_a_refusal_with_the_fallback_params_and_credit_token
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:133
Method
test_retries_a_refusal_with_the_fallback_params_and_credit_token
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:748
Method
test_retries_once_on_401_from_token_endpoint
If the provider raises a 401 WorkloadIdentityError, the cache retries once.
tests/lib/test_credentials.py:1728
Method
test_retries_taken
( self, client: Anthropic, failures_before_success: int, failure_mode: Literal
tests/test_client.py:1349
Method
test_retries_taken
( self, async_client: AsyncAnthropic, failures_before_success: int, failure_mo
tests/test_client.py:2800
Method
test_retries_taken_defaults_to_zero_and_copy_preserves_it
(self)
tests/test_middleware.py:432
Method
test_retry_on_401_still_fails_raises
If both attempts return 401, the second error propagates.
tests/lib/test_credentials.py:1761
Method
test_retry_with_modified_params_on_request_too_large
(self, respx_mock: MockRouter)
tests/test_middleware.py:735
Method
test_retryable_error_is_retried_then_propagates
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:844
Method
test_retryable_error_is_retried_then_propagates
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:1774
Method
test_retrying_status_errors_doesnt_leak
( self, respx_mock: MockRouter, client: Anthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:1326
Method
test_retrying_status_errors_doesnt_leak
( self, respx_mock: MockRouter, async_client: AsyncAnthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:2777
Method
test_retrying_timeout_errors_doesnt_leak
( self, respx_mock: MockRouter, client: Anthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:1304
Method
test_retrying_timeout_errors_doesnt_leak
( self, respx_mock: MockRouter, async_client: AsyncAnthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:2755
Method
test_returned_error_response_raises_typed_error_for_caller
( self, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/test_middleware.py:901
Function
test_returns_a_new_snapshot_and_does_not_mutate_the_input
()
tests/lib/sessions/test_accumulate.py:117
Method
test_returns_arg_when_provided
(self)
tests/lib/test_aws_auth.py:223
Method
test_returns_arg_when_provided
(self)
tests/lib/test_aws_auth.py:285
Method
test_returns_arg_when_provided
(self)
tests/lib/test_aws_auth.py:316
Method
test_returns_arg_when_provided
(self)
tests/lib/test_aws_auth.py:379
Method
test_returns_authorization_and_date_headers
(self)
tests/lib/test_aws_auth.py:473
Method
test_returns_aws_default_region_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:292
Method
test_returns_aws_region_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:288
Method
test_returns_env_when_no_arg
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:319
Method
test_returns_env_when_no_arg
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:382
Method
test_returns_env_when_not_sigv4
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:229
Method
test_returns_none_for_sigv4
(self)
tests/lib/test_aws_auth.py:226
Method
test_returns_none_when_no_source
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:306
Method
test_returns_none_when_no_source
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:323
Method
test_returns_none_when_no_source
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:390
Method
test_returns_none_when_not_sigv4_and_no_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:233
Method
test_returns_the_final_refusal_once_the_chain_is_exhausted
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:315
Method
test_returns_token
(self)
tests/lib/test_credentials.py:206
← previous
next →
9,701–9,800 of 12,274, ranked by callers