Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
9,455 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
9,455
◇
Types & classes
3,151
↳
Endpoints
25
Method
test_raw_response_validate_repository
(self, client: Anthropic)
tests/api_resources/beta/organization/test_plugin_marketplaces.py:213
Method
test_raw_response_validate_repository
(self, async_client: AsyncAnthropic)
tests/api_resources/beta/organization/test_plugin_marketplaces.py:433
Function
test_read_binary_custom_media_caps
The media caps are configurable: a small custom cap rejects, a larger/disabled one permits.
tests/lib/tools/test_agent_toolset.py:542
Function
test_read_binary_honors_explicit_cap
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:524
Function
test_read_binary_not_subject_to_text_cap
An image over the 256 KiB text default still reads (the API media caps govern).
tests/lib/tools/test_agent_toolset.py:513
Function
test_read_binary_rejects_over_media_cap
An image whose base64 form would exceed the default per-image cap is rejected up front.
tests/lib/tools/test_agent_toolset.py:532
Function
test_read_binary_rejects_view_range
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:564
Function
test_read_binary_returns_content_block
Images/PDFs come back as base64 content blocks, not UnicodeDecodeError.
tests/lib/tools/test_agent_toolset.py:496
Function
test_read_custom_max_bytes_rejects_below_cap
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:433
Function
test_read_follows_symlink_chain_inside_workdir
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:838
Function
test_read_only_stores_are_never_written
(tmp_path: Path)
tests/lib/tools/memory_sync/test_memory_sync.py:125
Function
test_read_oversized_file_view_range_wrong_arity_is_rejected
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:294
Function
test_read_preserves_crlf_line_endings
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:250
Function
test_read_preserves_lone_cr
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:259
Function
test_read_rejects_directory
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:368
Function
test_read_rejects_directory_even_when_uncapped
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:450
Function
test_read_rejects_oversized_file
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:284
Function
test_read_symlink_loop_is_rejected
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:802
Function
test_read_text_exact_keeps_crlf_and_lone_cr
(tmp_path: Path)
tests/lib/tools/test_files.py:8
Function
test_read_through_symlink_escape_is_rejected
resolve_path realpaths, so a symlink that escapes the workdir is caught.
tests/lib/tools/test_agent_toolset.py:787
Function
test_read_uncapped_allows_oversized
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:443
Function
test_read_undecodable_binary_raises_tool_error
Non-image/PDF binary surfaces a clean ToolError, not a raw UnicodeDecodeError.
tests/lib/tools/test_agent_toolset.py:572
Function
test_read_under_unreadable_directory_reports_permission_denied
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:857
Function
test_read_view_range
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:216
Function
test_read_view_range_edges
(tmp_path: Path, view_range: list[int], want: str)
tests/lib/tools/test_agent_toolset.py:234
Function
test_read_view_range_over_cap_crosses_chunk_boundaries
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:359
Function
test_read_view_range_over_cap_preserves_crlf_line_endings
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:338
Function
test_read_view_range_over_cap_preserves_lone_cr
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:345
Function
test_read_view_range_over_cap_rejects_oversized_slice
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:319
Function
test_read_view_range_over_cap_single_long_line
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:329
Function
test_read_view_range_streams_file_over_cap
(tmp_path: Path, view_range: list[int], want: str)
tests/lib/tools/test_agent_toolset.py:312
Function
test_read_view_range_wrong_arity_is_rejected
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:241
Function
test_read_write_edit_roundtrip
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:201
Method
test_reads_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:206
Method
test_reads_env_var_path
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:226
Method
test_received_text_for_expected_json
(self, respx_mock: MockRouter)
tests/test_client.py:1133
Method
test_received_text_for_expected_json
(self, respx_mock: MockRouter)
tests/test_client.py:2447
Function
test_reconcile_confirmation_releases_call_held_from_live_stream
A confirmation that only ever appears in the reconcile history (its tool_use event is not in the listed window — it was held from the live str
tests/lib/tools/test_session_runner.py:892
Function
test_reconcile_list_error_does_not_dispatch_partial
If `events.list` errors mid-pagination, the partial `pending` list should not be enqueued — otherwise we'd risk re-running a tool whose result
tests/lib/tools/test_session_runner.py:1570
Function
test_reconcile_released_call_not_cut_short_by_idle
A held call released by the reconcile pass (its allow verdict only shows up in history after a reconnect) is in-flight work: even if that history
tests/lib/tools/test_session_runner.py:1167
Function
test_reconnect_does_not_double_dispatch_held_call
A call held on the live stream whose `allow` confirmation shows up in the reconcile history after a reconnect is dispatched exactly once: the
tests/lib/tools/test_session_runner.py:857
Function
test_recursive_proxy
()
tests/test_utils/test_proxy.py:17
Method
test_reentering_the_same_state_nests
(self)
tests/lib/test_refusal_fallback.py:759
Function
test_ref_schema
()
tests/lib/_parse/test_transform.py:9
Function
test_ref_schema_with_defs
()
tests/lib/_parse/test_transform.py:15
Method
test_refresh_failure_does_not_retain_refresh_token
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4538
Method
test_refresh_invalid_expires_does_not_retain_new_token
( self, respx_mock: MockRouter, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path, expires_in: str
tests/lib/test_credentials.py:4549
Method
test_refresh_json_array_response_raises_redacted_error
A JSON-but-non-object refresh body (which can echo the request's refresh token) is rejected at the wrap boundary and never bound to a
tests/lib/test_credentials.py:4579
Method
test_refresh_non_json_response_raises_redacted_error
A non-JSON refresh response raises WorkloadIdentityError (it previously escaped as a raw json ValueError whose `.doc` carries the full
tests/lib/test_credentials.py:4563
Method
test_refresh_success_writes_raw_tokens_to_disk_and_wire
SecretStr wrapping is an in-memory concern only: the refresh POST body and the persisted credentials file must carry the raw values —
tests/lib/test_credentials.py:4608
Function
test_refresh_without_google_auth_raises_actionable_error
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_vertex.py:253
Function
test_refresh_without_google_auth_raises_actionable_error
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:350
Method
test_refusal_after_a_completed_server_tool
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1320
Function
test_refusal_ends_runner_without_executing_tools_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:656
Function
test_refusal_ends_runner_without_executing_tools_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:619
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:387
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:580
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:524
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:773
Method
test_refusal_with_no_credit_token_passes_a_through_and_logs_an_error
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture )
tests/lib/test_refusal_fallback_streaming.py:397
Function
test_refusals_before_dispatch_read_as_tool_errors_and_never_reach_the_driver
()
tests/lib/tools/toolsets/test_pipeline.py:313
Function
test_region_constructor_overrides_env
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:353
Method
test_region_from_aws_default_region_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:120
Method
test_region_from_aws_region_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:112
Function
test_region_from_constructor
()
tests/lib/test_aws.py:347
Function
test_region_infer_from_aws_profile_argument
( mock_aws_config: None, # noqa: ARG001 monkeypatch: t.Any, )
tests/lib/test_bedrock.py:288
Function
test_region_infer_from_profile
( mock_aws_config: None, # noqa: ARG001 profiles: t.List[AwsConfigProfile], )
tests/lib/test_bedrock.py:253
Function
test_region_infer_from_specified_profile
( mock_aws_config: None, # noqa: ARG001 profiles: t.List[AwsConfigProfile], aws_profile: str,
tests/lib/test_bedrock.py:272
Function
test_region_is_required
( mock_aws_config: None, # noqa: ARG001 monkeypatch: t.Any, )
tests/lib/test_bedrock.py:299
Method
test_regional_base_url
Test that regional endpoints use the correct base URL format.
tests/lib/test_vertex.py:202
Method
test_regional_base_url
Test that regional endpoints use the correct base URL format.
tests/lib/test_vertex.py:395
Method
test_reinvokes_identity_provider
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1226
Method
test_rejects_both_output_format_and_config
(self, async_client: AsyncAnthropic)
tests/lib/_parse/test_beta_messages.py:105
Function
test_remove_tools_refuses_a_toolset_and_queues_nothing
( respx_mock: MockRouter, client: Anthropic, async_client: AsyncAnthropic, flavour: str, removed: str )
tests/lib/tools/toolsets/test_browser_runner.py:187
Function
test_remove_tools_removes_a_function_tool_named_like_a_member
( respx_mock: MockRouter, client: Anthropic, async_client: AsyncAnthropic, flavour: str )
tests/lib/tools/toolsets/test_browser_runner.py:287
Function
test_remove_tools_stops_a_call_already_in_the_turn
( sync: bool, remove_by: str, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:1767
Function
test_remove_tools_with_a_member_name_removes_only_the_function_tool_of_that_name
( respx_mock: MockRouter, client: Anthropic, async_client: AsyncAnthropic, flavour: str )
tests/lib/tools/toolsets/test_browser_runner.py:313
Function
test_removes_files_from_input
()
tests/test_extract_files.py:11
Method
test_rename
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:452
Method
test_rename
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:991
Method
test_rename_error_when_destination_exists
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:494
Method
test_rename_error_when_destination_exists
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1033
Method
test_rename_error_when_source_not_found
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:484
Method
test_rename_error_when_source_not_found
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1023
Method
test_rename_to_nested_path
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:469
Method
test_rename_to_nested_path
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:1008
Function
test_repr
()
tests/test_models.py:183
Function
test_repr_nested_model
()
tests/test_models.py:189
Method
test_request_data_prepared_before_prepare_options
( self, respx_mock: MockRouter, client: Anthropic, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
tests/test_client.py:647
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:1946
Method
test_request_does_not_modify_the_options_it_is_given
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:689
Method
test_request_does_not_modify_the_options_it_is_given
( self, respx_mock: MockRouter, async_client: AsyncAnthropic )
tests/test_client.py:1988
Method
test_request_extra_headers
(self, client: Anthropic)
tests/test_client.py:713
Method
test_request_extra_headers
(self, client: Anthropic)
tests/test_client.py:2014
Method
test_request_extra_headers_httpx_headers
(self, client: Anthropic)
tests/test_client.py:735
Method
test_request_extra_headers_httpx_headers
(self, async_client: AsyncAnthropic)
tests/test_client.py:2036
Method
test_request_extra_json
(self, client: Anthropic)
tests/test_client.py:586
Method
test_request_extra_json
(self, client: Anthropic)
tests/test_client.py:1885
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:621
Method
test_request_extra_json_merged_before_prepare_options
(self, respx_mock: MockRouter)
tests/test_client.py:1920
← previous
next →
7,501–7,600 of 9,455, ranked by callers