Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
4,447 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
4,447
◇
Types & classes
1,509
↳
Endpoints
24
↓ 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
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
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
Function
drive
()
tests/lib/tools/test_session_runner.py:532
↓ 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
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
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
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
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:18
↓ 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
↓ 1 callers
Function
main
()
examples/agents_with_files.py:9
↓ 1 callers
Function
make_stream_iterator
( content: Iterator[bytes], *, sync: bool, client: Anthropic, async_client: AsyncAnthropic
tests/test_streaming.py:284
↓ 1 callers
Function
make_tool_searcher
Returns a tool that Claude can use to search through all available tools
examples/tools_runner_search_tool.py:47
↓ 1 callers
Function
my_iter
()
tests/test_transform.py:426
↓ 1 callers
Method
note_event
Arm the clock on an ``end_turn`` idle, disarm it on anything else.
src/anthropic/lib/tools/_beta_session_runner.py:143
↓ 1 callers
Function
parse_date
(value: date | StrBytesIntFloat)
src/anthropic/_compat.py:24
↓ 1 callers
Function
parse_datetime
(value: Union[datetime, StrBytesIntFloat])
src/anthropic/_compat.py:27
↓ 1 callers
Method
parsed_snapshot
(self)
src/anthropic/lib/streaming/_types.py:32
↓ 1 callers
Function
platform_headers
(version: str, *, platform: Platform | None)
src/anthropic/_base_client.py:2479
↓ 1 callers
Method
platform_headers
(self)
src/anthropic/_base_client.py:763
↓ 1 callers
Method
poller
Async-iterate work items claimed from a self-hosted environment. Each yielded item has been ack'd. The environment key authenticates the
src/anthropic/resources/beta/environments/work.py:1113
↓ 1 callers
Function
profile_to_ini
Convert an AWS config profile to an INI format string.
tests/lib/test_bedrock.py:36
↓ 1 callers
Function
push
(line: str)
src/anthropic/lib/tools/agent_toolset.py:680
↓ 1 callers
Function
read_file_content
(file: FileContent)
src/anthropic/_files.py:79
↓ 1 callers
Function
refresh_auth
(credentials: Credentials)
src/anthropic/lib/vertex/_auth.py:41
↓ 1 callers
Method
rename
Rename or move a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:272
↓ 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:112
↓ 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:508
↓ 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:96
↓ 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:406
↓ 1 callers
Function
rich_print_str
Like `rich.print()` but returns the string instead
tests/lib/utils.py:66
↓ 1 callers
Function
run_runnable_tool
Call ``tool`` with ``input``, awaiting the result if the tool is async. Bridges the sync (:class:`~anthropic.lib.tools.BetaFunctionTool`) and asy
src/anthropic/lib/tools/_tool_dispatch.py:60
↓ 1 callers
Method
setup_skills
Download the session agent's skills into ``{workdir}/skills/<name>/``. No-op unless both :attr:`client` and :attr:`session_id` are set. The
src/anthropic/lib/tools/agent_toolset.py:222
↓ 1 callers
Function
skeleton
Compact structural skeleton of a spliced stream — no text content.
tests/lib/test_refusal_fallback_streaming.py:166
↓ 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:128
← previous
next →
701–800 of 4,447, ranked by callers