Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
9,455 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
9,455
◇
Types & classes
3,151
↳
Endpoints
25
↓ 1 callers
Function
_text_cases
`text_cases.json`, the table both SDKs' tests read for the text folds: `{c*N}` stands for N copies of the character c, and where the SDKs differ o
tests/lib/tools/toolsets/test_pipeline.py:852
↓ 1 callers
Function
_to_generated
Map a Parsed* wrapper to the generated block class it stands in for.
tests/lib/streaming/test_parsed_content_blocks.py:33
↓ 1 callers
Function
_to_session_content
Bridge Messages-API tool-result content to the narrower Sessions-API content union. The two APIs share text/image/document/search_result block sh
src/anthropic/lib/tools/_beta_session_runner.py:308
↓ 1 callers
Function
_tool_removal
(name: str)
tests/lib/tools/toolsets/test_runner.py:100
↓ 1 callers
Function
_tool_result
(tool_use_id: str)
tests/lib/tools/test_session_runner.py:87
↓ 1 callers
Method
_tools_for
(self, env: AgentToolContext)
src/anthropic/lib/environments/_worker.py:493
↓ 1 callers
Method
_toolset_run
One member call, under the lock: the family's pipeline from the raw `tool_use.input` to the content.
src/anthropic/lib/tools/_toolsets/_base.py:318
↓ 1 callers
Method
_toolset_run
( self, context: BetaToolsetCallContext, name: str, input: Mapping[str, object] )
src/anthropic/lib/tools/_toolsets/_base.py:403
↓ 1 callers
Function
_transform_file
(file: FileTypes)
src/anthropic/_files.py:63
↓ 1 callers
Function
_unchanged_since_hashed
(cached: _Hashed, st: os.stat_result)
src/anthropic/lib/tools/_file_store.py:410
↓ 1 callers
Function
_union_members
Return the runtime classes in an `Annotated[Union[...], ...]` type alias.
tests/lib/streaming/test_parsed_content_blocks.py:22
↓ 1 callers
Method
_validate_headers
Validate the headers a request is about to be sent with. `omitted` holds the (lowercase) names a header layer explicitly removed with `Omit`.
src/anthropic/_base_client.py:739
↓ 1 callers
Method
_validate_headers
(self, headers: httpx2.Headers, omitted: frozenset[str])
src/anthropic/lib/aws/_client.py:143
↓ 1 callers
Function
_validate_no_symlink_escape
(target_path: Path, memory_root: Path)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:338
↓ 1 callers
Function
_validate_non_model_type
(*, type_: type[_T], value: object)
src/anthropic/_models.py:918
↓ 1 callers
Function
_vertex_message
(content: List[Dict[str, Any]], stop_reason: str)
tests/lib/test_vertex.py:28
↓ 1 callers
Function
_wait_first
Return as soon as any of `events` is set.
src/anthropic/lib/tools/_beta_session_runner.py:1001
↓ 1 callers
Function
_walk_grep
(rx: re.Pattern[str], search: Path)
src/anthropic/lib/tools/agent_toolset.py:874
↓ 1 callers
Function
_with_tools
(*tools: Any)
tests/lib/tools/toolsets/test_browser_runner.py:510
↓ 1 callers
Function
_without_compaction_incompatible_params
A compaction request returns only the compaction block, never a reply, so the API rejects the params that only shape a reply. The runner's later r
src/anthropic/lib/tools/_beta_runner.py:133
↓ 1 callers
Function
_without_format
(output_config: BetaOutputConfigParam)
src/anthropic/lib/tools/_beta_runner.py:129
↓ 1 callers
Function
_wrapper_dir
Screen every member name (raising on path traversal, extracted or not), then return the wrapper directory shared by the members that will be e
src/anthropic/lib/tools/_skills.py:85
↓ 1 callers
Function
_zip_info_is_dir
(info: zipfile.ZipInfo)
src/anthropic/lib/tools/_skills.py:110
↓ 1 callers
Function
_zip_info_is_special
True for a Unix-host entry recorded as a symlink, device, FIFO or socket. Type bits from other hosts are not a mode, so those entries stay plain f
src/anthropic/lib/tools/_skills.py:103
↓ 1 callers
Function
accepts_force_refresh
False for a legacy provider that takes no `force_refresh` argument; it is called without one.
src/anthropic/lib/credentials/_cache.py:42
↓ 1 callers
Method
aclose
(self)
src/anthropic/lib/middleware/_fallbacks.py:1659
↓ 1 callers
Method
aclose
(self)
src/anthropic/_vendor/httpx_aiohttp/transport.py:204
↓ 1 callers
Method
advance
(self, seconds: float)
tests/lib/environments/test_poller_method.py:339
↓ 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:244
↓ 1 callers
Function
assert_is_file_content
(obj: object, *, key: str | None = None)
src/anthropic/_files.py:33
↓ 1 callers
Function
assert_matches_model
(model: type[BaseModelT], value: BaseModelT, *, path: list[str])
tests/utils.py:27
↓ 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:62
↓ 1 callers
Function
async_client
()
examples/vertex.py:29
↓ 1 callers
Function
async_close_credentials
Async `close_credentials`: awaits the provider's `aclose()` if it has one, else calls `close()`.
src/anthropic/lib/credentials/_close.py:40
↓ 1 callers
Function
async_read_base64
(file: Base64FileInput)
src/anthropic/_utils/_prepare.py:188
↓ 1 callers
Function
async_read_file_content
(file: FileContent)
src/anthropic/_files.py:137
↓ 1 callers
Function
async_serialize_data
`serialize_data`, reading `pathlib.Path` inputs without blocking the event loop.
src/anthropic/_utils/_prepare.py:80
↓ 1 callers
Function
available_tool_names
Fold mid-conversation `tool_removal` / `tool_addition` blocks over the locally runnable `tool_names`. These blocks arrive in `role: "system"`
src/anthropic/lib/tools/_tool_dispatch.py:162
↓ 1 callers
Function
beta_bash_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:580
↓ 1 callers
Function
body
()
tests/test_prepare.py:346
↓ 1 callers
Function
bounded_tab
(tab: BetaBrowserStateTabEntryParam)
src/anthropic/lib/tools/_toolsets/_render.py:164
↓ 1 callers
Method
build
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:187
↓ 1 callers
Function
build_registry
()
src/anthropic/lib/tools/_toolsets/_registry.py:77
↓ 1 callers
Function
build_registry
()
src/anthropic/lib/tools/_toolsets/_computer_registry.py:53
↓ 1 callers
Method
build_request
(options: FinalRequestOptions)
tests/test_client.py:270
↓ 1 callers
Function
build_wire_configs
The caller's `configs`, deep-copied, with `enabled: false` added for every member that is not served. Enabling such a member is a configuration er
src/anthropic/lib/tools/_toolsets/_base.py:473
↓ 1 callers
Method
call
Execute member `name` with the raw `tool_use.input` and return the tool-result content. Raise `anthropic.lib.tools.ToolError` for a model-visi
src/anthropic/lib/tools/_toolsets/_runnable.py:112
↓ 1 callers
Method
call
( self, context: BetaToolsetCallContext, name: str, input: Mapping[str, object] )
src/anthropic/lib/tools/_toolsets/_runnable.py:157
↓ 1 callers
Method
call_tool
(self, name: str, arguments: dict[str, Any] | None = None)
tests/lib/tools/test_mcp_tool.py:62
↓ 1 callers
Function
carry_helper_tag
Return `params` carrying `source`'s helper tag, so the tag survives serializing a tagged object.
src/anthropic/lib/_stainless_helpers.py:107
↓ 1 callers
Function
check_flavour
Raise when one of toolset class `cls`'s methods `names` is written for the other flavour: `async def` on the synchronous toolset, where nothing wo
src/anthropic/lib/tools/_toolsets/_base.py:453
↓ 1 callers
Function
checked_error
`error` with each text block run through `check` and then bounded, or the same object when nothing changed. The bound comes after the check, so th
src/anthropic/lib/tools/_toolsets/_base.py:551
↓ 1 callers
Method
clear_all_memory
Override the base implementation to provide file system clearing.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:611
↓ 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:1791
↓ 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:331
↓ 1 callers
Method
close
(self)
src/anthropic/lib/tools/agent_toolset.py:297
↓ 1 callers
Method
close
Release any resource the toolset holds (a browser, a socket, a subprocess) when you are done with it. The tool runner never closes a toolset,
src/anthropic/lib/tools/_toolsets/_runnable.py:117
↓ 1 callers
Method
close
Release any resource the toolset holds when you are done with it. The tool runner never closes a toolset. The default only marks the toolset c
src/anthropic/lib/tools/_toolsets/_runnable.py:161
↓ 1 callers
Method
close
(self)
src/anthropic/lib/middleware/_fallbacks.py:1646
↓ 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:243
↓ 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:239
↓ 1 callers
Method
close
Close the response body stream. This is called automatically if you consume the entire stream.
src/anthropic/_decoders/jsonl.py:36
↓ 1 callers
Method
close
(self)
tests/lib/tools/toolsets/_stubs.py:86
↓ 1 callers
Function
close_credentials
Release any resources owned by a credential provider, if it exposes `close()`.
src/anthropic/lib/credentials/_close.py:33
↓ 1 callers
Method
close_open_blocks
content_block_stop events for any blocks still open.
src/anthropic/lib/middleware/_fallbacks.py:1306
↓ 1 callers
Function
closer
()
tests/lib/tools/toolsets/test_pipeline.py:1243
↓ 1 callers
Function
coerce_float
(val: str)
src/anthropic/_utils/_utils.py:355
↓ 1 callers
Function
coerce_integer
(val: str)
src/anthropic/_utils/_utils.py:351
↓ 1 callers
Method
collect_from
(self, chunk: bytes)
src/anthropic/lib/tools/_files.py:55
↓ 1 callers
Function
collect_helpers
Collect deduplicated helper names from tools and messages.
src/anthropic/lib/_stainless_helpers.py:117
↓ 1 callers
Function
compaction
The block that a compaction request is answered with.
tests/lib/tools/test_runner_eager_tools.py:835
↓ 1 callers
Function
completed
(world: World)
tests/lib/tools/toolsets/test_enforcement.py:277
↓ 1 callers
Function
confirmation_text
Fill a pure action's template from its input in a single pass, so a model-supplied value such as `"{ref}"` stays data and is never re-read as a pl
src/anthropic/lib/tools/_toolsets/_render.py:85
↓ 1 callers
Function
consume
()
tests/lib/tools/test_session_runner.py:1412
↓ 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:416
↓ 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:589
↓ 1 callers
Function
copy_items
Copies the items into a list, scheduling a visit to the slots whose item may need preparing itself.
src/anthropic/_utils/_prepare.py:171
↓ 1 callers
Function
copy_mapping
Copies the `Mapping` into a dict without its `NotGiven` / `Omit` entries. Schedules a visit to the slots of the copy whose value may need prepari
src/anthropic/_utils/_prepare.py:151
↓ 1 callers
Method
create
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:253
↓ 1 callers
Function
cut_off_lines
()
tests/lib/tools/memory_sync/test_final_flush.py:153
↓ 1 callers
Method
default
(self, o: Any)
src/anthropic/_utils/_json.py:62
↓ 1 callers
Method
delete
Delete a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:155
↓ 1 callers
Method
delete
Delete a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:268
↓ 1 callers
Method
delete
()
src/anthropic/lib/tools/_file_store.py:238
↓ 1 callers
Method
delta
Apply a content_block_delta to its accumulating block, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1285
↓ 1 callers
Function
dialog_lines
One line per dismissed dialog the driver reported (`A confirm dialog "…" was dismissed.`), the message capped and at most a few lines, then a coun
src/anthropic/lib/tools/_toolsets/_render.py:175
↓ 1 callers
Function
download_dir_conflicts
Whether `download_dir` is inside (or contains) an upload root, which opens the download-then-upload loop: a page-triggered download written into a
src/anthropic/lib/tools/_toolsets/_security.py:144
↓ 1 callers
Function
errors
(change: dict[str, Any])
tests/lib/tools/toolsets/test_surface.py:153
↓ 1 callers
Function
event
(name: str, data: dict[str, Any])
tests/lib/tools/toolsets/test_runner.py:75
↓ 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:109
↓ 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:222
↓ 1 callers
Method
execute
Dispatch one member call to its method. Override it, calling `super().execute(context, name, input)`, for before/after hooks around every memb
src/anthropic/lib/tools/_toolsets/_computer.py:198
↓ 1 callers
Method
execute
Dispatch one member call to its method; see the synchronous class's `execute`. Members are async here; one written sync is a contract error.
src/anthropic/lib/tools/_toolsets/_computer.py:317
↓ 1 callers
Method
execute
Dispatch one member call to its method. Override it, calling `super().execute(context, name, input)`, for before/after hooks around every mem
src/anthropic/lib/tools/_toolsets/_browser.py:314
↓ 1 callers
Method
execute
Dispatch one member call to its method. See the synchronous class's `execute`. Members are async here, and one written sync is a contract erro
src/anthropic/lib/tools/_toolsets/_browser.py:565
↓ 1 callers
Method
execute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_computer_pipeline.py:443
↓ 1 callers
Method
execute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_confirm.py:224
← previous
next →
1,101–1,200 of 9,455, ranked by callers