Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
14,068 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
14,068
◇
Types & classes
4,501
↳
Endpoints
96
Function
test_compact_before_next_turn_before_the_first_iteration_is_the_first_request_sync
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2859
Function
test_compact_before_next_turn_is_refused_beside_a_compaction_edit
()
tests/lib/tools/test_runners.py:3249
Function
test_compact_before_next_turn_is_sent_after_the_tools_run_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2662
Function
test_compact_before_next_turn_is_sent_after_the_tools_run_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2590
Function
test_compact_before_next_turn_on_the_compaction_response_is_ignored_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2932
Function
test_compact_before_next_turn_on_the_final_turn_is_sent_before_stopping_async
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2725
Function
test_compact_before_next_turn_on_the_final_turn_is_sent_before_stopping_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2702
Function
test_compact_before_next_turn_waits_out_a_paused_turn_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2831
Function
test_compact_before_next_turn_waits_out_a_paused_turn_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2803
Function
test_compact_before_next_turn_when_streaming_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3538
Function
test_compact_before_next_turn_when_streaming_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3510
Method
test_compaction
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:629
Method
test_compaction
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:963
Function
test_compaction_param_is_refused_on_a_tool_runner
()
tests/lib/tools/test_runners.py:3211
Function
test_compaction_request_leaves_off_reply_params_async
( respx_mock: MockRouter, tool_choice: BetaToolChoiceParam, output_format: Union[Type[_Forecast],
tests/lib/tools/test_runners.py:3404
Function
test_compaction_request_leaves_off_reply_params_sync
( respx_mock: MockRouter, tool_choice: BetaToolChoiceParam, output_format: Union[Type[_Forecast],
tests/lib/tools/test_runners.py:3367
Function
test_compaction_resumes_runner_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:850
Function
test_compaction_resumes_runner_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:819
Method
test_compaction_tokens
(self, raw: bool, content_mode: str, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2004
Method
test_compaction_tokens_of_a_response_without_usage_of_its_own
( self, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:2020
Function
test_compaction_without_a_summary_keeps_the_history_and_warns_sync
( respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, content: List[Any], stop_reason: str )
tests/lib/tools/test_runners.py:3058
Function
test_compat_method_no_error_for_warnings
()
tests/test_models.py:601
Function
test_complete_line_that_is_not_json_does_not_raise_connection_error
( sync: bool, client: Anthropic, async_client: AsyncAnthropic )
tests/decoders/test_jsonl.py:143
Method
test_completions_not_available
(self)
tests/lib/test_bedrock_mantle.py:184
Method
test_concurrent_async_calls_get_their_own_spans
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2388
Method
test_concurrent_calls_sharing_options_get_their_own_spans
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:2370
Method
test_concurrent_cold_calls_share_one_provider_call
(self)
tests/lib/test_credentials.py:4318
Function
test_concurrent_first_construct_waits_for_build
()
tests/test_models.py:1189
Function
test_concurrent_first_token_resolution_loads_adc_once
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:612
Function
test_concurrent_first_validation_validates_on_every_thread
()
tests/test_models.py:1257
Method
test_concurrent_invalidate_survives_non_forced_call
An invalidate() that lands during a non-forced call still forces the next call.
tests/lib/test_credentials.py:2044
Method
test_concurrent_invalidate_survives_non_forced_call
An invalidate() that lands during a non-forced call still forces the next call.
tests/lib/test_credentials.py:4253
Method
test_concurrent_mandatory_refresh_single_flight
N concurrent callers in the mandatory (expired) window trigger exactly one provider call — waiters block on the leader's event.
tests/lib/test_credentials.py:1782
Method
test_config_base_url_http_rejected
A config file that specifies base_url=http://evil is rejected so a malicious config can't exfiltrate the assertion or refresh token.
tests/lib/test_credentials.py:857
Method
test_config_base_url_localhost_http_allowed
Localhost HTTP is allowed for local testing.
tests/lib/test_credentials.py:869
Method
test_config_dict_base_url_adopted_by_client
Outbound, `config=` path: `Anthropic(config={"base_url": ...})` adopts the dict's `base_url` for API requests when no kwarg/env is set
tests/lib/test_credentials.py:2803
Method
test_config_dir_env_propagates_error
(self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:2347
Method
test_config_dir_env_triggers_tier1
ANTHROPIC_CONFIG_DIR set → the active profile is looked up in that directory.
tests/lib/test_credentials.py:2162
Method
test_config_file_group_or_other_writable_rejected
(self, tmp_path: pathlib.Path, mode: int)
tests/lib/test_credentials.py:943
Method
test_config_file_not_writable_by_others_accepted
(self, tmp_path: pathlib.Path, mode: int)
tests/lib/test_credentials.py:952
Method
test_config_file_symlink_checks_target_mode
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:964
Method
test_config_file_symlink_outside_config_dir_rejected
( self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/test_credentials.py:986
Method
test_config_param_builds_in_memory_federation
`Anthropic(config={...})` accepts a config-file-shaped dict and wires it through to a federation provider, including `workspace_id` as
tests/lib/test_credentials.py:3307
Function
test_configs_are_gated_on_the_copy_that_is_sent
()
tests/lib/tools/toolsets/test_interface.py:157
Function
test_configs_is_a_read_only_copy_of_what_to_dict_sends
()
tests/lib/tools/toolsets/test_interface.py:304
Function
test_configs_is_a_read_only_copy_of_what_to_dict_sends
()
tests/lib/tools/toolsets/test_computer_interface.py:218
Function
test_confirm_context_describes_the_target_tab_as_of_the_last_block_and_costs_nothing_unread
()
tests/lib/tools/toolsets/test_confirm.py:99
Function
test_confirm_refusals
()
tests/lib/tools/toolsets/test_refusals.py:114
Function
test_confirm_sees_every_call_and_a_decline_never_reaches_the_driver
()
tests/lib/tools/toolsets/test_confirm.py:44
Function
test_confirm_sees_every_call_with_the_member_and_its_parsed_input
()
tests/lib/tools/toolsets/test_computer_pipeline.py:327
Function
test_confirmation_that_arrives_before_its_call_decides_it
(result: str)
tests/lib/tools/test_session_runner.py:1624
Method
test_conflicts_still_raise
( self, client_class: type[AnthropicFoundry | AsyncAnthropicFoundry], monkeypatch: pytest.MonkeyPatch
tests/lib/test_azure.py:230
Method
test_connection_error
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:1027
Method
test_connection_error_message_describes_the_cause
( self, client: Anthropic, errors: list[Exception], reason: str )
tests/test_client.py:1719
Method
test_connection_error_message_describes_the_cause
( self, async_client: AsyncAnthropic, errors: list[Exception], reason: str )
tests/test_client.py:3524
Method
test_connection_error_message_for_a_refused_connection
( self, client: Anthropic, monkeypatch: pytest.MonkeyPatch, addresses: int )
tests/test_client.py:1787
Method
test_connection_error_message_for_a_refused_connection
( self, async_client: AsyncAnthropic, monkeypatch: pytest.MonkeyPatch, addresses: int )
tests/test_client.py:3598
Method
test_connection_error_message_for_a_rejected_header_value
(self, client: Anthropic)
tests/test_client.py:1810
Method
test_connection_error_message_for_a_rejected_header_value
(self, async_client: AsyncAnthropic)
tests/test_client.py:3621
Method
test_connection_error_message_for_a_request_body_that_cannot_be_read
(self, client: Anthropic)
tests/test_client.py:1735
Method
test_connection_error_message_for_a_request_body_that_cannot_be_read
( self, async_client: AsyncAnthropic )
tests/test_client.py:3540
Method
test_connection_error_message_for_an_error_that_has_no_request
(self, client: Anthropic)
tests/test_client.py:1690
Method
test_connection_error_message_for_an_error_that_has_no_request
( self, async_client: AsyncAnthropic )
tests/test_client.py:3493
Method
test_connection_error_message_for_errors_that_cause_each_other
( self, respx_mock: MockRouter, client: Anthropic )
tests/test_client.py:1767
Method
test_connection_error_message_for_errors_that_cause_each_other
( self, respx_mock: MockRouter, async_client: AsyncAnthropic )
tests/test_client.py:3576
Method
test_connection_error_message_ignores_the_error_the_caller_is_handling
(self, client: Anthropic)
tests/test_client.py:1753
Method
test_connection_error_message_ignores_the_error_the_caller_is_handling
( self, async_client: AsyncAnthropic )
tests/test_client.py:3560
Method
test_connection_error_message_names_only_the_host_and_port
( self, client: Anthropic, url: str, connection: str )
tests/test_client.py:1653
Method
test_connection_error_message_names_only_the_host_and_port
( self, async_client: AsyncAnthropic, url: str, connection: str )
tests/test_client.py:3456
Function
test_connects_by_opening_the_stream_then_reading_the_session_and_the_history
()
tests/lib/tools/test_session_runner.py:1367
Method
test_consecutive_user_messages_are_sent_as_they_were_appended
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:271
Method
test_construction_accepts_async_middleware
(self)
tests/test_middleware.py:2140
Method
test_construction_accepts_sync_middleware
(self)
tests/test_middleware.py:1488
Method
test_construction_rejects_async_function
(self)
tests/test_middleware.py:1481
Method
test_construction_rejects_async_only_middleware
(self)
tests/test_middleware.py:1477
Method
test_construction_rejects_sync_function
(self)
tests/test_middleware.py:2133
Method
test_construction_rejects_sync_only_middleware
(self)
tests/test_middleware.py:2129
Method
test_constructor_starts_the_same_thread_as_the_factory
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1955
Function
test_consumer_cancelled_during_a_backoff_or_a_read_exits_at_once
(at: float)
tests/lib/tools/test_session_runner.py:1950
Function
test_consumer_that_closes_the_iterator_waits_30_seconds_for_a_failing_post
()
tests/lib/tools/test_session_runner.py:1341
Function
test_content_fetches_fan_out_within_a_store
The first memory's fetch completes only after the second's starts — only parallel fetches satisfy that; serial ones would time out.
tests/lib/tools/memory_sync/test_two_pass.py:78
Method
test_content_is_off_by_default
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:769
Method
test_content_mode
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:4906
Function
test_content_mode_decides_whether_a_content_query_is_recorded
( new_client: NewClient, monkeypatch: pytest.MonkeyPatch, content_mode: str, endpoint_content_
tests/test_tracing.py:177
Function
test_context_bash_keeps_an_ended_shell
(ctx: AgentToolContext)
tests/lib/tools/test_agent_toolset.py:1431
Method
test_context_management_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:685
Method
test_context_management_propagated
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:1023
Method
test_context_manager
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:316
Method
test_context_manager
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:668
Method
test_context_manager
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:552
Method
test_context_manager
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:805
Function
test_context_manager_closes_the_toolset
()
tests/lib/tools/toolsets/test_runnable.py:191
Function
test_context_manager_tool_is_exited_after_it_ran
()
tests/lib/tools/test_session_runner.py:2017
Method
test_continue_omits_the_system_and_tools_the_server_holds
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:140
Method
test_continue_unthreaded_counts_the_create_after_a_replay_that_failed_as_the_replay
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:572
Method
test_continue_unthreaded_keeps_threading_unless_both_rejections_are_thread_not_found
( self, respx_mock: MockRouter, first: httpx2.Response, second: httpx2.Response )
tests/lib/threads/test_beta_threads.py:662
Method
test_continue_unthreaded_replay_that_is_unsupported_goes_without_a_thread
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:509
Method
test_continue_unthreaded_replays_a_thread_that_is_lost_after_a_continue_that_succeeded
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:627
Method
test_continue_unthreaded_stops_threading_after_an_unsupported_request_that_lists_no_feature
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:462
Method
test_continue_unthreaded_stops_threading_for_good_after_an_unsupported_request
( self, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture, unsupported: list[str] )
tests/lib/threads/test_beta_threads.py:480
← previous
next →
6,501–6,600 of 14,068, ranked by callers