MCPcopy Create free account

hub / github.com/anthropics/anthropic-sdk-python / functions

Functions6,399 in github.com/anthropics/anthropic-sdk-python

↓ 1 callersFunction_merge_mappings
Merge two mappings of the same type, removing any values that are instances of `Omit`. In cases with duplicate keys the second mapping takes prec
src/anthropic/_base_client.py:2428
↓ 1 callersFunction_migrate_legacy_config
Adapter: convert a flat legacy config dict into the new nested shape. Many tests in this file predate the schema migration and pass legacy fl
tests/lib/test_credentials.py:92
↓ 1 callersMethod_note_confirmation
Record an allow/deny verdict and release the held call it gates, if any.
src/anthropic/lib/tools/_beta_session_runner.py:745
↓ 1 callersFunction_old_enough_to_cache
(st: os.stat_result, walk_start_ns: int)
src/anthropic/lib/tools/_file_store.py:423
↓ 1 callersMethod_over_limit_error
(self)
src/anthropic/lib/tools/_files.py:74
↓ 1 callersMethod_params_from_url
(self, url: URL)
src/anthropic/_base_client.py:212
↓ 1 callersMethod_parse_retry_after_header
Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified. About the Retry-After header: htt
src/anthropic/_base_client.py:763
↓ 1 callersFunction_parse_timezone
(value: Optional[str])
src/anthropic/_utils/_datetime_parse.py:56
↓ 1 callersFunction_patch
`overrides` applied flat against `base`: a key set to a value overrides it, a key explicitly `None` unsets it, an absent key keeps the base value.
src/anthropic/lib/middleware/_fallbacks.py:1486
↓ 1 callersFunction_platform_supported
()
src/anthropic/lib/tools/_file_store.py:293
↓ 1 callersMethod_prepare_options
Hook for mutating the given options
src/anthropic/_base_client.py:1043
↓ 1 callersMethod_prepare_options
Hook for mutating the given options
src/anthropic/_base_client.py:1736
↓ 1 callersMethod_prepare_request
This method is used as a callback for mutating the `Request` object after it has been constructed. This is useful for cases where you
src/anthropic/_base_client.py:1743
↓ 1 callersMethod_prepare_request
(self, request: httpx2.Request)
src/anthropic/lib/bedrock/_mantle.py:459
↓ 1 callersMethod_prepare_request
(self, request: httpx2.Request)
src/anthropic/lib/aws/_client.py:354
↓ 1 callersMethod_prepare_url
Merge a URL argument together with any 'base_url' on the client, to create the URL used for the outgoing request.
src/anthropic/_base_client.py:481
↓ 1 callersFunction_prepend_seam_blocks
(response: APIResponse[Any], seams: list[dict[str, Any]])
src/anthropic/lib/middleware/_fallbacks.py:1435
↓ 1 callersFunction_prepend_seam_blocks_async
(response: AsyncAPIResponse[Any], seams: list[dict[str, Any]])
src/anthropic/lib/middleware/_fallbacks.py:1450
↓ 1 callersMethod_primitive_value_to_str
(self, value: PrimitiveData)
src/anthropic/_qs.py:120
↓ 1 callersMethod_process_response_data
( self, *, data: object, cast_to: type[ResponseT], response: httpx2.Re
src/anthropic/_base_client.py:655
↓ 1 callersMethod_pull_all
Fetch and write the given memories, :data:`_FETCH_CONCURRENCY` at a time. The sync's content pass: the listing carried no content, so each
src/anthropic/lib/tools/_memories.py:713
↓ 1 callersFunction_pycon_match
(match: Match[str])
scripts/utils/ruffen-docs.py:52
↓ 1 callersFunction_read_binary_block
Read an image/PDF as a base64 ``image``/``document`` content block. The text cap does not apply here — its 256 KiB default would reject most
src/anthropic/lib/tools/agent_toolset.py:641
↓ 1 callersMethod_read_credentials_if_exists
``_read_credentials`` variant that returns ``None`` on absence instead of raising — used by the federation disk-cache path where a mis
src/anthropic/lib/credentials/_providers.py:635
↓ 1 callersFunction_read_json
(response: httpx2.Response)
src/anthropic/lib/middleware/_fallbacks.py:1523
↓ 1 callersFunction_read_json_async
(response: httpx2.Response)
src/anthropic/lib/middleware/_fallbacks.py:1530
↓ 1 callersMethod_reconcile
Read full history and enqueue every tool-call event still unanswered. Two-pass: read the whole history before emitting so a tool-call whose
src/anthropic/lib/tools/_beta_session_runner.py:576
↓ 1 callersMethod_recover
Rebuild a destroyed folder from the server; sends no deletes, no uploads.
src/anthropic/lib/tools/_memories.py:557
↓ 1 callersFunction_referenced_tool_name
The locally runnable tool name a tool-change reference resolves to. Only ``tool_reference`` names a runnable tool; ``mcp_tool_reference`` / `
src/anthropic/lib/tools/_tool_dispatch.py:100
↓ 1 callersMethod_remove_local
Remove the file for a memory the server no longer has, if it still holds ``expect_sha``. Returns ``None`` when the file is gone from disk, ``
src/anthropic/lib/tools/_memories.py:673
↓ 1 callersMethod_request_api_list
( self, model: Type[_T], page: Type[AsyncPageT], options: FinalRequestOptions,
src/anthropic/_base_client.py:2072
↓ 1 callersFunction_require
Fall back to ``env_var`` for ``value``; raise a clear error if still empty. The ``ANTHROPIC_*`` env vars are the ones the ``ant worker poll --on-
src/anthropic/lib/environments/_worker.py:285
↓ 1 callersFunction_require_env
(name: str)
examples/managed-agents-self-hosted-sandbox-worker.py:47
↓ 1 callersFunction_run_session_tools
Internal: drive a :class:`SessionToolRunner` as an async context manager. Kept as a thin module-level shim because :class:`~anthropic.lib.env
src/anthropic/lib/tools/_beta_session_runner.py:1001
↓ 1 callersFunction_scoped_client
Build the runner's request client. With an environment key, defer to :func:`_copy_client_with_bearer_auth` for a Bearer-only sub-client. With
src/anthropic/lib/tools/_beta_session_runner.py:297
↓ 1 callersFunction_sdk_frame_locals
(code name, locals) for every traceback frame owned by the anthropic package, across the full ``__context__`` / ``__cause__`` chain.
tests/lib/test_credentials.py:3514
↓ 1 callersMethod_send_result
Post ``tool_result`` back to the session, retrying transient failures with jittered exponential backoff until the send retry window elapses.
src/anthropic/lib/tools/_beta_session_runner.py:911
↓ 1 callersMethod_serialize_multipartform
(self, data: Mapping[object, object])
src/anthropic/_base_client.py:605
↓ 1 callersFunction_server_lease_state
The server's view of the lease carried by a 412 heartbeat response, or empty if absent.
src/anthropic/lib/environments/_worker.py:156
↓ 1 callersFunction_serving_iteration_entry
The serving hop's `fallback_message` completer entry: its own self-reported iteration relabeled, or one built from its delta usage.
src/anthropic/lib/middleware/_fallbacks.py:1213
↓ 1 callersFunction_session
()
src/anthropic/lib/tools/agent_toolset.py:593
↓ 1 callersMethod_should_retry
(self, response: httpx2.Response)
src/anthropic/_client.py:395
↓ 1 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx2.Respon
src/anthropic/_base_client.py:1298
↓ 1 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx2.Respon
src/anthropic/_base_client.py:2004
↓ 1 callersMethod_splice_fallback_stream
Wrap the refusable stream in a response whose body passes events through until a retryable refusal, then splices the fallback chain's events o
src/anthropic/lib/middleware/_fallbacks.py:387
↓ 1 callersMethod_splice_fallback_stream_async
( self, *, request: APIRequest, body: dict[str, Any], initial_model: s
src/anthropic/lib/middleware/_fallbacks.py:427
↓ 1 callersMethod_spliced_frames
( self, *, request: APIRequest, body: dict[str, Any], initial_model: s
src/anthropic/lib/middleware/_fallbacks.py:485
↓ 1 callersMethod_spliced_frames_async
( self, *, request: APIRequest, body: dict[str, Any], initial_model: s
src/anthropic/lib/middleware/_fallbacks.py:609
↓ 1 callersMethod_store_root
Where one store's files land on disk. The store's files land at its ``mount_path`` — the very location the agent's system prompt tell
src/anthropic/lib/tools/_memories.py:255
↓ 1 callersMethod_stringify_item
( self, key: str, value: Data, opts: Options, )
src/anthropic/_qs.py:65
↓ 1 callersMethod_strip_raw_response_header
(self)
src/anthropic/_models.py:974
↓ 1 callersFunction_summarise_event
(ev: Any)
examples/managed-agents-self-hosted-sandbox-worker.py:154
↓ 1 callersFunction_symlink_loop_error
()
src/anthropic/lib/tools/agent_toolset.py:345
↓ 1 callersMethod_sync_path
( self, store: _AttachedStore, rel: str, remote: BetaManagedAgentsMemory | Non
src/anthropic/lib/tools/_memories.py:585
↓ 1 callersFunction_to_generated
Map a Parsed* wrapper to the generated block class it stands in for.
tests/lib/streaming/test_parsed_content_blocks.py:29
↓ 1 callersFunction_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:310
↓ 1 callersFunction_tool_result
(tool_use_id: str)
tests/lib/tools/test_session_runner.py:87
↓ 1 callersMethod_tools_for
(self, env: AgentToolContext)
src/anthropic/lib/environments/_worker.py:483
↓ 1 callersFunction_transform_file
(file: FileTypes)
src/anthropic/_files.py:63
↓ 1 callersFunction_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:265
↓ 1 callersFunction_unchanged_since_hashed
(cached: _Hashed, st: os.stat_result)
src/anthropic/lib/tools/_file_store.py:410
↓ 1 callersFunction_union_members
Return the runtime classes in an `Annotated[Union[...], ...]` type alias.
tests/lib/streaming/test_parsed_content_blocks.py:18
↓ 1 callersMethod_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:708
↓ 1 callersMethod_validate_headers
(self, headers: httpx2.Headers, omitted: frozenset[str])
src/anthropic/lib/aws/_client.py:140
↓ 1 callersFunction_validate_no_symlink_escape
(target_path: Path, memory_root: Path)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:338
↓ 1 callersFunction_validate_non_model_type
(*, type_: type[_T], value: object)
src/anthropic/_models.py:887
↓ 1 callersFunction_vertex_message
(content: List[Dict[str, Any]], stop_reason: str)
tests/lib/test_vertex.py:28
↓ 1 callersFunction_wait_first
Return as soon as any of ``events`` is set.
src/anthropic/lib/tools/_beta_session_runner.py:988
↓ 1 callersFunction_walk_grep
(rx: re.Pattern[str], search: Path)
src/anthropic/lib/tools/agent_toolset.py:876
↓ 1 callersFunction_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 callersFunction_zip_info_is_dir
(info: zipfile.ZipInfo)
src/anthropic/lib/tools/_skills.py:110
↓ 1 callersFunction_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 callersMethodaclose
(self)
src/anthropic/_vendor/httpx_aiohttp/transport.py:204
↓ 1 callersMethodadvance
(self, seconds: float)
tests/lib/environments/test_poller_method.py:339
↓ 1 callersFunctionassert_empty_iter
(decoder: JSONLDecoder[Any] | AsyncJSONLDecoder[Any])
tests/decoders/test_jsonl.py:74
↓ 1 callersFunctionassert_incomplete_partial_input_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:215
↓ 1 callersFunctionassert_is_file_content
(obj: object, *, key: str | None = None)
src/anthropic/_files.py:33
↓ 1 callersFunctionassert_matches_model
(model: type[BaseModelT], value: BaseModelT, *, path: list[str])
tests/utils.py:27
↓ 1 callersFunctionassert_overloads_in_sync
Ensure that every @overload of overloaded_func contains all params from source_func.
src/anthropic/_utils/_reflection.py:46
↓ 1 callersFunctionasync_client
()
examples/vertex.py:24
↓ 1 callersFunctionasync_read_file_content
(file: FileContent)
src/anthropic/_files.py:119
↓ 1 callersFunctionasync_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 callersFunctionavailable_tool_names
Fold mid-conversation ``tool_removal`` / ``tool_addition`` blocks over the locally runnable ``tool_names``. Only ``role: "system"`` messages
src/anthropic/lib/tools/_tool_dispatch.py:57
↓ 1 callersFunctionbeta_bash_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:582
↓ 1 callersMethodbuild
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:186
↓ 1 callersMethodbuild_request
(options: FinalRequestOptions)
tests/test_client.py:269
↓ 1 callersMethodcall_tool
(self, name: str, arguments: dict[str, Any] | None = None)
tests/lib/tools/test_mcp_tool.py:62
↓ 1 callersMethodclear_all_memory
Override the base implementation to provide file system clearing.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:611
↓ 1 callersFunctionclear_locals
(string: str, *, stacklevel: int)
tests/lib/utils.py:61
↓ 1 callersMethodclose
Close the underlying HTTPX client. The client will *not* be usable after this.
src/anthropic/_base_client.py:1718
↓ 1 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_streaming.py:308
↓ 1 callersMethodclose
(self)
src/anthropic/lib/tools/agent_toolset.py:298
↓ 1 callersMethodclose
(self)
src/anthropic/lib/middleware/_fallbacks.py:1619
↓ 1 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_beta_messages.py:241
↓ 1 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_messages.py:237
↓ 1 callersMethodclose
Close the response body stream. This is called automatically if you consume the entire stream.
src/anthropic/_decoders/jsonl.py:36
↓ 1 callersMethodclose_open_blocks
content_block_stop events for any blocks still open.
src/anthropic/lib/middleware/_fallbacks.py:1279
↓ 1 callersFunctioncoerce_float
(val: str)
src/anthropic/_utils/_utils.py:332
↓ 1 callersFunctioncoerce_integer
(val: str)
src/anthropic/_utils/_utils.py:328
↓ 1 callersMethodcollect_from
(self, chunk: bytes)
src/anthropic/lib/tools/_files.py:55
← previousnext →801–900 of 6,399, ranked by callers