Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
5,068 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
5,068
◇
Types & classes
1,620
↳
Endpoints
13
↓ 1 callers
Function
consume
()
tests/lib/tools/test_session_runner.py:1317
↓ 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:1258
↓ 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:219
↓ 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:94
↓ 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:605
↓ 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:96
↓ 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:249
↓ 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:245
↓ 1 callers
Function
get_model_config
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:110
↓ 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:191
↓ 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
has_upper_bound
(requirement: Requirement)
scripts/utils/check-dependency-caps.py:25
↓ 1 callers
Method
heartbeat
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:312
↓ 1 callers
Function
human_join
(seq: Sequence[str], *, delim: str = ", ", final: str = "or")
src/anthropic/_utils/_utils.py:207
↓ 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:277
↓ 1 callers
Method
iter_pages
(self: AsyncPageT)
src/anthropic/_base_client.py:357
↓ 1 callers
Method
json
(self, **kwargs: Any)
src/anthropic/_legacy_response.py:438
↓ 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
()
scripts/utils/check-dependency-caps.py:29
↓ 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:23
↓ 1 callers
Function
main
()
examples/agents_comprehensive.py:17
↓ 1 callers
Function
main
()
examples/agents.py:8
↓ 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/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
message_text
(event: BetaManagedAgentsAgentMessageEvent)
examples/managed-agents-streaming-deltas-manual.py:19
↓ 1 callers
Function
model_json
(model: pydantic.BaseModel, *, indent: int | None = None)
src/anthropic/_compat.py:128
↓ 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. ``user.tool_confirmation`` events are neutral: they signal neither agent
src/anthropic/lib/tools/_beta_session_runner.py:178
↓ 1 callers
Function
parse_date
(value: date | StrBytesIntFloat)
src/anthropic/_compat.py:24
↓ 1 callers
Function
parse_date
(value: Union[date, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:40
↓ 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:762
↓ 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:39
↓ 1 callers
Function
public_members
(obj: griffe.Object | griffe.Alias)
scripts/detect-breaking-changes.py:13
↓ 1 callers
Function
push
(line: str)
src/anthropic/lib/tools/agent_toolset.py:841
↓ 1 callers
Function
read_file_content
(file: FileContent)
src/anthropic/_files.py:77
↓ 1 callers
Method
refresh
(self, _request: object)
tests/lib/test_google_cloud.py:58
↓ 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
Get a specific model. The Models API response can be used to determine information about a specific model or resolve a model
src/anthropic/resources/models.py:44
↓ 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_and_time
()
tests/lib/tools/test_session_runner.py:1131
↓ 1 callers
Function
scan
(full: Path)
src/anthropic/lib/tools/agent_toolset.py:850
↓ 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:275
↓ 1 callers
Function
skeleton
Compact structural skeleton of a spliced stream — no text content.
tests/lib/test_refusal_fallback_streaming.py:171
↓ 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
↓ 1 callers
Method
start
Track a content_block_start, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1246
↓ 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:257
↓ 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:577
↓ 1 callers
Method
stringify
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:36
↓ 1 callers
Method
sync_auth_flow
(self, request: httpx.Request)
src/anthropic/lib/credentials/_auth.py:105
↓ 1 callers
Function
sync_client
()
examples/vertex.py:6
← previous
next →
801–900 of 5,068, ranked by callers