Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
4,911 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
4,911
◇
Types & classes
1,594
↳
Endpoints
26
↓ 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
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:169
↓ 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: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
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:771
↓ 1 callers
Function
read_file_content
(file: FileContent)
src/anthropic/_files.py:79
↓ 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:1110
↓ 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:134
↓ 1 callers
Function
scan
(full: Path)
src/anthropic/lib/tools/agent_toolset.py:780
↓ 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:269
↓ 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
Function
stream_error
()
examples/text_completions_streaming.py:43
↓ 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:569
↓ 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
↓ 1 callers
Function
sync_stream
()
examples/text_completions_streaming.py:15
↓ 1 callers
Function
takes_pydantic
(model: pydantic.BaseModel)
tests/test_models.py:637
↓ 1 callers
Function
to_aiter
(iter: Iterator[bytes])
tests/decoders/test_jsonl.py:63
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_functions.py:73
↓ 1 callers
Method
to_dict
(self)
src/anthropic/lib/tools/_beta_functions.py:88
↓ 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
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:92
↓ 1 callers
Method
until_done
Drive the runner to completion, discarding the per-call observations. Named to match ``BetaToolRunner.until_done`` (and to avoid colliding
src/anthropic/lib/tools/_beta_session_runner.py:451
↓ 1 callers
Method
until_done
Blocks until the stream has been consumed
src/anthropic/lib/streaming/_beta_messages.py:121
↓ 1 callers
Method
until_done
Waits until the stream has been consumed
src/anthropic/lib/streaming/_beta_messages.py:270
↓ 1 callers
Method
until_done
Waits until the stream has been consumed
src/anthropic/lib/streaming/_messages.py:266
↓ 1 callers
Function
validate_async_middleware
(middleware: Iterable[MiddlewareInput])
src/anthropic/_middleware.py:107
↓ 1 callers
Function
validate_sync_middleware
(middleware: Iterable[MiddlewareInput])
src/anthropic/_middleware.py:85
↓ 1 callers
Method
view
View the contents of a memory path.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:247
↓ 1 callers
Function
walk
(e: Optional[BaseException])
tests/lib/test_credentials.py:3216
↓ 1 callers
Function
warn_env_static_shadows_auto_discovery
Warn that an ``ANTHROPIC_API_KEY`` / ``ANTHROPIC_AUTH_TOKEN`` from the environment is shadowing the SDK's profile / federation auto-discovery.
src/anthropic/lib/credentials/_auth.py:47
↓ 1 callers
Function
warn_explicit_static_shadows_credentials
Warn that an explicit ``api_key=`` / ``auth_token=`` argument shadows an explicit ``credentials=`` provider passed to the same constructor or
src/anthropic/lib/credentials/_auth.py:31
↓ 1 callers
Function
write
Write a file, creating parent directories as needed.
src/anthropic/lib/tools/agent_toolset.py:621
Method
__aenter__
(self)
src/anthropic/_response.py:676
Method
__aenter__
(self: _T)
src/anthropic/_base_client.py:1792
Method
__aenter__
(self)
src/anthropic/_streaming.py:341
Method
__aenter__
(self)
src/anthropic/lib/streaming/_beta_messages.py:222
Method
__aenter__
(self)
src/anthropic/lib/streaming/_beta_messages.py:321
Method
__aenter__
(self)
src/anthropic/lib/streaming/_messages.py:218
Method
__aenter__
(self)
src/anthropic/lib/streaming/_messages.py:316
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/_response.py:680
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/_base_client.py:1795
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/_streaming.py:344
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/lib/streaming/_beta_messages.py:225
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/lib/streaming/_beta_messages.py:326
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/lib/streaming/_messages.py:221
Method
__aexit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, exc_t
src/anthropic/lib/streaming/_messages.py:321
Method
__aexit__
(self, *exc: object)
tests/lib/tools/test_session_runner.py:150
Method
__aiter__
(self)
src/anthropic/_base_client.py:327
Method
__aiter__
(self)
src/anthropic/_base_client.py:353
Method
__aiter__
(self)
src/anthropic/_streaming.py:238
Method
__aiter__
(self)
src/anthropic/lib/tools/_beta_runner.py:467
Method
__aiter__
(self)
src/anthropic/lib/tools/_beta_session_runner.py:446
Method
__aiter__
(self)
src/anthropic/lib/middleware/_fallbacks.py:1630
Method
__aiter__
(self)
src/anthropic/lib/streaming/_beta_messages.py:218
Method
__aiter__
(self)
src/anthropic/lib/streaming/_messages.py:214
Method
__aiter__
(self)
src/anthropic/_decoders/jsonl.py:121
Method
__aiter__
(self)
tests/lib/tools/test_session_runner.py:153
Method
__anext__
(self)
src/anthropic/lib/tools/_beta_runner.py:464
Method
__anext__
(self)
src/anthropic/lib/streaming/_beta_messages.py:215
← previous
next →
801–900 of 4,911, ranked by callers