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
↓ 1 callers
Function
end_api_call_span_when_body_ends
Ends the call span when the application has read, closed or dropped the body of `response`. A body that was read before the call returned ends th
src/anthropic/_tracing.py:438
↓ 1 callers
Function
end_tool_use_span
Ends the span with the run's result. An error result fails it with `tool_error`, and none leaves its status unset. Never raises.
src/anthropic/lib/_tracing/_tools.py:188
↓ 1 callers
Method
ended_by
(self, time: float)
src/anthropic/lib/tools/_beta_session_runner.py:974
↓ 1 callers
Function
ending
(data: st.DataObject, at: float)
tests/lib/tools/test_session_runner_properties.py:492
↓ 1 callers
Function
env_max_content_bytes
The `max_content_bytes` that the environment sets, or `None` when its value is not valid. A valid value is ASCII decimal digits, with or without
src/anthropic/_tracing.py:216
↓ 1 callers
Function
env_open_telemetry
The option that the environment variables make, for a client that is given no `open_telemetry` option. It has only what a variable changes from t
src/anthropic/_tracing.py:197
↓ 1 callers
Function
error_type
The `error.type` of a failed operation: the type of the API's error envelope, or else the status code.
src/anthropic/_tracing.py:765
↓ 1 callers
Function
errors
(change: dict[str, Any])
tests/lib/tools/toolsets/test_surface.py:153
↓ 1 callers
Function
event
(name: str, data: dict[str, Any])
tests/lib/tools/toolsets/test_runner.py:80
↓ 1 callers
Function
event_names
(stream: httpx2.Response)
tests/lib/tools/test_fake_sessions_api.py:53
↓ 1 callers
Method
execute
Execute a memory command and return the result. This method dispatches to the appropriate handler method based on the command type (v
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:110
↓ 1 callers
Method
execute
Execute a memory command and return the result. This method dispatches to the appropriate handler method based on the command type (v
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:223
↓ 1 callers
Method
execute
Dispatch one member call to its method. Override it, calling `super().execute(context, name, input)`, for before/after hooks around every memb
src/anthropic/lib/tools/_toolsets/_computer.py:198
↓ 1 callers
Method
execute
Dispatch one member call to its method; see the synchronous class's `execute`. Members are async here; one written sync is a contract error.
src/anthropic/lib/tools/_toolsets/_computer.py:317
↓ 1 callers
Method
execute
Dispatch one member call to its method. Override it, calling `super().execute(context, name, input)`, for before/after hooks around every mem
src/anthropic/lib/tools/_toolsets/_browser.py:314
↓ 1 callers
Method
execute
Dispatch one member call to its method. See the synchronous class's `execute`. Members are async here, and one written sync is a contract erro
src/anthropic/lib/tools/_toolsets/_browser.py:565
↓ 1 callers
Method
execute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_computer_pipeline.py:443
↓ 1 callers
Function
expand
(text: str)
tests/lib/tools/toolsets/test_pipeline.py:857
↓ 1 callers
Function
expected_metadata
The header lines, in any order, and the description
scripts/utils/check-dist.py:77
↓ 1 callers
Method
extract
(self, carrier: Any, context: Context | None = None, getter: Any = None)
tests/test_open_telemetry.py:7917
↓ 1 callers
Function
extract_stream_chunk_type
Given a type like `Stream[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g. ```
src/anthropic/_streaming.py:464
↓ 1 callers
Method
fail
(*_args: object)
tests/test_open_telemetry.py:1166
↓ 1 callers
Function
failing
(_item: object)
tests/lib/environments/test_poller.py:30
↓ 1 callers
Function
failing
(send: Any)
tests/lib/tools/memory_sync/test_lost_response.py:43
↓ 1 callers
Function
fetch_token_from_my_auth_service
(*, force_refresh: bool = False)
examples/workload_identity.py:168
↓ 1 callers
Function
file_metadata_body
()
tests/test_middleware.py:367
↓ 1 callers
Function
fill
(target: Dict[str, Any], key: str, env_var: str)
src/anthropic/lib/credentials/_providers.py:94
↓ 1 callers
Function
final_text
The text that the stream helper of a client of `spans` accumulates.
tests/test_open_telemetry.py:7948
↓ 1 callers
Function
find_breaking_changes
( new_obj: griffe.Object | griffe.Alias, old_obj: griffe.Object | griffe.Alias, *, path: list[
scripts/detect-breaking-changes.py:59
↓ 1 callers
Method
finish
The session's last sync — once, at a clean end. Same reconciliation as the cadence syncs, but server deletes skip the waiting window
src/anthropic/lib/tools/_memories.py:345
↓ 1 callers
Method
finish
Render the call's outcome with the browser state the driver just reported. On success the content is the member's rendering plus the `browser
src/anthropic/lib/tools/_toolsets/_pipeline.py:168
↓ 1 callers
Method
finished
(self, session: FakeSession)
tests/lib/tools/_fake_sessions_api.py:894
↓ 1 callers
Function
fn
(_input: object)
tests/lib/tools/_fake_sessions_api.py:844
↓ 1 callers
Method
form
The multipart content that `body` is sent as next to a file.
tests/test_prepare.py:98
↓ 1 callers
Function
format_code_blocks
Formats all the given blocks with one run of ruff, as starting ruff takes far longer than formatting a block. Exits if ruff can't format one of t
scripts/utils/ruffen-docs.py:20
↓ 1 callers
Function
function_has_argument
Returns whether or not the given function has a specific parameter
src/anthropic/_utils/_reflection.py:24
↓ 1 callers
Method
generate_tool_call_response
Generate a MessageParam by calling tool functions with any tool use blocks from the last message. Note the tool call response is cached, repe
src/anthropic/lib/tools/_beta_runner.py:1314
↓ 1 callers
Method
get_api_list
( self, path: str, *, model: Type[object], page: Type[SyncPageT],
src/anthropic/_base_client.py:1753
↓ 1 callers
Function
get_caller_name
(*, stacklevel: int = 1)
tests/lib/utils.py:50
↓ 1 callers
Method
get_client
(self)
src/anthropic/_vendor/httpx_aiohttp/transport.py:122
↓ 1 callers
Method
get_credentials
(self)
tests/lib/test_aws_auth.py:590
↓ 1 callers
Method
get_final_message
Waits until the stream has been read to completion and returns the accumulated `Message` object.
src/anthropic/lib/streaming/_beta_messages.py:102
↓ 1 callers
Method
get_final_message
Waits until the stream has been read to completion and returns the accumulated `Message` object.
src/anthropic/lib/streaming/_beta_messages.py:274
↓ 1 callers
Method
get_final_message
Waits until the stream has been read to completion and returns the accumulated `Message` object.
src/anthropic/lib/streaming/_messages.py:263
↓ 1 callers
Function
get_model_config
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:105
↓ 1 callers
Function
get_python_runtime
()
src/anthropic/_base_client.py:2710
↓ 1 callers
Function
get_python_version
()
src/anthropic/_base_client.py:2717
↓ 1 callers
Function
get_response_stream_shape
()
src/anthropic/lib/bedrock/_stream_decoder.py:15
↓ 1 callers
Function
get_tracer
The tracer for a client with the resolved `options`, or `None` when the client has no spans. A client has none when its spans are disabled, which
src/anthropic/_tracing.py:241
↓ 1 callers
Function
get_weather
Lookup the weather for a given city in either celsius or fahrenheit Args: location: The city and state, e.g. San Francisco, CA
tests/lib/tools/test_runners.py:537
↓ 1 callers
Function
get_weather
Lookup the weather for a given city. Args: location: The city, e.g. San Francisco
tests/lib/threads/helpers.py:126
↓ 1 callers
Function
git
(repo: Path, *args: str)
tests/test_detect_breaking_changes.py:48
↓ 1 callers
Function
git_hash
(data: bytes)
scripts/utils/check-dist.py:47
↓ 1 callers
Function
global_tracer_provider_loads
Whether OpenTelemetry can give its global tracer provider, which a client without a `tracer_provider` uses. Asked once: OpenTelemetry loads the p
src/anthropic/_tracing.py:262
↓ 1 callers
Method
handle
(self, request: APIRequest, call_next: CallNext)
src/anthropic/lib/middleware/_fallbacks.py:199
↓ 1 callers
Method
handle
(self, request: APIRequest, call_next: CallNext)
tests/test_middleware.py:235
↓ 1 callers
Method
handle
(self, client: str, http: httpx2.Request)
tests/lib/environments/_fake_work_api.py:323
↓ 1 callers
Method
handle_async
(self, request: APIRequest, call_next: AsyncCallNext)
tests/test_middleware.py:239
↓ 1 callers
Function
has_async_close
True if the provider's `close()` is `async def`, which only `AsyncAnthropic` can await.
src/anthropic/lib/credentials/_close.py:27
↓ 1 callers
Function
has_upper_bound
(requirement: Requirement)
scripts/utils/check-dependency-caps.py:25
↓ 1 callers
Function
header_value
The header `value` as an attribute of `type`: its parts between commas for a list. `None` for an empty one.
src/anthropic/_tracing.py:852
↓ 1 callers
Method
hold_during
Runs `serve` once the item is claimed, cancels it when the lease ends, and then stops the item.
src/anthropic/lib/environments/_lease.py:54
↓ 1 callers
Function
human_join
(seq: Sequence[str], *, delim: str = ", ", final: str = "or")
src/anthropic/_utils/_utils.py:207
↓ 1 callers
Function
image_block
One image block around the base64 `data` a screenshot or zoom member returned.
src/anthropic/lib/tools/_toolsets/_render.py:95
↓ 1 callers
Function
in_one_chunk
(call: Call)
tests/lib/tools/test_session_runner.py:104
↓ 1 callers
Method
inject
(self, carrier: Any, context: Context | None = None, setter: Any = None)
tests/test_open_telemetry.py:7921
↓ 1 callers
Function
input_field
(input: BaseModel, path: str)
src/anthropic/lib/tools/_toolsets/_render.py:63
↓ 1 callers
Function
input_problem
One pydantic error as `loc: message` (the value is not echoed).
src/anthropic/lib/tools/_toolsets/_base.py:525
↓ 1 callers
Method
insert
Insert text at a specific line number in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:264
↓ 1 callers
Method
interrupt
The log shows no interrupt that names a subagent.
tests/lib/tools/_fake_sessions_api.py:460
↓ 1 callers
Function
is_basemodel
Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`
src/anthropic/_models.py:611
↓ 1 callers
Method
is_behind_unanswered_call
(self, event: DispatchedToolUseEvent, tools: Container[str])
src/anthropic/lib/tools/_beta_session_runner.py:722
↓ 1 callers
Function
is_ipv4_hostname
(hostname: str)
src/anthropic/_utils/_httpx.py:16
↓ 1 callers
Function
is_ipv6_hostname
(hostname: str)
src/anthropic/_utils/_httpx.py:24
↓ 1 callers
Function
is_iterable
(obj: object)
src/anthropic/_utils/_utils.py:202
↓ 1 callers
Method
is_path_visible
Whether a `download_completed` path may reach the model. Only `True` shows it; any other answer forwards the event without it.
src/anthropic/lib/tools/_toolsets/_hooks.py:70
↓ 1 callers
Function
is_primitive
(value: object)
src/anthropic/lib/_parse/_transform.py:246
↓ 1 callers
Function
is_sequence
(obj: object)
src/anthropic/_utils/_utils.py:178
↓ 1 callers
Function
is_sequence_type
(typ: type)
src/anthropic/_utils/_typing.py:29
↓ 1 callers
Function
is_stream_class_type
TypeGuard for determining whether or not the given type is a subclass of `Stream` / `AsyncStream`
src/anthropic/_streaming.py:458
↓ 1 callers
Function
is_typevar
(typ: type)
src/anthropic/_utils/_typing.py:48
↓ 1 callers
Method
is_unanswered
The session can hold back the result of any other call until the later calls have theirs.
src/anthropic/lib/tools/_beta_session_runner.py:861
↓ 1 callers
Method
is_waiting_on
(self, id: str)
src/anthropic/lib/tools/_beta_session_runner.py:709
↓ 1 callers
Function
item_runs
(trace: Trace, worker: str)
tests/lib/environments/test_worker_properties.py:215
↓ 1 callers
Function
items
()
tests/test_prepare.py:572
↓ 1 callers
Method
iter_bytes
(self)
tests/test_open_telemetry.py:640
↓ 1 callers
Method
iter_pages
(self: SyncPageT)
src/anthropic/_base_client.py:312
↓ 1 callers
Method
iter_pages
(self: AsyncPageT)
src/anthropic/_base_client.py:395
↓ 1 callers
Function
iter_work
Iterate work items claimed from a self-hosted environment. Each yielded `BetaSelfHostedWork` has already been ack'd, and an item whose ack fa
src/anthropic/lib/environments/_poller.py:92
↓ 1 callers
Function
js_call
A call to the browser's `javascript_exec`.
tests/lib/tools/test_runner_eager_toolsets.py:424
↓ 1 callers
Function
json_body
(response: httpx2.Response)
src/anthropic/_tracing.py:692
↓ 1 callers
Function
json_safe
Translates a mapping / sequence recursively in the same fashion as `pydantic` v2's `model_dump(mode="json")`.
src/anthropic/_utils/_utils.py:452
↓ 1 callers
Function
kind_of
(http: httpx2.Request)
tests/lib/environments/_fake_work_api.py:508
↓ 1 callers
Function
layout
The identity and contents of `value` and of everything inside it.
tests/test_prepare.py:680
↓ 1 callers
Method
limit_posts_to
Counts from now for a post that has begun, and from its start for a later one.
src/anthropic/lib/tools/_beta_session_runner.py:912
↓ 1 callers
Method
limit_tools_to
(self, seconds: float)
src/anthropic/lib/tools/_beta_session_runner.py:908
↓ 1 callers
Function
lists_in
The list types among the members of a union.
tests/test_open_telemetry.py:8279
↓ 1 callers
Function
load_auth
(*, project_id: str | None)
src/anthropic/lib/vertex/_auth.py:17
↓ 1 callers
Function
load_default_credentials
Load Application Default Credentials with the `cloud-platform` scope and mint an initial access token. Returns the credentials object and the
src/anthropic/lib/_extras/_google_auth.py:46
↓ 1 callers
Function
load_fixture
Load a fixture file from the fixtures directory.
tests/lib/streaming/helpers.py:10
← previous
next →
1,701–1,800 of 13,873, ranked by callers