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_raw_response_whose_connection_is_lost_in_the_body
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:1587
Method
test_raw_response_whose_events_the_application_reads_itself
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:1534
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:545
Function
test_read_binary_honors_explicit_cap
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:527
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:516
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:535
Function
test_read_binary_rejects_view_range
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:567
Function
test_read_binary_returns_content_block
Images/PDFs come back as base64 content blocks, not UnicodeDecodeError.
tests/lib/tools/test_agent_toolset.py:499
Function
test_read_custom_max_bytes_rejects_below_cap
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:436
Function
test_read_follows_symlink_chain_inside_workdir
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:1077
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:297
Function
test_read_preserves_crlf_line_endings
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:253
Function
test_read_preserves_lone_cr
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:262
Function
test_read_rejects_directory
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:371
Function
test_read_rejects_directory_even_when_uncapped
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:453
Method
test_read_rejects_file_replaced_with_symlink_before_open
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool, monkeypatch: pytest
tests/lib/tools/memory_tools/test_filesystem.py:594
Method
test_read_rejects_file_replaced_with_symlink_before_open
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool, monkeypatch:
tests/lib/tools/memory_tools/test_filesystem.py:1263
Function
test_read_rejects_oversized_file
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:287
Method
test_read_rejects_symlink_created_after_validation
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool, monkeypatch: pytest
tests/lib/tools/memory_tools/test_filesystem.py:571
Method
test_read_rejects_symlink_created_after_validation
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool, monkeypatch:
tests/lib/tools/memory_tools/test_filesystem.py:1240
Function
test_read_resolves_dangling_symlink_from_its_real_directory
(tmp_path: Path, rest: str)
tests/lib/tools/test_agent_toolset.py:1068
Function
test_read_symlink_loop_is_rejected
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:971
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:956
Function
test_read_uncapped_allows_oversized
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:446
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:575
Function
test_read_under_unreadable_directory_reports_permission_denied
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:1096
Function
test_read_view_range
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:219
Function
test_read_view_range_edges
(tmp_path: Path, view_range: list[int], want: str)
tests/lib/tools/test_agent_toolset.py:237
Function
test_read_view_range_over_cap_crosses_chunk_boundaries
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:362
Function
test_read_view_range_over_cap_preserves_crlf_line_endings
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:341
Function
test_read_view_range_over_cap_preserves_lone_cr
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:348
Function
test_read_view_range_over_cap_rejects_oversized_slice
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:322
Function
test_read_view_range_over_cap_single_long_line
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:332
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:315
Function
test_read_view_range_wrong_arity_is_rejected
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:244
Function
test_read_write_edit_roundtrip
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:204
Method
test_reads_env
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:213
Method
test_reads_env_var_path
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:233
Method
test_received_text_for_expected_json
(self, respx_mock: MockRouter)
tests/test_client.py:1246
Method
test_received_text_for_expected_json
(self, respx_mock: MockRouter)
tests/test_client.py:2697
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:917
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:2005
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:1192
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:882
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:1038
Function
test_ref_schema
()
tests/lib/_parse/test_transform.py:12
Function
test_ref_schema_with_defs
()
tests/lib/_parse/test_transform.py:18
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:4975
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:4986
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:5016
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:5000
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:5045
Function
test_refresh_without_google_auth_raises_actionable_error
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_vertex.py:661
Function
test_refresh_without_google_auth_raises_actionable_error
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:537
Method
test_refusal_after_a_completed_server_tool
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1351
Function
test_refusal_ends_runner_without_executing_tools_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:618
Function
test_refusal_ends_runner_without_executing_tools_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:581
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:435
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:709
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:574
Method
test_refusal_stop_details_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:892
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:427
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:365
Method
test_region_from_aws_default_region_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:168
Method
test_region_from_aws_region_env_var
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_bedrock_mantle.py:160
Function
test_region_from_constructor
()
tests/lib/test_aws.py:359
Function
test_region_infer_from_aws_profile_argument
( mock_aws_config: None, # noqa: ARG001 monkeypatch: t.Any, )
tests/lib/test_bedrock.py:516
Function
test_region_infer_from_profile
( mock_aws_config: None, # noqa: ARG001 profiles: t.List[AwsConfigProfile], )
tests/lib/test_bedrock.py:481
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:500
Function
test_region_is_required
( mock_aws_config: None, # noqa: ARG001 monkeypatch: t.Any, )
tests/lib/test_bedrock.py:527
Method
test_regional_base_url
Test that regional endpoints use the correct base URL format.
tests/lib/test_vertex.py:369
Method
test_regional_base_url
Test that regional endpoints use the correct base URL format.
tests/lib/test_vertex.py:889
Method
test_reinvokes_identity_provider
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:1286
Method
test_rejected_previous_message_id_replays_the_full_history_under_a_new_thread
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, rejection: httpx2.Response, reason:
tests/lib/threads/test_beta_threads.py:406
Method
test_rejected_previous_message_id_replays_the_full_history_under_a_new_thread
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:167
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:212
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:312
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:1775
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:338
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:480
Method
test_rename
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:1118
Method
test_rename_error_when_destination_exists
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:522
Method
test_rename_error_when_destination_exists
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1160
Method
test_rename_error_when_source_not_found
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:512
Method
test_rename_error_when_source_not_found
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1150
Method
test_rename_not_allow_renaming_memories_directory
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool, old_path: str )
tests/lib/tools/memory_tools/test_filesystem.py:541
Method
test_rename_not_allow_renaming_memories_directory
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool, old_path: str )
tests/lib/tools/memory_tools/test_filesystem.py:1179
Method
test_rename_to_nested_path
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:497
Method
test_rename_to_nested_path
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:1135
Method
test_replay_after_a_continue_sends_system_and_tools_again
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:151
Function
test_reported_names
(tmp_path: Path, baseline: dict[str, str], tip: dict[str, str], reported: list[str])
tests/test_detect_breaking_changes.py:187
Function
test_repr
()
tests/test_models.py:198
Function
test_repr_nested_model
()
tests/test_models.py:204
Method
test_request_attributes_are_on_the_span_from_its_start
(self, respx_mock: MockRouter)
tests/test_open_telemetry.py:2620
← previous
next →
9,601–9,700 of 12,274, ranked by callers