Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,522 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,522
◇
Types & classes
4,093
↳
Endpoints
47
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:304
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:1006
Method
test_call_next_returns_api_response
(self, respx_mock: MockRouter)
tests/test_middleware.py:1529
Function
test_call_of_terminated_thread_in_history_is_not_run
A call that was open when its thread terminated stays in the history without a result. A runner that reads that history must not run it, and the
tests/lib/tools/test_session_runner.py:1369
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_span_is_open_but_not_current_while_the_application_reads_a_stream
( self, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:2600
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:3648
Method
test_caller_anthropic_beta_header_gains_the_threads_beta_once
( self, respx_mock: MockRouter, header: str )
tests/lib/threads/test_beta_threads.py:198
Method
test_caller_anthropic_beta_header_is_left_alone_once_unthreaded
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:210
Method
test_caller_api_key_header_wins_case_insensitively
(self)
tests/lib/test_azure.py:310
Method
test_caller_authorization_header_wins_case_insensitively
(self)
tests/lib/test_azure.py:300
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:164
Function
test_calls_run_one_at_a_time
()
tests/lib/tools/toolsets/test_pipeline.py:1014
Method
test_canceling_a_tool_run_leaves_its_span_and_the_tool_runner_span_unset
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:1431
Function
test_cancelled_download_leaves_nothing_in_the_skills_directory
( tmp_path: Path, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_skills.py:533
Method
test_cancelled_leader_releases_waiters
(self)
tests/lib/test_credentials.py:3900
Method
test_chain_and_class_agree_on_profile
default_credentials() and CredentialsFile() resolve to the same profile.
tests/lib/test_credentials.py:1086
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
Method
test_changing_system_or_tools_is_refused_and_a_thread_from_the_params_takes_the_change
( self, respx_mock: MockRouter, change: dict[str, Any] )
tests/lib/threads/test_beta_threads.py:2029
Function
test_chunk_bytes_to_sse_drops_chunk_without_type_or_completion
()
tests/lib/test_bedrock.py:574
Function
test_chunk_bytes_to_sse_legacy_completion
()
tests/lib/test_bedrock.py:557
Function
test_chunk_bytes_to_sse_legacy_completion_with_metrics
()
tests/lib/test_bedrock.py:564
Function
test_chunk_bytes_to_sse_typed_event
()
tests/lib/test_bedrock.py:545
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:36
Function
test_clears_parent_api_key_on_copy
If this ever starts returning a sub-client with `api_key` set, the parent's API credential would silently authenticate every helper request, b
tests/lib/test_scoped_client.py:27
Method
test_client_context_manager
(self)
tests/test_client.py:1223
Method
test_client_context_manager
(self)
tests/test_client.py:2689
Method
test_client_default_header_is_sent_in_body_unless_the_request_names_one
( self, user_profile_id: str | Omit, sent: str, client: AnthropicBedrockMantle, respx_mock: MockRouter
tests/lib/test_bedrock_mantle.py:770
Function
test_client_identity_headers_are_kept
(respx_mock: MockRouter)
tests/lib/test_google_cloud.py:678
Function
test_client_identity_headers_are_kept_async
(respx_mock: MockRouter)
tests/lib/test_google_cloud.py:707
Method
test_client_max_retries_validation
(self)
tests/test_client.py:1243
Method
test_client_max_retries_validation
(self)
tests/test_client.py:2709
Method
test_client_option
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:4362
Method
test_client_response_validation_error
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1232
Method
test_client_response_validation_error
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:2698
Method
test_client_that_sends_a_threads_results_has_the_clients_other_options
( self, environment_key: str | None, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:2486
Method
test_client_timeout_option
(self)
tests/test_client.py:353
Method
test_client_timeout_option
(self)
tests/test_client.py:1800
Method
test_client_user_profile_id_is_kept
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:253
Method
test_client_user_profile_id_is_kept
(self, respx_mock: MockRouter)
tests/lib/test_vertex.py:774
Function
test_client_with_an_option_reads_no_env
( new_client: NewClient, option: OpenTelemetryClientOption, resolved: ResolvedOpenTelemetryOptions )
tests/test_tracing.py:331
Function
test_client_without_an_option_reads_every_env
(new_client: NewClient)
tests/test_tracing.py:312
Function
test_client_workspace_id_is_kept
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:992
Method
test_client_workspace_id_is_kept
(self, client: AnthropicBedrockMantle, respx_mock: MockRouter)
tests/lib/test_bedrock_mantle.py:879
Function
test_client_workspace_id_is_kept_async
(respx_mock: MockRouter)
tests/lib/test_bedrock.py:1016
Function
test_close_and_with_mark_the_toolset_closed_sync
()
tests/lib/tools/toolsets/test_runner.py:707
Method
test_close_awaits_aclose
(self)
tests/lib/test_credentials.py:3930
Method
test_close_awaits_an_async_close
(self)
tests/lib/test_credentials.py:3943
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:3966
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:3954
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_closed_stream_has_no_output
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:5978
Method
test_closing_the_async_runner_ends_the_span_unset
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:1136
Method
test_closing_the_async_runner_from_a_tool_that_runs_while_the_reply_streams_stops_the_loop
( self, spans: Spans, respx_mock: MockRouter, reader: str )
tests/lib/tools/test_open_telemetry.py:1687
Method
test_closing_the_async_runner_from_a_toolset_member_that_runs_while_the_reply_streams_stops_the_loop
( self, spans: Spans, respx_mock: MockRouter, reader: str )
tests/lib/tools/test_open_telemetry.py:1787
Method
test_closing_the_async_runner_while_it_works_stops_the_loop
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:1155
Method
test_closing_the_async_streaming_runner_during_a_compaction_closes_its_stream
( self, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_open_telemetry.py:1402
Method
test_closing_the_async_streaming_runner_from_another_task_ends_its_loop
( self, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_open_telemetry.py:1181
Method
test_closing_the_async_streaming_runner_twice_at_once_closes_it_once
( self, spans: Spans, respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_open_telemetry.py:1217
Method
test_closing_the_runner_ends_the_span_unset
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:948
Method
test_closing_the_runner_from_a_tool_stops_the_loop
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:1095
Method
test_closing_the_runner_from_a_tool_that_runs_while_the_reply_streams_stops_the_loop
( self, spans: Spans, respx_mock: MockRouter, reader: str )
tests/lib/tools/test_open_telemetry.py:1634
Method
test_closing_the_runner_from_a_toolset_member_that_runs_while_the_reply_streams_stops_the_loop
( self, spans: Spans, respx_mock: MockRouter, reader: str )
tests/lib/tools/test_open_telemetry.py:1738
Method
test_closing_the_stream_mid_passthrough_tears_down_without_a_fallback_request
( self, respx_mock: MockRouter )
tests/lib/test_refusal_fallback_streaming.py:1321
Method
test_closing_the_stream_mid_passthrough_tears_down_without_a_fallback_request
( self, respx_mock: MockRouter )
tests/lib/test_refusal_fallback_streaming.py:1881
Function
test_compact_before_next_turn_again_replaces_the_pending_compaction_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2904
Function
test_compact_before_next_turn_before_the_first_iteration_is_the_first_request_async
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:2882
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:608
Method
test_compaction
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:928
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:2003
Method
test_compaction_tokens_of_a_response_without_usage_of_its_own
( self, spans: Spans, respx_mock: MockRouter )
tests/test_open_telemetry.py:2019
← previous
next →
5,701–5,800 of 12,522, ranked by callers