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_beta_skills_not_available
(self)
tests/lib/test_bedrock_mantle.py:160
Function
test_beta_tool_runner_routes_through_invoke
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:558
Function
test_beta_tool_runner_routes_through_invoke_async
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:586
Method
test_beta_tool_runner_routes_through_raw_predict
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:224
Method
test_beta_tool_runner_routes_through_raw_predict
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:421
Function
test_betas_param_and_extra_headers_case_variant
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:653
Method
test_between_tools_thinking_degrades_to_disabled_on_the_hop
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:333
Method
test_between_tools_thinking_degrades_to_disabled_on_the_hop
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:728
Method
test_between_tools_thinking_degrades_to_disabled_on_the_hop
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:308
Method
test_binary_content_upload
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:888
Method
test_binary_content_upload
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:2189
Method
test_binary_content_upload_with_asynciterator
(self)
tests/test_client.py:2205
Method
test_binary_content_upload_with_body_is_rejected
(self, client: Anthropic)
tests/test_client.py:931
Method
test_binary_content_upload_with_body_is_rejected
(self, async_client: AsyncAnthropic)
tests/test_client.py:2232
Method
test_binary_content_upload_with_iterator
(self)
tests/test_client.py:904
Function
test_binary_media_types_track_generated_api_types
Pin the read tool's extension map to the codegen'd media-type literals. When a spec change adds or removes a supported image/document media type,
tests/lib/tools/test_agent_toolset.py:467
Method
test_bind_base_url
`bind_base_url` sets the token-exchange URL; unbound → `DEFAULT_BASE_URL`.
tests/lib/test_credentials.py:1160
Method
test_bind_base_url_http_rejected
(self)
tests/lib/test_credentials.py:1182
Method
test_bind_base_url_precedence
`bind_base_url` slots between the config file's own `base_url` field and the hard-coded default: config → bound → default.
tests/lib/test_credentials.py:389
Method
test_blob_resource
(self)
tests/lib/tools/test_mcp_tool.py:271
Function
test_boolean_schema
()
tests/lib/_parse/test_transform.py:197
Method
test_both_provided_passes
(self)
tests/lib/test_aws_auth.py:22
Function
test_browser_state_is_abstract
()
tests/lib/tools/toolsets/test_interface.py:77
Method
test_builds_request_b_as_a_shape_b_continuation
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:274
Function
test_bytes_and_files_elsewhere_are_rejected
( send: Send, body: object, monkeypatch: pytest.MonkeyPatch )
tests/test_prepare.py:608
Method
test_call_empty_content_returns_empty_list
(self)
tests/lib/tools/test_mcp_tool.py:383
Method
test_call_error
(self)
tests/lib/tools/test_mcp_tool.py:351
Function
test_call_from_inside_a_member_is_a_contract_error_not_a_deadlock
()
tests/lib/tools/toolsets/test_pipeline.py:1043
Method
test_call_next_returns_api_response
(self, respx_mock: MockRouter)
tests/test_middleware.py:1005
Method
test_call_next_returns_api_response
(self, respx_mock: MockRouter)
tests/test_middleware.py:1530
Function
test_call_raises_a_tool_errors_blocks_as_they_are_and_tool_result_keeps_only_the_text
()
tests/lib/tools/toolsets/test_computer_pipeline.py:255
Function
test_call_raises_a_tool_errors_blocks_as_they_are_on_the_async_class
()
tests/lib/tools/toolsets/test_computer_pipeline.py:267
Method
test_call_structured_content_fallback
(self)
tests/lib/tools/test_mcp_tool.py:371
Method
test_call_success
(self)
tests/lib/tools/test_mcp_tool.py:334
Method
test_called_again_after_expiry
(self)
tests/lib/test_credentials.py:3526
Method
test_caller_api_key_header_wins_case_insensitively
(self)
tests/lib/test_azure.py:251
Method
test_caller_authorization_header_wins_case_insensitively
(self)
tests/lib/test_azure.py:241
Method
test_caller_tag_is_appended_not_clobbered
(self, client: Anthropic, respx_mock: respx.MockRouter)
tests/lib/test_stainless_helpers.py:67
Method
test_caller_tag_is_appended_not_clobbered
( self, async_client: AsyncAnthropic, respx_mock: respx.MockRouter )
tests/lib/test_stainless_helpers.py:162
Function
test_calls_run_one_at_a_time
()
tests/lib/tools/toolsets/test_pipeline.py:1014
Method
test_cancelled_leader_releases_waiters
(self)
tests/lib/test_credentials.py:3778
Method
test_chain_and_class_agree_on_profile
default_credentials() and CredentialsFile() resolve to the same profile.
tests/lib/test_credentials.py:1023
Function
test_changes_drained_by_a_failed_call_ride_the_next_block_on_the_async_class
()
tests/lib/tools/toolsets/test_pipeline.py:1282
Function
test_changes_drained_by_a_failed_call_ride_the_next_block_that_reaches_the_model
()
tests/lib/tools/toolsets/test_pipeline.py:617
Function
test_chunk_bytes_to_sse_drops_chunk_without_type_or_completion
()
tests/lib/test_bedrock.py:346
Function
test_chunk_bytes_to_sse_legacy_completion
()
tests/lib/test_bedrock.py:329
Function
test_chunk_bytes_to_sse_legacy_completion_with_metrics
()
tests/lib/test_bedrock.py:336
Function
test_chunk_bytes_to_sse_typed_event
()
tests/lib/test_bedrock.py:317
Function
test_circular_reference
(send: Send)
tests/test_prepare.py:754
Function
test_clears_inherited_credentials_provider
When the parent client carries a credentials provider (e.g. workload identity), the sub-client must use the explicit bearer token as the unamb
tests/lib/test_scoped_client.py:34
Function
test_clears_parent_api_key_on_copy
The post-hoc `scoped.api_key = None` mutation is the only thing keeping the parent's `X-Api-Key` off the sub-client's wire. If this ever start
tests/lib/test_scoped_client.py:24
Method
test_client_context_manager
(self)
tests/test_client.py:1097
Method
test_client_context_manager
(self)
tests/test_client.py:2409
Method
test_client_max_retries_validation
(self)
tests/test_client.py:1117
Method
test_client_max_retries_validation
(self)
tests/test_client.py:2429
Method
test_client_response_validation_error
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1106
Method
test_client_response_validation_error
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:2418
Method
test_client_timeout_option
(self)
tests/test_client.py:337
Method
test_client_timeout_option
(self)
tests/test_client.py:1632
Function
test_close_and_with_mark_the_toolset_closed_sync
()
tests/lib/tools/toolsets/test_runner.py:702
Method
test_close_awaits_aclose
(self)
tests/lib/test_credentials.py:3808
Method
test_close_awaits_an_async_close
(self)
tests/lib/test_credentials.py:3821
Function
test_close_from_inside_a_member_does_not_wait_for_itself
()
tests/lib/tools/toolsets/test_pipeline.py:1213
Method
test_close_reaches_a_partial_wrapped_provider
(self)
tests/lib/test_credentials.py:3844
Method
test_close_tolerates_hooks_that_return_nothing_to_await
A `Mock` has every attribute, so on Python < 3.12 it looks like it has `aclose()`.
tests/lib/test_credentials.py:3832
Function
test_close_waits_for_accepted_calls_to_settle
()
tests/lib/tools/toolsets/test_pipeline.py:1176
Function
test_close_waits_for_the_call_in_flight
()
tests/lib/tools/toolsets/test_computer_pipeline.py:490
Method
test_closing_the_stream_mid_passthrough_tears_down_without_a_fallback_request
( self, respx_mock: MockRouter )
tests/lib/test_refusal_fallback_streaming.py:1287
Method
test_closing_the_stream_mid_passthrough_tears_down_without_a_fallback_request
( self, respx_mock: MockRouter )
tests/lib/test_refusal_fallback_streaming.py:1668
Function
test_compact_before_next_turn_again_replaces_the_pending_compaction_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2879
Function
test_compact_before_next_turn_before_the_first_iteration_is_the_first_request_async
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2857
Function
test_compact_before_next_turn_before_the_first_iteration_is_the_first_request_sync
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2834
Function
test_compact_before_next_turn_is_refused_beside_a_compaction_edit
()
tests/lib/tools/test_runners.py:3213
Function
test_compact_before_next_turn_is_sent_after_the_tools_run_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2645
Function
test_compact_before_next_turn_is_sent_after_the_tools_run_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2575
Function
test_compact_before_next_turn_on_the_compaction_response_is_ignored_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2907
Function
test_compact_before_next_turn_on_the_final_turn_is_sent_before_stopping_async
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2708
Function
test_compact_before_next_turn_on_the_final_turn_is_sent_before_stopping_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2685
Function
test_compact_before_next_turn_waits_out_a_paused_turn_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2806
Function
test_compact_before_next_turn_waits_out_a_paused_turn_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2778
Function
test_compact_before_next_turn_when_streaming_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3500
Function
test_compact_before_next_turn_when_streaming_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:3472
Method
test_compaction
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:558
Method
test_compaction
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:809
Function
test_compaction_param_is_refused_on_a_tool_runner
()
tests/lib/tools/test_runners.py:3186
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:3367
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:3330
Function
test_compaction_resumes_runner_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:877
Function
test_compaction_resumes_runner_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:847
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:3033
Function
test_compat_method_no_error_for_warnings
()
tests/test_models.py:567
Method
test_completions_not_available
(self)
tests/lib/test_bedrock_mantle.py:136
Method
test_concurrent_cold_calls_share_one_provider_call
(self)
tests/lib/test_credentials.py:3715
Function
test_concurrent_first_token_resolution_loads_adc_once
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:425
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:1979
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:3650
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:1717
Method
test_config_and_credentials_mutually_exclusive
(self)
tests/lib/test_credentials.py:2899
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:789
Method
test_config_base_url_localhost_http_allowed
Localhost HTTP is allowed for local oauth_server testing.
tests/lib/test_credentials.py:801
← previous
next →
4,301–4,400 of 9,455, ranked by callers