Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
13,873 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
13,873
◇
Types & classes
4,472
↳
Endpoints
93
Function
test_ignores_incorrect_paths
( query: dict[str, object], paths: Sequence[Sequence[str]], expected: list[tuple[str, FileTypes]],
tests/test_extract_files.py:65
Method
test_image_content_gif
(self)
tests/lib/tools/test_mcp_tool.py:104
Method
test_image_content_jpeg
(self)
tests/lib/tools/test_mcp_tool.py:97
Method
test_image_content_png
(self)
tests/lib/tools/test_mcp_tool.py:89
Method
test_image_content_webp
(self)
tests/lib/tools/test_mcp_tool.py:108
Function
test_image_media_types_track_the_generated_image_source
()
tests/lib/tools/toolsets/test_computer_surface.py:99
Method
test_image_resource
(self)
tests/lib/tools/test_mcp_tool.py:230
Method
test_image_unsupported_mime_type
(self)
tests/lib/tools/test_mcp_tool.py:112
Method
test_includes_query_params_in_signing
URL query params must be part of the signed request.
tests/lib/test_aws_auth.py:541
Method
test_includes_security_token_header
(self)
tests/lib/test_aws_auth.py:490
Method
test_incomplete_response
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:902
Function
test_init_api_key_mode
()
tests/lib/test_aws.py:26
Function
test_init_async_api_key_mode
()
tests/lib/test_aws.py:75
Function
test_init_async_requires_workspace_id
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:91
Function
test_init_async_sigv4
()
tests/lib/test_aws.py:81
Function
test_init_requires_region_for_sigv4
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:57
Function
test_init_requires_workspace_id
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:63
Function
test_init_sigv4_default_credential_chain
()
tests/lib/test_aws.py:51
Function
test_init_sigv4_explicit_creds
()
tests/lib/test_aws.py:32
Function
test_init_sigv4_profile
()
tests/lib/test_aws.py:45
Method
test_init_with_token_provider_and_base_url
(self)
tests/lib/test_google_cloud.py:117
Function
test_init_workspace_id_from_env
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:69
Method
test_initialization_from_environment_variables
Test client initialization falls back to environment variables.
tests/lib/test_azure.py:53
Method
test_initialization_from_environment_variables
Test async client initialization falls back to environment variables.
tests/lib/test_azure.py:153
Method
test_initialization_with_azure_ad_token_provider
Test client initialization with Azure AD token provider.
tests/lib/test_azure.py:39
Method
test_initialization_with_base_url
Test client initialization with base_url instead of resource.
tests/lib/test_azure.py:30
Method
test_input_messages_under_the_bound_are_the_json_of_the_whole_list
( self, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:6451
Method
test_input_transformations_propagated
( self, respx_mock: MockRouter, fixture: str, expected: List[Dict[str, str]] )
tests/lib/streaming/test_beta_messages.py:699
Method
test_input_transformations_propagated
( self, respx_mock: MockRouter, fixture: str, expected: List[Dict[str, str]] )
tests/lib/streaming/test_beta_messages.py:1038
Function
test_inputs_are_parsed_into_the_generated_models_and_undeclared_keys_are_kept
()
tests/lib/tools/toolsets/test_computer_pipeline.py:148
Method
test_insert
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:320
Method
test_insert
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:946
Method
test_insert_at_beginning_of_file
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:337
Method
test_insert_at_beginning_of_file
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:963
Method
test_insert_at_end_of_file
(self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:353
Method
test_insert_at_end_of_file
(self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool)
tests/lib/tools/memory_tools/test_filesystem.py:981
Method
test_insert_error_for_invalid_insert_line
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:418
Method
test_insert_error_for_invalid_insert_line
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1054
Method
test_insert_error_for_non_existent_file
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:406
Method
test_insert_error_for_non_existent_file
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1042
Method
test_insert_preserves_crlf_line_endings
( self, sync_local_filesystem_tool: BetaLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:393
Method
test_insert_preserves_crlf_line_endings
( self, async_local_filesystem_tool: BetaAsyncLocalFilesystemMemoryTool )
tests/lib/tools/memory_tools/test_filesystem.py:1027
Function
test_int_to_float_safe_conversion
()
tests/test_models.py:487
Function
test_integer_schema_with_min_max_exclusive
()
tests/lib/_parse/test_transform.py:233
Function
test_interpolation
(template: str, kwargs: dict[str, Any], expected: str)
tests/test_utils/test_path.py:63
Function
test_interrupt_of_a_subagent_that_requires_action_lists_its_resolved_call_before_the_turn_ends
()
tests/lib/tools/test_fake_sessions_api.py:132
Function
test_interrupted_command_stops_and_later_commands_do_not_run
(shell: list[Any], tmp_path: Path)
tests/lib/tools/test_session_runner.py:338
Function
test_interrupted_download_removes_the_folder_and_is_not_a_failure
(notes: Path, ending: Step)
tests/lib/tools/memory_sync/test_e2e_memory.py:359
Function
test_interval_below_the_minimum_is_rejected
(interval: float)
tests/lib/tools/memory_sync/test_e2e_memory.py:408
Method
test_invalid_expires_in_does_not_retain_minted_token
(self, expires_in: str)
tests/lib/test_credentials.py:5221
Method
test_invalid_http_client
(self)
tests/test_client.py:527
Method
test_invalid_http_client
(self)
tests/test_client.py:1976
Method
test_invalid_json_credentials_does_not_retain_raw_text
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:5422
Method
test_invalid_profile_name_raises_anthropic_error
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4349
Method
test_invalidate
(self)
tests/lib/test_credentials.py:1723
Method
test_invalidate_forces_provider_refresh
After invalidate(), the next provider call receives force_refresh=True so providers with on-disk caches bypass their freshness short-c
tests/lib/test_credentials.py:1916
Method
test_is_content_query
(self, query: str, content_names: tuple[str, ...], content: bool)
tests/test_open_telemetry.py:3369
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback.py:844
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback.py:941
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback_streaming.py:1650
Method
test_is_resent_once_without_speed
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, status: int )
tests/lib/test_refusal_fallback_streaming.py:1901
Function
test_isinstance_check
(client: Anthropic, async_client: AsyncAnthropic)
tests/test_streaming.py:351
Function
test_isinstance_does_not_error
()
tests/test_utils/test_proxy.py:26
Function
test_iso8601_datetime
()
tests/test_models.py:457
Function
test_item_fails_and_does_not_change_the_folder_when_one_is_already_there
( notes: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_e2e_memory.py:384
Function
test_item_fails_before_skills_are_downloaded_when_its_memory_cannot_be
(notes: Path)
tests/lib/tools/memory_sync/test_e2e_memory.py:375
Function
test_item_fails_when_it_has_memory_and_no_token
(notes: Path)
tests/lib/tools/memory_sync/test_e2e_memory.py:368
Function
test_item_is_claimed_served_and_force_stopped_when_the_session_is_idle
(variant: Variant)
tests/lib/environments/test_worker.py:94
Function
test_item_is_dropped_when_the_api_refuses_the_repeat_of_a_heartbeat_whose_response_was_lost
(fault: Fault)
tests/lib/environments/test_worker.py:336
Function
test_item_is_force_stopped_after_the_loop_body
(sync: bool)
tests/lib/environments/test_poller.py:178
Function
test_item_is_not_stopped_when_a_heartbeat_is_refused
(status: int)
tests/lib/environments/test_worker.py:464
Function
test_item_is_not_stopped_when_it_was_queued_again
(variant: Variant)
tests/lib/environments/test_worker.py:311
Function
test_item_is_not_stopped_when_the_heartbeat_in_flight_at_a_cancel_gets_a_412
()
tests/lib/environments/test_worker.py:518
Function
test_item_is_served_without_memory_when_sync_is_disabled
(notes: Path, secret: str | None)
tests/lib/tools/memory_sync/test_e2e_memory.py:398
Function
test_item_is_stopped_and_polling_continues_after_a_heartbeat_raises_an_error_that_is_not_an_api_failure
()
tests/lib/environments/test_worker.py:151
Function
test_item_is_stopped_when_its_session_ends_or_the_worker_is_cancelled
(ending: Step)
tests/lib/environments/test_worker.py:106
Function
test_item_is_stopped_when_the_loop_exits_unless_auto_stop_is_off
( sync: bool, options: dict[str, Any], state: str )
tests/lib/environments/test_poller.py:196
Function
test_item_of_a_terminated_session_is_stopped_without_setup
(tmp_path: Path)
tests/lib/environments/test_worker.py:595
Function
test_item_that_fails_is_stopped_and_polling_continues
(steps: list[Step], options: dict[str, Any])
tests/lib/environments/test_worker.py:130
Function
test_item_that_is_never_served_is_stopped_only_if_the_worker_may_hold_it
( steps: list[Step], options: dict[str, Any], kinds: str )
tests/lib/environments/test_worker.py:199
Function
test_item_that_is_not_for_a_session_is_stopped_and_polling_continues
(data: object)
tests/lib/environments/test_worker.py:139
Function
test_item_that_is_not_for_a_session_is_yielded
(sync: bool)
tests/lib/environments/test_poller.py:151
Function
test_item_uses_the_environment_key_when_its_secret_has_no_token
(secret: object)
tests/lib/environments/test_worker.py:735
Function
test_item_whose_ack_fails_is_not_yielded_or_stopped
(sync: bool, fault: Fault, applied: bool)
tests/lib/environments/test_poller.py:132
Function
test_item_without_data_is_yielded
(sync: bool)
tests/lib/environments/test_poller.py:161
Function
test_items_are_acked_and_then_yielded_in_order
(sync: bool)
tests/lib/environments/test_poller.py:34
Function
test_iterable_construction
(data: Iterable[int], expected_validated: Iterable[int])
tests/test_models.py:1100
Function
test_iterable_construction_str_falls_back_to_list
()
tests/test_models.py:1116
Method
test_iterables_and_mappings
(self)
tests/test_utils/test_json.py:38
Function
test_iteration_ends_with_no_error_when_the_session_ends
(end: Step, ended: float)
tests/lib/tools/test_session_runner.py:1633
Method
test_json_string_echo_response_does_not_retain_assertion
A 200 whose body is a JSON *string* echoing the assertion must be rejected at the wrap boundary — never bound to a frame local on its
tests/lib/test_credentials.py:5252
Function
test_keeps_const_and_enum_and_drops_type
(schema: dict[str, Any], expected: dict[str, Any])
tests/lib/_parse/test_transform.py:90
Function
test_keeps_none
(send: Send)
tests/test_prepare.py:232
Function
test_keeps_pydantic_literals
()
tests/lib/_parse/test_transform.py:121
Function
test_keeps_the_host_and_headers_of_the_parents_credential
`copy()` drops both with the credential that brought them, but the bearer is for the deployment and workspace the parent talks to.
tests/lib/test_scoped_client.py:168
Function
test_keyword_only_param
()
tests/test_required_args.py:30
Function
test_last_change_is_sent_once_when_an_idle_session_is_done
( notes: Path, steps: list[Step], options: dict[str, Any], received: object )
tests/lib/tools/memory_sync/test_e2e_memory.py:215
Function
test_last_edit_is_uploaded_after_a_final_sync_that_failed_or_was_cut_off
( notes: Path, fault: Fault, uploaded_at: float, cut_off: bool, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_e2e_memory.py:302
Function
test_last_of_two_tools_with_one_name_runs
()
tests/lib/tools/test_session_runner.py:1066
Method
test_late_401_for_replaced_token_does_not_refresh_again
A 401 for a token the cache already replaced is retried with the newer token.
tests/lib/test_credentials.py:2883
← previous
next →
7,201–7,300 of 13,873, ranked by callers