Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
6,399 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
6,399
◇
Types & classes
2,012
↳
Endpoints
17
↓ 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:311
↓ 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:415
↓ 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:2446
↓ 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:127
↓ 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:142
↓ 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:650
↓ 1 callers
Function
_backfill
Fill `None` fields on `primary` from `fallback`.
src/anthropic/lib/middleware/_fallbacks.py:1580
↓ 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:460
↓ 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:455
↓ 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:1178
↓ 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:1878
↓ 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
Function
_calls
()
tests/lib/tools/memory_sync/test_e2e_memory.py:103
↓ 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:316
↓ 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
Method
_collect
(self, line_bytes: bytes, *, newline_terminated: bool)
src/anthropic/lib/tools/_files.py:67
↓ 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:795
↓ 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
Method
_corroborated_delete
Send the server delete only after the file's absence is confirmed. Records the miss on the first sync; deletes on a later one after t
src/anthropic/lib/tools/_memories.py:822
↓ 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:222
↓ 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:145
↓ 1 callers
Method
_delete_remote
( self, store: _AttachedStore, rel: str, remote: BetaManagedAgentsMemory, base_sha: str )
src/anthropic/lib/tools/_memories.py:868
↓ 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:269
↓ 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:572
↓ 1 callers
Function
_eventstream_chunk_frame
Encode `payload` as one `chunk` event in AWS eventstream binary framing.
tests/lib/test_bedrock.py:356
↓ 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:847
↓ 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:1216
↓ 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:1922
↓ 1 callers
Function
_flattened_causes
The causes under an exception group — anyio's wrapper message says nothing.
src/anthropic/lib/environments/_worker.py:246
↓ 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:215
↓ 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:260
↓ 1 callers
Method
_generate_tool_call_response
(self)
src/anthropic/lib/tools/_beta_runner.py:472
↓ 1 callers
Method
_get_description_from_docstring
Extract description from parsed docstring.
src/anthropic/lib/tools/_beta_functions.py:213
↓ 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:330
↓ 1 callers
Method
_get_last_assistant_message_content
(self)
src/anthropic/lib/tools/_beta_runner.py:465
↓ 1 callers
Method
_get_page
(self)
src/anthropic/_base_client.py:312
↓ 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:549
↓ 1 callers
Method
_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:199
↓ 1 callers
Method
_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:391
↓ 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
_has_memory_store
True when the session has at least one memory store attached.
src/anthropic/lib/environments/_worker.py:254
↓ 1 callers
Function
_hash_file
(path: Path)
src/anthropic/lib/tools/_file_store.py:351
↓ 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:311
↓ 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:299
↓ 1 callers
Method
_iter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:393
↓ 1 callers
Method
_iter_events
(self)
src/anthropic/_streaming.py:198
↓ 1 callers
Function
_lease_lost_error
The 412 the control plane answers a heartbeat with once the item's lease was cleared (re-queued) or is held by another worker.
tests/lib/environments/test_worker.py:64
↓ 1 callers
Function
_make_async_iterator
(iterable: Iterable[T], counter: Optional[Counter] = None)
tests/test_client.py:100
↓ 1 callers
Method
_make_status_error
( self, err_msg: str, *, body: object, response: httpx2.Response,
src/anthropic/_base_client.py:446
↓ 1 callers
Method
_make_status_error
( self, err_msg: str, *, body: object, response: httpx2.Response,
src/anthropic/_client.py:925
↓ 1 callers
Function
_make_sync_iterator
(iterable: Iterable[T], counter: Optional[Counter] = None)
tests/test_client.py:93
↓ 1 callers
Function
_make_targz
(path: Path, entries: dict[str, bytes])
tests/lib/tools/test_skills.py:43
↓ 1 callers
Function
_make_targz_modes
(path: Path, entries: dict[str, tuple[bytes, int]])
tests/lib/tools/test_skills.py:60
↓ 1 callers
Function
_make_zip_modes
(path: Path, entries: dict[str, tuple[bytes, int]])
tests/lib/tools/test_skills.py:51
↓ 1 callers
Function
_media_type_literal_values
Extract the values of a ``Required[Literal[...]]`` TypedDict field.
tests/lib/tools/test_agent_toolset.py:457
← previous
next →
701–800 of 6,399, ranked by callers