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
Method
test_request_extra_json
(self, client: Anthropic)
tests/test_client.py:2185
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:767
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:2220
Method
test_request_extra_query
(self, client: Anthropic)
tests/test_client.py:963
Method
test_request_extra_query
(self, client: Anthropic)
tests/test_client.py:2418
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_query_spaces
(self, client: Anthropic)
tests/test_client.py:1004
Method
test_request_query_spaces
(self, client: Anthropic)
tests/test_client.py:2459
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:381
Method
test_request_timeout
(self, async_client: AsyncAnthropic)
tests/test_client.py:1826
Method
test_request_x_stainless_helper_header_appends
(self, client: Anthropic)
tests/test_client.py:894
Method
test_request_x_stainless_helper_header_appends
(self, async_client: AsyncAnthropic)
tests/test_client.py:2349
Method
test_request_x_stainless_helper_header_collapses_case_variants
(self, client: Anthropic)
tests/test_client.py:917
Method
test_request_x_stainless_helper_header_collapses_case_variants
(self, async_client: AsyncAnthropic)
tests/test_client.py:2372
Method
test_request_x_stainless_helper_header_dedupes
(self, client: Anthropic)
tests/test_client.py:906
Method
test_request_x_stainless_helper_header_dedupes
(self, async_client: AsyncAnthropic)
tests/test_client.py:2361
Method
test_request_x_stainless_helper_header_dedupes_multi_value
(self, client: Anthropic)
tests/test_client.py:932
Method
test_request_x_stainless_helper_header_dedupes_multi_value
(self, async_client: AsyncAnthropic)
tests/test_client.py:2387
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:1403
Method
test_retries_taken
( self, async_client: AsyncAnthropic, failures_before_success: int, failure_mo
tests/test_client.py:2871
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:1380
Method
test_retrying_status_errors_doesnt_leak
( self, respx_mock: MockRouter, async_client: AsyncAnthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:2848
Method
test_retrying_timeout_errors_doesnt_leak
( self, respx_mock: MockRouter, client: Anthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:1358
Method
test_retrying_timeout_errors_doesnt_leak
( self, respx_mock: MockRouter, async_client: AsyncAnthropic, monkeypatch: pytest.MonkeyPatch )
tests/test_client.py:2826
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
Function
test_run_requires_environment_id_and_environment_key
()
tests/lib/environments/test_worker.py:610
Method
test_runner_adds_and_removes_tools_on_the_thread
(self, respx_mock: MockRouter)
tests/lib/threads/test_tool_runner_threading.py:87
Method
test_runner_adds_and_removes_tools_on_the_thread
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:968
Method
test_runner_adds_no_result_for_a_call_the_caller_leaves_unanswered
( self, respx_mock: MockRouter, mode: dict[str, Any] )
tests/lib/threads/test_tool_runner_threading.py:392
Method
test_runner_adds_tool_results_ahead_of_messages_appended_to_the_thread_mid_loop
( self, respx_mock: MockRouter, respond: Any, stream: bool )
tests/lib/threads/test_thread_tool_runner.py:437
Method
test_runner_adds_tool_results_ahead_of_messages_appended_to_the_thread_mid_loop
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:1303
Method
test_runner_compacts_a_thread_that_ends_in_a_partial_reply_without_that_reply
( self, respx_mock: MockRouter, ending: str )
tests/lib/threads/test_thread_tool_runner.py:379
Method
test_runner_compacts_a_thread_that_ends_in_a_partial_reply_without_that_reply
( self, respx_mock: MockRouter, ending: str )
tests/lib/threads/test_async_beta_threads.py:1770
← previous
next →
10,101–10,200 of 12,795, ranked by callers