Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
4,863 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
4,863
◇
Types & classes
1,585
↳
Endpoints
26
↓ 1 callers
Function
_transform_file
(file: FileTypes)
src/anthropic/_files.py:65
↓ 1 callers
Function
_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:265
↓ 1 callers
Function
_union_members
Return the runtime classes in an `Annotated[Union[...], ...]` type alias.
tests/lib/streaming/test_parsed_content_blocks.py:18
↓ 1 callers
Method
_validate_headers
Validate the given default headers and custom headers. Does nothing by default.
src/anthropic/_base_client.py:731
↓ 1 callers
Method
_validate_headers
(self, headers: Headers, custom_headers: Headers)
src/anthropic/lib/aws/_client.py:139
↓ 1 callers
Function
_validate_no_symlink_escape
(target_path: Path, memory_root: Path)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:337
↓ 1 callers
Function
_validate_non_model_type
(*, type_: type[_T], value: object)
src/anthropic/_models.py:879
↓ 1 callers
Function
_wait_first
Return as soon as any of ``events`` is set.
src/anthropic/lib/tools/_beta_session_runner.py:952
↓ 1 callers
Function
_walk_grep
(rx: re.Pattern[str], search: Path)
src/anthropic/lib/tools/agent_toolset.py:676
↓ 1 callers
Method
aiter_lines
(self)
src/anthropic/_legacy_response.py:493
↓ 1 callers
Method
aiter_text
(self, chunk_size: int | None = None)
src/anthropic/_legacy_response.py:490
↓ 1 callers
Function
assert_empty_iter
(decoder: JSONLDecoder[Any] | AsyncJSONLDecoder[Any])
tests/decoders/test_jsonl.py:74
↓ 1 callers
Function
assert_incomplete_partial_input_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:214
↓ 1 callers
Function
assert_is_file_content
(obj: object, *, key: str | None = None)
src/anthropic/_files.py:35
↓ 1 callers
Function
assert_matches_model
(model: type[BaseModelT], value: BaseModelT, *, path: list[str])
tests/utils.py:28
↓ 1 callers
Function
assert_overloads_in_sync
Ensure that every @overload of overloaded_func contains all params from source_func.
src/anthropic/_utils/_reflection.py:46
↓ 1 callers
Function
async_client
()
examples/vertex.py:24
↓ 1 callers
Function
async_read_file_content
(file: FileContent)
src/anthropic/_files.py:121
↓ 1 callers
Function
async_stream
()
examples/text_completions_streaming.py:29
↓ 1 callers
Function
async_transform
Transform dictionaries based off of type information from the given type, for example: ```py class Params(TypedDict, total=False): ca
src/anthropic/_utils/_transform.py:299
↓ 1 callers
Function
backoff
Exponential backoff for ``attempt`` (1-indexed), capped at ``cap``.
src/anthropic/lib/_retry.py:32
↓ 1 callers
Function
beta_bash_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:432
↓ 1 callers
Method
build
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:191
↓ 1 callers
Method
build_request
(options: FinalRequestOptions)
tests/test_client.py:269
↓ 1 callers
Method
clear_all_memory
Override the base implementation to provide file system clearing.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:602
↓ 1 callers
Function
clear_locals
(string: str, *, stacklevel: int)
tests/lib/utils.py:61
↓ 1 callers
Method
close
Close the underlying HTTPX client. The client will *not* be usable after this.
src/anthropic/_base_client.py:1785
↓ 1 callers
Method
close
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_streaming.py:352
↓ 1 callers
Method
close
(self)
src/anthropic/lib/tools/agent_toolset.py:217
↓ 1 callers
Method
close
(self)
src/anthropic/lib/middleware/_fallbacks.py:1550
↓ 1 callers
Method
close
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_beta_messages.py:233
↓ 1 callers
Method
close
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_messages.py:229
↓ 1 callers
Method
close_open_blocks
content_block_stop events for any blocks still open.
src/anthropic/lib/middleware/_fallbacks.py:1242
↓ 1 callers
Function
coerce_float
(val: str)
src/anthropic/_utils/_utils.py:332
↓ 1 callers
Function
coerce_integer
(val: str)
src/anthropic/_utils/_utils.py:328
↓ 1 callers
Function
collect_helpers
Collect deduplicated helper names from tools and messages.
src/anthropic/lib/_stainless_helpers.py:97
↓ 1 callers
Function
conversation_loop
()
examples/memory/basic.py:70
↓ 1 callers
Method
copy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_client.py:421
↓ 1 callers
Method
copy
Create a new client re-using the current options, with optional overrides. See ``AnthropicGoogleCloud.copy`` for the override semantics.
src/anthropic/lib/google_cloud/_client.py:604
↓ 1 callers
Method
create
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:252
↓ 1 callers
Method
default
(self, o: Any)
src/anthropic/_utils/_json.py:30
↓ 1 callers
Method
delete
Delete a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:154
↓ 1 callers
Method
delete
Delete a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:267
↓ 1 callers
Method
delta
Apply a content_block_delta to its accumulating block, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1221
↓ 1 callers
Function
download_session_skills
Download the session agent's skills into ``{workdir}/skills/<name>/``. Looks up the session's resolved agent, and for each skill fetches its file
src/anthropic/lib/tools/_skills.py:188
↓ 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:221
↓ 1 callers
Function
field_outer_type
(field: FieldInfo)
src/anthropic/_compat.py:104
↓ 1 callers
Function
file_metadata_body
()
tests/test_middleware.py:366
↓ 1 callers
Function
fill
(target: Dict[str, Any], key: str, env_var: str)
src/anthropic/lib/credentials/_providers.py:93
↓ 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:23
↓ 1 callers
Function
finish_fragment
()
scripts/utils/ruffen-docs.py:56
↓ 1 callers
Function
format_file
( filename: str, skip_errors: bool, )
scripts/utils/ruffen-docs.py:122
↓ 1 callers
Function
format_str
( src: str, )
scripts/utils/ruffen-docs.py:33
↓ 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:594
↓ 1 callers
Function
get_architecture
()
src/anthropic/_base_client.py:2516
↓ 1 callers
Function
get_async_library
()
src/anthropic/_utils/_utils.py:403
↓ 1 callers
Function
get_caller_name
(*, stacklevel: int = 1)
tests/lib/utils.py:50
↓ 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:92
↓ 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:241
↓ 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:237
↓ 1 callers
Function
get_model_config
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:110
↓ 1 callers
Function
get_platform
()
src/anthropic/_base_client.py:2436
↓ 1 callers
Function
get_python_runtime
()
src/anthropic/_base_client.py:2502
↓ 1 callers
Function
get_python_version
()
src/anthropic/_base_client.py:2509
↓ 1 callers
Function
get_response_stream_shape
()
src/anthropic/lib/bedrock/_stream_decoder.py:15
↓ 1 callers
Method
handle
(self, request: APIRequest, call_next: CallNext)
src/anthropic/lib/middleware/_fallbacks.py:174
↓ 1 callers
Method
handle
(self, request: APIRequest, call_next: CallNext)
tests/test_middleware.py:234
↓ 1 callers
Method
handle_async
(self, request: APIRequest, call_next: AsyncCallNext)
tests/test_middleware.py:238
↓ 1 callers
Function
human_join
(seq: Sequence[str], *, delim: str = ", ", final: str = "or")
src/anthropic/_utils/_utils.py:207
↓ 1 callers
Method
id
(self)
src/anthropic/_streaming.py:385
↓ 1 callers
Method
insert
Insert text at a specific line number in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:262
↓ 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_typevar
(typ: type)
src/anthropic/_utils/_typing.py:48
↓ 1 callers
Method
iter_pages
(self: SyncPageT)
src/anthropic/_base_client.py:278
↓ 1 callers
Method
iter_pages
(self: AsyncPageT)
src/anthropic/_base_client.py:358
↓ 1 callers
Function
jitter
Uniform random delay in ``[low, high)`` — spreads out retry storms.
src/anthropic/lib/_retry.py:37
↓ 1 callers
Method
json
(self, **kwargs: Any)
src/anthropic/_legacy_response.py:434
↓ 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:420
↓ 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 t
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
↓ 1 callers
Function
lru_cache
A version of functools.lru_cache that retains the type signature for the wrapped function arguments.
src/anthropic/_utils/_utils.py:410
↓ 1 callers
Function
main
()
scripts/detect-breaking-changes.py:50
↓ 1 callers
Function
main
(argv: Sequence[str] | None = None)
scripts/utils/ruffen-docs.py:143
↓ 1 callers
Function
main
()
examples/web_search_stream.py:6
↓ 1 callers
Function
main
()
examples/managed-agents-streaming-deltas-manual.py:19
↓ 1 callers
Function
main
()
examples/agents_comprehensive.py:17
↓ 1 callers
Function
main
()
examples/agents.py:8
↓ 1 callers
Function
main
()
examples/text_completions_demo_sync.py:7
↓ 1 callers
Function
main
()
examples/managed-agents-worker-dispatch.py:48
↓ 1 callers
Function
main
()
examples/tools_runner.py:44
↓ 1 callers
Function
main
()
examples/text_completions_demo_async.py:9
↓ 1 callers
Function
main
()
examples/managed-agents-self-hosted-sandbox-worker.py:54
↓ 1 callers
Function
main
()
examples/tools_runner_search_tool.py:64
↓ 1 callers
Function
main
()
examples/messages_stream.py:10
↓ 1 callers
Function
main
()
examples/tools_stream.py:8
↓ 1 callers
Function
main
()
examples/fallbacks.py:6
↓ 1 callers
Function
main
()
examples/mcp_tool_runner.py:22
↓ 1 callers
Function
main
Primary scenario: drive a session yourself and watch each tool call. No work queue and no lease are involved — we create the session, send a
examples/managed-agents-observe-tool-calls.py:52
← previous
next →
701–800 of 4,863, ranked by callers