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
Method
__enter__
(self)
src/anthropic/lib/streaming/_messages.py:74
↓ 1 callers
Method
__init__
( self, *, raw: httpx.Response, cast_to: type[R], client: BaseClient[A
src/anthropic/_legacy_response.py:72
↓ 1 callers
Method
__init__
Construct a new synchronous Anthropic client instance. Credentials are resolved in the following order (first match wins): 1. Explic
src/anthropic/_client.py:154
↓ 1 callers
Method
__init__
(self, content: BetaFunctionToolResultType)
src/anthropic/lib/tools/_beta_functions.py:48
↓ 1 callers
Method
__init__
( self, *, cast_to: type[_T], response: httpx.Response, client: Anthro
src/anthropic/lib/bedrock/_stream.py:15
↓ 1 callers
Method
__init__
( self, *, aws_access_key: str | None = None, aws_secret_key: str | None = Non
src/anthropic/lib/bedrock/_mantle.py:177
↓ 1 callers
Method
__init__
( self, aws_secret_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/bedrock/_client.py:138
↓ 1 callers
Method
__init__
( self, *, api_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/aws/_client.py:35
↓ 1 callers
Method
__init__
( self, *, region: str | NotGiven = not_given, project_id: str | NotGiven = no
src/anthropic/lib/vertex/_client.py:96
↓ 1 callers
Method
__init__
Construct a new synchronous Claude Platform on Google Cloud client. Auth precedence (first match wins, unless ``skip_auth=True``):
src/anthropic/lib/google_cloud/_client.py:201
↓ 1 callers
Method
__init__
( self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_re
src/anthropic/_decoders/jsonl.py:23
↓ 1 callers
Method
__load__
(self)
src/anthropic/_utils/_proxy.py:65
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:272
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:561
↓ 1 callers
Method
__stream__
(self)
src/anthropic/_streaming.py:255
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:135
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:288
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:132
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:284
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:148
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:301
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:144
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:296
↓ 1 callers
Function
_add
(tag: str | None)
src/anthropic/lib/_stainless_helpers.py:104
↓ 1 callers
Function
_aforce_stop_quietly
Async version of :func:`_force_stop_quietly`.
src/anthropic/lib/environments/_poller.py:269
↓ 1 callers
Method
_aiter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:459
↓ 1 callers
Function
_append_header_value
Append `addition` to a comma-separated header value, skipping tokens that are already present so the same helper isn't recorded twice. Values
src/anthropic/_base_client.py:2567
↓ 1 callers
Function
_apply_delta
Apply a content_block_delta to the accumulating block at `index`.
src/anthropic/lib/middleware/_fallbacks.py:1289
↓ 1 callers
Function
_apply_tool_change
Apply a single ``tool_removal`` / ``tool_addition`` block to ``available``.
src/anthropic/lib/tools/_tool_dispatch.py:76
↓ 1 callers
Function
_apply_tool_reference_change
Fold one ``tool_removal`` / ``tool_addition`` block into ``available``.
src/anthropic/lib/tools/_tool_dispatch.py:87
↓ 1 callers
Function
_archive_file_mode
Reduce an archive entry's Unix mode to ``0o755`` if it is executable, ``0o644`` otherwise. Skill bundles can ship executable scripts (e.g. ``
src/anthropic/lib/tools/_skills.py:126
↓ 1 callers
Function
_array_suffix
(array_format: ArrayFormat, array_index: int)
src/anthropic/_utils/_utils.py:61
↓ 1 callers
Function
_assert_list_type
(type_: type[object], value: object)
tests/utils.py:145
↓ 1 callers
Function
_async_collect_files
(directory: anyio.Path, relative_to: anyio.Path, files: list[FileTypes])
src/anthropic/lib/_files.py:36
↓ 1 callers
Function
_async_format_data
(data: object, format_: PropertyFormat, format_template: str | None)
src/anthropic/_utils/_transform.py:406
↓ 1 callers
Function
_async_transform_file
(file: FileTypes)
src/anthropic/_files.py:105
↓ 1 callers
Function
_async_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:433
↓ 1 callers
Function
_async_validate_no_symlink_escape
(target_path: AsyncPath, memory_root: AsyncPath)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:641
↓ 1 callers
Function
_backfill
Fill `None` fields on `primary` from `fallback`.
src/anthropic/lib/middleware/_fallbacks.py:1582
↓ 1 callers
Function
_basic_config
()
src/anthropic/_utils/_logs.py:8
↓ 1 callers
Function
_bedrock_message
(content: t.List[t.Dict[str, t.Any]], stop_reason: str)
tests/lib/test_bedrock.py:327
↓ 1 callers
Function
_build_discriminated_union_meta
(*, union: type, meta_annotations: tuple[Any, ...])
src/anthropic/_models.py:753
↓ 1 callers
Function
_build_federation_result
Build a :class:`CredentialResult` for the env-var federation path (step 4 in the precedence spec). Returns ``None`` if the required trio isn't
src/anthropic/lib/credentials/_chain.py:29
↓ 1 callers
Method
_build_headers
(self, options: FinalRequestOptions, *, retries_taken: int = 0)
src/anthropic/_base_client.py:456
↓ 1 callers
Method
_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:1198
↓ 1 callers
Method
_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:1945
↓ 1 callers
Function
_build_result_event
Build the result-event params matching ``ev``'s tool-call kind. A custom tool call (``agent.custom_tool_use``) is answered with a ``user.cust
src/anthropic/lib/tools/_beta_session_runner.py:332
↓ 1 callers
Method
_call_oidc_federation
(self, auth: Dict[str, Any], *, force_refresh: bool = False)
src/anthropic/lib/credentials/_providers.py:650
↓ 1 callers
Method
_call_provider
Call the provider, retrying once on a 401 from the token endpoint.
src/anthropic/lib/credentials/_cache.py:88
↓ 1 callers
Method
_call_user_oauth
Interactive-login profile. With a ``client_id`` in the auth block, we run the refresh_token grant on expiry; without one, we treat the
src/anthropic/lib/credentials/_providers.py:523
↓ 1 callers
Method
_check_and_compact
Check token usage and compact messages if threshold exceeded. Returns True if compaction was performed, False otherwise.
src/anthropic/lib/tools/_beta_runner.py:188
↓ 1 callers
Method
_check_and_compact
Check token usage and compact messages if threshold exceeded. Returns True if compaction was performed, False otherwise.
src/anthropic/lib/tools/_beta_runner.py:477
↓ 1 callers
Method
_cleanup_skills
Remove the skill directories :meth:`setup_skills` downloaded. Only the directories this context created are removed — a pre-existing
src/anthropic/lib/tools/agent_toolset.py:286
↓ 1 callers
Function
_coerce_expires_at
Parse a credentials-file ``expires_at`` field into Unix seconds.
src/anthropic/lib/credentials/_providers.py:59
↓ 1 callers
Function
_collect_files
(directory: Path, relative_to: Path, files: list[FileTypes])
src/anthropic/lib/_files.py:19
↓ 1 callers
Function
_confined
Yield the matches whose canonical path is inside ``root``; a match that cannot be canonicalised (symlink loop, unreadable) is dropped, not raised.
src/anthropic/lib/tools/agent_toolset.py:746
↓ 1 callers
Function
_construct_field
(value: object, field: FieldInfo, key: str)
src/anthropic/_models.py:501
↓ 1 callers
Function
_convert_tool_result
Convert MCP ``CallToolResult`` to a value suitable for returning from ``call()``.
src/anthropic/lib/tools/mcp.py:336
↓ 1 callers
Function
_create_pydantic_model
(type_: _T)
src/anthropic/_models.py:909
↓ 1 callers
Method
_create_schema_from_function
Create JSON schema from function signature using pydantic.
src/anthropic/lib/tools/_beta_functions.py:216
↓ 1 callers
Function
_credentials_file_path
Path to ``<config_dir>/credentials/<profile>.json`` (secret, 0600).
src/anthropic/lib/credentials/_constants.py:186
↓ 1 callers
Function
_custom_tool_result
(custom_tool_use_id: str)
tests/lib/tools/test_session_runner.py:102
↓ 1 callers
Function
_dec
(*_: Any, **__: Any)
src/anthropic/_models.py:919
↓ 1 callers
Function
_deepcopy_with_paths
(item: _T, paths: Sequence[Sequence[str]], index: int)
src/anthropic/_files.py:146
↓ 1 callers
Function
_default_bash_env
The environment for the bash subprocess, with the runner's own credentials scrubbed. The bash tool runs model-issued commands, so it must nev
src/anthropic/lib/tools/agent_toolset.py:143
↓ 1 callers
Function
_download_and_extract
Stream the skill archive to a temp file, then extract it into ``dest``.
src/anthropic/lib/tools/_skills.py:266
↓ 1 callers
Function
_drive_hop
Feed one hop's SSE events through `reader`, yielding the frames to forward.
src/anthropic/lib/middleware/_fallbacks.py:1006
↓ 1 callers
Function
_drive_hop_async
Feed one hop's SSE events through `reader`, yielding the frames to forward. The outcome is read from `reader.finish()` afterwards — async generat
src/anthropic/lib/middleware/_fallbacks.py:1018
↓ 1 callers
Method
_ensure_access_token
(self)
src/anthropic/lib/vertex/_client.py:166
↓ 1 callers
Method
_ensure_access_token
(self)
src/anthropic/lib/vertex/_client.py:330
↓ 1 callers
Function
_entered
()
src/anthropic/lib/tools/_beta_functions.py:566
↓ 1 callers
Method
_execute
Run ``ev``'s tool, post its result, and surface the dispatched call. ``confirmation`` is the verdict that released the call onto the work
src/anthropic/lib/tools/_beta_session_runner.py:845
↓ 1 callers
Function
_extract_field_schema_pv2
(model: type[BaseModel], field_name: str)
src/anthropic/_models.py:813
↓ 1 callers
Function
_extract_items
( obj: object, path: Sequence[str], *, index: int, flattened_key: str | None, array_fo
src/anthropic/_utils/_utils.py:75
↓ 1 callers
Function
_fill_missing_from_env
Fill empty profile fields from corresponding ANTHROPIC_* env vars. The profile file is authoritative — this only fills fields the file left u
src/anthropic/lib/credentials/_providers.py:87
↓ 1 callers
Method
_finalize_middleware_result
Convert the `APIResponse` returned by the middleware chain into the value the original caller expects. The middleware chain operates on `APIR
src/anthropic/_base_client.py:1236
↓ 1 callers
Method
_finalize_middleware_result
Convert the `AsyncAPIResponse` returned by the middleware chain into the value the original caller expects. The middleware chain operates on
src/anthropic/_base_client.py:1989
↓ 1 callers
Function
_force_stop_quietly
Best-effort ``work.stop(force=True)`` for an item that can't be processed. A 409 just means the work already stopped; anything else is logged but
src/anthropic/lib/environments/_poller.py:176
↓ 1 callers
Function
_format_data
(data: object, format_: PropertyFormat, format_template: str | None)
src/anthropic/_utils/_transform.py:238
↓ 1 callers
Method
_gen
(self)
tests/lib/tools/test_session_runner.py:160
↓ 1 callers
Method
_generate_tool_call_response
(self)
src/anthropic/lib/tools/_beta_runner.py:330
↓ 1 callers
Method
_generate_tool_call_response
(self)
src/anthropic/lib/tools/_beta_runner.py:639
↓ 1 callers
Method
_get_description_from_docstring
Extract description from parsed docstring.
src/anthropic/lib/tools/_beta_functions.py:207
↓ 1 callers
Function
_get_extra_fields_type
(cls: type[pydantic.BaseModel])
src/anthropic/_models.py:516
↓ 1 callers
Method
_get_last_assistant_message_content
(self)
src/anthropic/lib/tools/_beta_runner.py:400
↓ 1 callers
Method
_get_last_assistant_message_content
(self)
src/anthropic/lib/tools/_beta_runner.py:632
↓ 1 callers
Method
_get_page
(self)
src/anthropic/_base_client.py:313
↓ 1 callers
Function
_get_parameters_info
(fn: BaseFunctionTool[Any])
tests/lib/tools/test_functions.py:444
↓ 1 callers
Function
_get_session
( *, aws_access_key: str | None, aws_secret_key: str | None, aws_session_token: str | None,
src/anthropic/lib/bedrock/_auth.py:14
↓ 1 callers
Function
_get_session
( *, aws_access_key: str | None, aws_secret_key: str | None, aws_session_token: str | None,
src/anthropic/lib/aws/_auth.py:14
↓ 1 callers
Method
_get_token
(self)
src/anthropic/lib/google_cloud/_client.py:561
↓ 1 callers
Method
_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:184
↓ 1 callers
Method
_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:473
↓ 1 callers
Function
_has_active_profile_config
Tighter auto-discover check for the tier-1 credential chain. Returns ``True`` only if the *active* profile's config file exists. The previous
src/anthropic/lib/credentials/_constants.py:193
↓ 1 callers
Function
_has_auto_discoverable_credentials
True if the environment / filesystem contains signals that would normally drive the tier-1 (profile) or tier-2 (env federation) paths of :func
src/anthropic/lib/credentials/_constants.py:230
↓ 1 callers
Function
_interpolate
Replace {name} placeholders in `template`, quoting each value with `quoter`. Placeholder names are looked up in `values`. Raises: Ke
src/anthropic/_utils/_path.py:47
↓ 1 callers
Method
_invoke_provider
Invoke ``self._provider``, tolerating legacy zero-arg callables.
src/anthropic/lib/credentials/_cache.py:76
↓ 1 callers
Function
_is_async_cm_factory
True when ``fn`` is a function produced by :func:`contextlib.asynccontextmanager`.
src/anthropic/lib/tools/_beta_functions.py:305
↓ 1 callers
Function
_is_supported_resource_mime_type
(mime_type: str | None)
src/anthropic/lib/tools/mcp.py:112
↓ 1 callers
Function
_is_sync_cm_factory
True when ``fn`` is a function produced by :func:`contextlib.contextmanager`. ``contextmanager`` wraps the generator function with ``functools.wr
src/anthropic/lib/tools/_beta_functions.py:293
← previous
next →
601–700 of 5,068, ranked by callers