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
↓ 1 callers
Function
read_sdist
Readers differ in how they take odd headers, so every byte has to be what plain files give
scripts/utils/check-dist.py:163
↓ 1 callers
Function
read_wheel
Readers go by the directory at the end, by the header before each file or by both, so all of it has to agree
scripts/utils/check-dist.py:125
↓ 1 callers
Function
reconnects
(data: st.DataObject, steps: list[Step])
tests/lib/tools/test_session_runner_properties.py:503
↓ 1 callers
Function
record_api_call
Sets the attributes of the call that are not read off its request or its response as they are. Never raises. Returns the observer that records a
src/anthropic/lib/_tracing/_api_call.py:55
↓ 1 callers
Function
record_messages_create
Records the response of a `messages.create` call, and in content mode the request's messages too. A streamed Message is recorded from its events
src/anthropic/lib/_tracing/_api_call.py:74
↓ 1 callers
Method
record_partial_reply
Record a turn whose stream ended after `message_start` and before `message_stop`. The next turn starts a new thread because the server holds e
src/anthropic/lib/threads/_thread_state.py:343
↓ 1 callers
Method
refresh
(self, _request: object)
tests/lib/test_google_cloud.py:58
↓ 1 callers
Function
refuse
(context: BetaConfirmContext)
tests/lib/tools/toolsets/test_refusals.py:139
↓ 1 callers
Function
refused
(**options: Any)
tests/lib/tools/toolsets/test_computer_interface.py:271
↓ 1 callers
Method
rename
Rename or move a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:274
↓ 1 callers
Function
render_browser_state
The `browser_state` block: the driver's tabs as reported with each URL and title folded to one line and held to the API's length limit, and `chang
src/anthropic/lib/tools/_toolsets/_render.py:225
↓ 1 callers
Function
report_of
The checked `BetaBrowserState` as the `Report` that `finish` renders: its tabs and wire changes as they stand, the SDK's own change kinds set apar
src/anthropic/lib/tools/_toolsets/_pipeline.py:94
↓ 1 callers
Function
reported_names
(repo: Path, *, baseline: dict[str, str], tip: dict[str, str])
tests/test_detect_breaking_changes.py:61
↓ 1 callers
Function
request_attributes
What every request of the call has in common. The call span starts with these, so that a sampler sees them.
src/anthropic/_tracing.py:860
↓ 1 callers
Function
request_header
The value that the last of `layers` to set the header `name` gives it. An `Omit` there leaves the header out.
src/anthropic/_tracing.py:842
↓ 1 callers
Function
request_path
(template: str, /, **values: object)
src/anthropic/lib/vertex/_client.py:426
↓ 1 callers
Function
requests_of
(make_runner: Callable[[Any, Any], Any])
tests/lib/tools/test_runners.py:3636
↓ 1 callers
Function
requirement
`text` as hatchling writes it
scripts/utils/check-dist.py:65
↓ 1 callers
Function
resolve_assignment_alias
(obj: griffe.Object | griffe.Alias)
scripts/detect-breaking-changes.py:13
↓ 1 callers
Function
resolve_import
(obj: griffe.Object | griffe.Alias)
scripts/detect-breaking-changes.py:35
↓ 1 callers
Function
resolve_open_telemetry
`option` with `propagation` and every field of its `traces`. The environment variables are for a client that is given no option, `None`: `env_ope
src/anthropic/_tracing.py:154
↓ 1 callers
Method
resolve_upload_documents
(self, context: BetaURLContext, document_ids: Sequence[str])
src/anthropic/lib/tools/_toolsets/_security.py:231
↓ 1 callers
Method
resolve_upload_documents
(self, context: Any, document_ids: Any)
tests/lib/tools/toolsets/test_enforcement.py:268
↓ 1 callers
Function
resolve_upload_paths
For `file_upload`: run `input.paths` and `input.document_ids` through the file policy before dispatch, so the driver receives what the policy retu
src/anthropic/lib/tools/_toolsets/_pipeline.py:340
↓ 1 callers
Method
resolve_upload_paths
(self, context: BetaURLContext, paths: Sequence[str])
src/anthropic/lib/tools/_toolsets/_security.py:228
↓ 1 callers
Method
resolve_upload_paths
(self, context: Any, paths: Any)
tests/lib/tools/toolsets/test_confirm.py:77
↓ 1 callers
Method
result
(tool_use_id: str, stdout: str)
tests/test_open_telemetry.py:6063
↓ 1 callers
Function
result_block_content
(content: object)
src/anthropic/lib/_tracing/_content.py:354
↓ 1 callers
Function
resumed_with
(*calls: Call)
tests/lib/tools/test_session_runner.py:352
↓ 1 callers
Method
retrieve
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a re
src/anthropic/resources/beta/messages/batches.py:141
↓ 1 callers
Method
retrieve
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a re
src/anthropic/resources/beta/messages/batches.py:647
↓ 1 callers
Method
retrieve
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a re
src/anthropic/resources/messages/batches.py:135
↓ 1 callers
Method
retrieve
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a re
src/anthropic/resources/messages/batches.py:576
↓ 1 callers
Function
rich_print_str
Like `rich.print()` but returns the string instead
tests/lib/utils.py:66
↓ 1 callers
Function
rows
()
tests/test_prepare.py:779
↓ 1 callers
Method
run
Poll the environment and service each claimed session until cancelled. Loops forever; cancel the task (or wrap it in `asyncio.wait_for`)
src/anthropic/lib/environments/_worker.py:307
↓ 1 callers
Function
run_runnable_tool
Call `tool` with `input`, awaiting the result if the tool is async. Sync tools run on a worker thread. If the caller cancels (for example on a
src/anthropic/lib/tools/_tool_dispatch.py:302
↓ 1 callers
Function
runner
(*args: Any, **options: Any)
tests/lib/tools/test_session_runner_properties.py:600
↓ 1 callers
Function
same_messages
(a: Sequence[BetaMessageParam], b: Sequence[BetaMessageParam])
src/anthropic/lib/threads/_thread_state.py:631
↓ 1 callers
Function
scan
(full: Path)
src/anthropic/lib/tools/agent_toolset.py:1229
↓ 1 callers
Function
scoped_and_copy
(parent: ClientT)
tests/lib/test_scoped_client.py:326
↓ 1 callers
Method
select
(self, timeout: float | None = None)
tests/lib/tools/_fake_sessions_api.py:1033
↓ 1 callers
Function
serialize_data
The JSON text that `data` is sent as once prepared.
src/anthropic/_utils/_prepare.py:75
↓ 1 callers
Function
serve
(self: Any, context: Any, input: Any)
tests/lib/tools/toolsets/test_computer_interface.py:244
↓ 1 callers
Function
serve_stream
Serves the `stream_events` to each request on a local port, and gives the base URL.
tests/test_open_telemetry.py:654
↓ 1 callers
Function
server_attributes
(base_url: httpx2.URL)
src/anthropic/_tracing.py:874
↓ 1 callers
Function
set_created_id_attribute
Sets the ID of the object that the call created, from the response field that `span_created_id` names.
src/anthropic/_tracing.py:459
↓ 1 callers
Method
set_current
(self, thread: str | None)
src/anthropic/lib/tools/_beta_session_runner.py:960
↓ 1 callers
Function
set_time_to_first_chunk
(span: AnthropicSpan, start_time: int)
src/anthropic/lib/_tracing/_response.py:18
↓ 1 callers
Function
set_url_attributes
Sets the `url.*` attributes for a request to `url`. Of its query, they have only the `query_params`. A query that is content, and the full URL th
src/anthropic/_tracing.py:703
↓ 1 callers
Method
setup_skills
Download the skills of the session's agent and its subagents into `{workdir}/skills/<name>/`. No-op unless `client` is set together with `ses
src/anthropic/lib/tools/agent_toolset.py:335
↓ 1 callers
Method
share_snapshot
(self, reader: SnapshotReader)
src/anthropic/lib/_tracing/_streaming.py:123
↓ 1 callers
Method
should_sample
(self, *args: Any, **kwargs: Any)
tests/test_open_telemetry.py:7909
↓ 1 callers
Function
skeleton
Compact structural skeleton of a spliced stream — no text content.
tests/lib/test_refusal_fallback_streaming.py:184
↓ 1 callers
Function
skill_response
(request: Request)
tests/lib/environments/_fake_work_api.py:556
↓ 1 callers
Function
skills_with_subagents
The first version of a skill wins.
src/anthropic/lib/tools/_skills.py:275
↓ 1 callers
Function
sleep_in_thread
Blocks a worker thread while the virtual clock advances.
tests/lib/environments/_schedules.py:306
↓ 1 callers
Function
sleeping
(seconds: float)
tests/lib/environments/test_worker_properties.py:341
↓ 1 callers
Function
span_ending_stream
The wrapper of the same kind as `body`, so that the checks of `httpx2.Response` on the kind still hold.
src/anthropic/_tracing.py:628
↓ 1 callers
Function
span_request_attributes
What `SPAN_ATTRIBUTES` gives the span of the call from its request, for the span to start with. Never raises. A header has the value that the cal
src/anthropic/_tracing.py:780
↓ 1 callers
Function
sse
(event: dict[str, Any])
tests/lib/tools/test_runner_eager_tools.py:961
↓ 1 callers
Function
stainless_helper_header
Build x-stainless-helper header dict from tools and messages. Returns an empty dict if no helpers are found.
src/anthropic/lib/_stainless_helpers.py:148
↓ 1 callers
Method
start
Track a content_block_start, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1287
↓ 1 callers
Function
start_tool_runner_span
Starts the span of one loop of the Messages tool runner. The runner sets its status and ends it. Never raises: a loop whose span cannot start run
src/anthropic/lib/_tracing/_tools.py:34
↓ 1 callers
Method
start_turn
(self, thread: str = PRIMARY)
tests/lib/tools/_fake_sessions_api.py:313
↓ 1 callers
Method
stop
(self)
examples/memory/basic.py:55
↓ 1 callers
Method
str_replace
Replace text in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:259
↓ 1 callers
Method
stream_closed
(self, session: FakeSession, stream: Connection)
tests/lib/tools/_fake_sessions_api.py:900
↓ 1 callers
Method
stream_to_file
Streams the output to the given file. Accepts a filename or any path-like object, e.g. pathlib.Path
src/anthropic/_response.py:583
↓ 1 callers
Method
stringify
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:37
↓ 1 callers
Function
strip_annotated_type
(typ: type)
src/anthropic/_utils/_typing.py:76
↓ 1 callers
Function
strip_omit
(obj: None)
src/anthropic/_utils/_utils.py:329
↓ 1 callers
Method
sync_auth_flow
(self, request: httpx2.Request)
src/anthropic/lib/credentials/_auth.py:96
↓ 1 callers
Function
sync_client
()
tests/lib/test_google_cloud_live.py:33
↓ 1 callers
Function
sync_client
()
examples/vertex.py:11
↓ 1 callers
Method
sync_if_due
Run one sync when `sync_interval` has elapsed since the last. Stores sync in parallel; a store's own paths reconcile in a determinist
src/anthropic/lib/tools/_memories.py:485
↓ 1 callers
Function
sync_main
(loop: asyncio.AbstractEventLoop)
tests/lib/environments/_schedules.py:177
↓ 1 callers
Method
take_slot
(self)
src/anthropic/lib/tools/_memories.py:181
↓ 1 callers
Function
takes_pydantic
(model: pydantic.BaseModel)
tests/test_models.py:670
↓ 1 callers
Function
target_tab
Which tab a call targets: the tab it names by `tab_id`, else the active tab. `None` when the named tab is not in the report (or nothing is active)
src/anthropic/lib/tools/_toolsets/_pipeline.py:137
↓ 1 callers
Method
text
Read and decode the response content into a string.
src/anthropic/_response.py:378
↓ 1 callers
Method
text
(self)
src/anthropic/lib/tools/_files.py:85
↓ 1 callers
Method
texts
(self)
src/anthropic/lib/tools/agent_toolset.py:818
↓ 1 callers
Method
to_dict
Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude. By default, fields t
src/anthropic/_models.py:215
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_functions.py:75
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_functions.py:93
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_toolsets/_computer.py:118
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_toolsets/_browser.py:182
↓ 1 callers
Function
to_message
The reply as the message the API sends for it when not streaming.
tests/lib/tools/test_runner_eager_tools.py:944
↓ 1 callers
Function
to_thread
( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs )
src/anthropic/_utils/_sync.py:16
↓ 1 callers
Function
to_tool_params
Replace every `to_dict()`-bearing object in `tools` with its entry, keeping order and helper tags.
src/anthropic/lib/tools/_tool_params.py:31
↓ 1 callers
Function
tokens
(usage: object, field: str)
src/anthropic/lib/_tracing/_response.py:84
↓ 1 callers
Function
tool_description
(tool: object)
src/anthropic/lib/_tracing/_tools.py:157
↓ 1 callers
Method
tool_ended
(self, session: FakeSession, id: str)
tests/lib/tools/_fake_sessions_api.py:898
↓ 1 callers
Method
tool_started
(self, session: FakeSession, id: str)
tests/lib/tools/_fake_sessions_api.py:897
↓ 1 callers
Function
trace_context_injector
`opentelemetry.propagate.inject`, or `None` when the propagators that the environment names cannot be loaded.
src/anthropic/_tracing.py:896
↓ 1 callers
Function
traces_of
A copy of the `traces` of `options` as a dict. `True` and `False` are short for `enabled`.
src/anthropic/_tracing.py:232
↓ 1 callers
Function
truncate_tool_result_content
Serializes `blocks` to JSON within `limit` bytes of UTF-8, dropping the last blocks first. `size` gives the bytes of a string, and never fewer th
src/anthropic/lib/_tracing/_content.py:270
↓ 1 callers
Method
try_start
(self, call: DispatchedToolUseEvent, run: Callable[[RunningCall], Awaitable[None]])
src/anthropic/lib/tools/_beta_session_runner.py:921
↓ 1 callers
Function
two_tool_uses_response
(id: str)
tests/lib/threads/helpers.py:669
← previous
next →
1,901–2,000 of 14,068, ranked by callers