Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,824 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,824
◇
Types & classes
4,274
↳
Endpoints
47
Method
test_thread_raises_on_clients_without_message_threads
(self, make_client: Callable[[], Any])
tests/lib/threads/test_tool_runner_threading.py:851
Method
test_thread_rejects_both_output_format_and_output_config_format
(self)
tests/lib/threads/test_beta_threads.py:1482
Method
test_thread_requires_the_fields_create_requires
( self, make_client: Callable[[], Anthropic | AsyncAnthropic], field: str )
tests/lib/threads/test_beta_threads.py:1931
Function
test_thread_status_event_types_all_tell_the_primary_thread
(events: Any)
tests/lib/tools/test_open_telemetry.py:2583
Function
test_thread_termination_after_end_turn_idle_does_not_cancel_idle_stop
A client can archive a child thread once the session is idle. Another idle need not follow the thread's terminated event, so the event must leave
tests/lib/tools/test_session_runner.py:1402
Function
test_thread_termination_after_failed_history_read_does_not_start_idle_countdown
An ask-gated call defers the countdown of an idle, the stream drops, and the history read fails. The session may have run since that idle, so drop
tests/lib/tools/test_session_runner.py:1569
Function
test_thread_termination_does_not_start_idle_countdown
The event neither starts the countdown after an idle that leaves the turn open, nor keeps it going once the session runs again.
tests/lib/tools/test_session_runner.py:1428
Method
test_thread_without_messages_starts_empty
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1967
Function
test_throws_on_an_index_gap
()
tests/lib/sessions/test_accumulate.py:96
Function
test_throws_on_event_delta_with_no_prior_snapshot
()
tests/lib/sessions/test_accumulate.py:102
Method
test_time_to_first_chunk_counts_from_the_first_attempt
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:1077
Method
test_time_to_first_chunk_is_set_at_the_first_content_block_delta
( self, content_block: dict[str, Any], delta: dict[str, Any], spans: Spans, respx_mock: MockRouter
tests/test_open_telemetry.py:1807
Method
test_timeout
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:1042
Function
test_to_dict
()
tests/test_models.py:541
Method
test_to_dict_method
(self)
tests/lib/tools/test_functions.py:171
Function
test_to_json
()
tests/test_models.py:609
Function
test_to_session_content_document_passthrough
()
tests/lib/tools/test_session_runner.py:2227
Function
test_to_session_content_image_passthrough
()
tests/lib/tools/test_session_runner.py:2218
Function
test_to_session_content_search_result_passthrough
A `search_result` block — valid on the Sessions content union — passes through structurally so the model retains the typed citation metadata.
tests/lib/tools/test_session_runner.py:2237
Function
test_to_session_content_text_passthrough
()
tests/lib/tools/test_session_runner.py:2213
Function
test_to_session_content_tool_reference_stringified
`tool_reference` blocks have no Sessions equivalent and must be stringified.
tests/lib/tools/test_session_runner.py:2251
Method
test_token_endpoint_called_once_across_requests
(self, respx_mock: MockRouter)
tests/lib/test_credentials.py:2600
Function
test_token_provider_attaches_bearer
(respx_mock: MockRouter)
tests/lib/test_google_cloud.py:409
Function
test_token_provider_attaches_bearer_async
(respx_mock: MockRouter)
tests/lib/test_google_cloud.py:430
Function
test_token_provider_without_project_raises_on_first_request
()
tests/lib/test_google_cloud.py:853
Method
test_token_type_mismatch_does_not_retain_minted_token
(self)
tests/lib/test_credentials.py:5231
Function
test_too_many_positional_params
()
tests/test_required_args.py:8
Function
test_tool_addition_by_value_re_enables_removed_tool_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1159
Function
test_tool_addition_re_enables_removed_tool_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1112
Function
test_tool_addition_via_append_messages_re_enables_removed_tool_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1438
Method
test_tool_arguments_alone_over_the_bound_are_removed_whole
( self, city: str, size: int, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:670
Method
test_tool_arguments_exactly_at_the_bound_stay_and_one_over_are_removed_whole
(self)
tests/lib/tools/test_open_telemetry.py:645
Method
test_tool_call_caching
(self, snapshot_client: Anthropic)
tests/lib/tools/test_runners.py:285
Method
test_tool_call_error
( self, snapshot_client: Anthropic, caplog: pytest.LogCaptureFixture, )
tests/lib/tools/test_runners.py:214
Method
test_tool_call_that_the_application_holds_has_one_span_when_it_runs
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:1575
Method
test_tool_call_that_the_application_holds_on_an_async_runner_has_one_span_when_it_runs
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:1605
Function
test_tool_changes_go_out_with_the_compaction_request_and_follow_its_response
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:2086
Function
test_tool_changes_in_one_turn_are_sent_together_in_call_order
( sync: bool, order: str, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:1849
Function
test_tool_changes_made_before_the_first_request_follow_a_trailing_assistant_message
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:1719
Function
test_tool_changes_made_during_a_paused_turn_are_sent_one_request_later
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:2049
Function
test_tool_changes_pending_when_the_run_ends_are_not_sent
( sync: bool, ended_by: str, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:2168
Function
test_tool_changes_when_streaming
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:2201
Function
test_tool_configs_go_onto_the_entry_and_the_helper_tag_does_not
()
tests/lib/tools/toolsets/test_interface.py:199
Function
test_tool_configs_go_onto_the_entry_and_the_helper_tag_does_not
()
tests/lib/tools/toolsets/test_computer_interface.py:127
Method
test_tool_content_that_json_cannot_hold_is_not_recorded
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:730
Method
test_tool_description
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:850
Method
test_tool_description
(self, spans: Spans, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_open_telemetry.py:2541
Method
test_tool_error
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:351
Function
test_tool_error_content_with_a_lone_surrogate_does_not_break_the_next_request
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, cap
tests/lib/tools/test_runners.py:2313
Function
test_tool_error_preserves_structured_content
`ToolError` raised by the tool preserves its structured content rather than being stringified through `repr(e)`.
tests/lib/tools/test_session_runner.py:1970
Function
test_tool_error_text_with_a_lone_surrogate_does_not_break_the_next_request
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, cap
tests/lib/tools/test_runners.py:2270
Function
test_tool_removal_applies_when_the_history_has_a_system_message_without_content
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter )
tests/lib/tools/test_runners.py:1746
Function
test_tool_removal_in_compaction_tool_changes_routes_call_down_unknown_tool_path_sync
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:1557
Function
test_tool_removal_in_echoed_compaction_turn_routes_call_down_unknown_tool_path_sync
( respx_mock: MockRouter, )
tests/lib/tools/test_runners.py:1495
Function
test_tool_removal_of_member_name_does_not_withdraw_toolset
( client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, navigate: BetaFunct
tests/lib/tools/toolsets/test_runner.py:464
Function
test_tool_removal_routes_call_down_unknown_tool_path_async
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1214
Function
test_tool_removal_routes_call_down_unknown_tool_path_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1044
Function
test_tool_removal_via_append_messages_between_turns_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1282
Function
test_tool_removal_via_append_messages_same_turn_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1337
Function
test_tool_removal_via_set_messages_params_sync
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:1382
Function
test_tool_result_block_types_all_keep_their_fields_or_only_their_type
(tool_result: Any)
tests/test_open_telemetry.py:8440
Function
test_tool_result_builds_the_block_and_never_raises_a_tool_error
()
tests/lib/tools/toolsets/test_computer_pipeline.py:300
Method
test_tool_result_content
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:373
Method
test_tool_result_content_is_content_blocks
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:4966
Method
test_tool_result_content_is_within_the_clients_max_content_bytes
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:557
Method
test_tool_result_content_leaves_out_encrypted_fields
(self, spans: Spans, respx_mock: MockRouter)
tests/test_open_telemetry.py:5031
Method
test_tool_result_content_loses_its_last_blocks_over_the_content_limit
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:510
Function
test_tool_result_echoes_toolset_name_and_passes_the_tool_use_as_context
()
tests/lib/tools/toolsets/test_runnable.py:66
Function
test_tool_result_maps_the_pipeline_onto_a_result_block_and_passes_the_tool_use_along
()
tests/lib/tools/toolsets/test_pipeline.py:599
Function
test_tool_result_maps_tool_error_to_is_error_text_content
()
tests/lib/tools/toolsets/test_runnable.py:106
Function
test_tool_result_propagates_the_developer_error_class_only
()
tests/lib/tools/toolsets/test_runnable.py:168
Function
test_tool_result_rejects_block_of_another_family
(toolset_name: str | None)
tests/lib/tools/toolsets/test_runnable.py:184
Function
test_tool_result_reports_any_other_exception_to_the_model
()
tests/lib/tools/toolsets/test_runnable.py:161
Function
test_tool_result_text_with_a_lone_surrogate_does_not_break_the_next_request
( sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter, cap
tests/lib/tools/test_runners.py:2354
Method
test_tool_result_without_content_has_an_empty_list
( self, returned: object, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:450
Function
test_tool_runner_accepts_a_generator_of_tools
( respx_mock: MockRouter, client: Anthropic, async_client: AsyncAnthropic, flavour: str )
tests/lib/tools/toolsets/test_runner.py:797
Method
test_tool_runner_and_tool_spans
(self, spans: Spans, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:305
Function
test_tool_runner_method_definition_in_sync
(sync: bool)
tests/lib/streaming/test_beta_messages.py:1066
Function
test_tool_runner_method_in_sync
(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
tests/lib/tools/test_runners.py:2448
Function
test_tool_runner_method_returns_session_tool_runner
()
tests/lib/tools/test_session_runner.py:2152
Function
test_tool_runner_rejects_a_function_tool_of_the_other_flavour
( client: Anthropic, async_client: AsyncAnthropic )
tests/lib/tools/toolsets/test_runner.py:767
Method
test_tool_runner_span_has_its_attributes_from_its_start
(self, respx_mock: MockRouter)
tests/lib/tools/test_open_telemetry.py:1005
Method
test_tool_span
(self, spans: Spans, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_open_telemetry.py:2173
Method
test_tool_that_runs_while_the_reply_streams_has_its_span
( self, spans: Spans, respx_mock: MockRouter, city: str )
tests/lib/tools/test_open_telemetry.py:1500
Method
test_tool_that_the_application_runs_between_items_has_the_conversation_id
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:778
Method
test_tool_that_the_application_runs_is_a_child_of_the_applications_span
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:797
Method
test_tool_that_the_application_runs_on_an_async_runner_is_a_child_of_the_applications_span
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:831
Method
test_tool_that_the_application_runs_with_no_current_span_is_a_root_span
( self, spans: Spans, respx_mock: MockRouter )
tests/lib/tools/test_open_telemetry.py:815
Function
test_tool_timeout
Tool that exceeds `TOOL_TIMEOUT` yields with `is_error=True` and a `"timed out"` message — distinct from the generic exception path.
tests/lib/tools/test_session_runner.py:1890
Function
test_tool_timeout_exceeds_bash_default
`TOOL_TIMEOUT` MUST stay strictly greater than the bash tool's own `BASH_DEFAULT_TIMEOUT`. If they were equal the outer per-tool-call `fail_a
tests/lib/tools/test_session_runner.py:1953
Function
test_tool_timeout_fires_for_blocking_sync_tool
A sync tool that blocks past `TOOL_TIMEOUT` is reported timed out at the deadline; its thread is abandoned rather than awaited.
tests/lib/tools/test_session_runner.py:1931
Method
test_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:340
Method
test_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:645
Method
test_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:460
Method
test_tool_use
(self, respx_mock: MockRouter)
tests/lib/streaming/test_beta_messages.py:829
Method
test_tool_use_caller_omitted
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:387
Method
test_tool_use_caller_omitted
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:695
Method
test_tool_use_invalid_json
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:373
Method
test_tool_use_invalid_json
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:680
Method
test_tool_use_round_trip
(self, respx_mock: MockRouter)
tests/lib/streaming/test_messages.py:400
← previous
next →
11,501–11,600 of 12,824, ranked by callers