MCPcopy Create free account

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

Functions4,447 in github.com/anthropics/anthropic-sdk-python

↓ 2 callersFunctionfield_get_default
(field: FieldInfo)
src/anthropic/_compat.py:93
↓ 2 callersFunctionfinish_fragment
()
scripts/utils/ruffen-docs.py:56
↓ 2 callersMethodfinish_frames
Frames still owed when the stream ends without a chainable refusal.
src/anthropic/lib/middleware/_fallbacks.py:956
↓ 2 callersFunctionflatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callersFunctionformat_code_block
(code: str)
scripts/utils/ruffen-docs.py:107
↓ 2 callersFunctionget_environment_proxies
Gets the proxy mappings based on environment variables. We use our own logic to parse these variables, as HTTPX doesn’t allow full config
src/anthropic/_utils/_httpx.py:32
↓ 2 callersFunctionget_model_fields
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:116
↓ 2 callersMethodget_next_page
(self: SyncPageT)
src/anthropic/_base_client.py:287
↓ 2 callersFunctionget_type_hints
( obj: Any, globalns: dict[str, Any] | None = None, localns: Mapping[str, Any] | None = None,
src/anthropic/_utils/_transform.py:455
↓ 2 callersMethodhandler
(req: APIRequest)
tests/test_middleware.py:502
↓ 2 callersMethodhas_next_page
(self)
src/anthropic/_base_client.py:203
↓ 2 callersMethodheartbeat
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:312
↓ 2 callersMethodhop_body
The hop's request body: the refused request's, with the entry's overrides merged over it and extended by the continuation. The server
src/anthropic/lib/middleware/_fallbacks.py:1093
↓ 2 callersFunctionis_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callersFunctionis_basemodel
Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`
src/anthropic/_models.py:527
↓ 2 callersFunctionis_basemodel_type
(type_: type)
src/anthropic/_models.py:539
↓ 2 callersFunctionis_iterable_type
If the given type is `typing.Iterable[T]`
src/anthropic/_utils/_typing.py:34
↓ 2 callersFunctionis_literal_type
(type_: type[Any])
src/anthropic/_compat.py:39
↓ 2 callersFunctionis_required_type
(typ: type)
src/anthropic/_utils/_typing.py:44
↓ 2 callersFunctionis_sequence
(obj: object)
src/anthropic/_utils/_utils.py:178
↓ 2 callersFunctionis_sequence_t
(obj: _SequenceT | object)
src/anthropic/_utils/_utils.py:182
↓ 2 callersFunctionis_stream_class_type
TypeGuard for determining whether or not the given type is a subclass of `Stream` / `AsyncStream`
src/anthropic/_streaming.py:536
↓ 2 callersFunctionis_tuple_t
(obj: _TupleT | object)
src/anthropic/_utils/_utils.py:174
↓ 2 callersFunctionis_typeddict
(tp: Type[Any])
src/anthropic/_utils/_compat.py:32
↓ 2 callersFunctionis_union
(tp: type[Any] | None)
src/anthropic/_compat.py:33
↓ 2 callersMethodjson
(self, **kwargs: Any)
src/anthropic/_legacy_response.py:434
↓ 2 callersFunctionmake_async_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1816
↓ 2 callersMethodmark_opened
(self)
src/anthropic/lib/middleware/_fallbacks.py:1086
↓ 2 callersFunctionmodel_json
(model: pydantic.BaseModel, *, indent: int | None = None)
src/anthropic/_compat.py:128
↓ 2 callersFunctionmodel_parse
(model: type[_ModelT], data: Any)
src/anthropic/_compat.py:175
↓ 2 callersFunctionparse_beta_response
( *, output_format: ResponseFormatT | NotGiven, response: BetaMessage, )
src/anthropic/lib/_parse/_response.py:23
↓ 2 callersFunctionparse_date
(value: Union[date, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:40
↓ 2 callersFunctionparse_response
( *, output_format: ResponseFormatT | NotGiven, response: Message, )
src/anthropic/lib/_parse/_response.py:49
↓ 2 callersMethodpatch
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/anthropic/_base_client.py:1538
↓ 2 callersMethodpending_seam_frames
(self)
src/anthropic/lib/middleware/_fallbacks.py:1083
↓ 2 callersMethodpoll
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:390
↓ 2 callersFunctionpublic_members
(obj: griffe.Object | griffe.Alias)
scripts/detect-breaking-changes.py:13
↓ 2 callersMethodqueue_seam
Queue the reached hop's `fallback` seam block at the next monotonic index. Queued seams are flushed by the hop reader once output reaches the
src/anthropic/lib/middleware/_fallbacks.py:1059
↓ 2 callersMethodraw_events
Iterate the raw Server-Sent Events from `response`, before any JSON parsing or event-name filtering. This reads the response body dir
src/anthropic/_streaming.py:78
↓ 2 callersFunctionresolve_identity_token_path
ctor arg → ``ANTHROPIC_IDENTITY_TOKEN_FILE`` → ``None``.
src/anthropic/lib/credentials/_constants.py:220
↓ 2 callersMethodretrieve
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
↓ 2 callersFunctionscan
(full: Path)
src/anthropic/lib/tools/agent_toolset.py:689
↓ 2 callersFunctionshort_circuit_message
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:362
↓ 2 callersFunctionstart
(event_id: str)
tests/lib/sessions/test_accumulate.py:21
↓ 2 callersMethodstop
(self)
examples/memory/basic.py:55
↓ 2 callersMethodstringify_items
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:51
↓ 2 callersMethodterminal_failure_frames
Degrade to the suppressed refusal when every remaining entry failed over HTTP: replay its message_delta verbatim — `recommended_model`
src/anthropic/lib/middleware/_fallbacks.py:1124
↓ 2 callersFunctionto_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:249
↓ 2 callersFunctionto_custom_raw_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support returning the given respo
src/anthropic/_response.py:814
↓ 2 callersFunctionto_custom_streamed_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support streaming and returning t
src/anthropic/_response.py:730
↓ 2 callersFunctiontool_registry
Index ``tools`` by their ``name`` for O(1) dispatch lookup. On a duplicate name the later tool wins, matching a plain dict comprehension.
src/anthropic/lib/tools/_tool_dispatch.py:40
↓ 2 callersFunctionvalidate_output_format
(output_format: object)
src/anthropic/resources/beta/messages/messages.py:4179
↓ 2 callersFunctionvalidate_type
Strict validation that the given value matches the expected type
src/anthropic/_models.py:828
↓ 2 callersFunctionwarn_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
↓ 2 callersFunctionwarn_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 callersMethod__aexit__
(self, *exc: object)
src/anthropic/lib/tools/agent_toolset.py:251
↓ 1 callersMethod__as_proxied__
Helper method that returns the current proxy, typed as the loaded object
src/anthropic/_utils/_proxy.py:60
↓ 1 callersMethod__decode__
(self)
src/anthropic/_decoders/jsonl.py:43
↓ 1 callersMethod__decode__
(self)
src/anthropic/_decoders/jsonl.py:99
↓ 1 callersMethod__enter__
(self)
src/anthropic/lib/streaming/_messages.py:70
↓ 1 callersMethod__init__
( self, *, raw: httpx.Response, cast_to: type[R], client: BaseClient[A
src/anthropic/_legacy_response.py:72
↓ 1 callersMethod__init__
Construct a new synchronous Anthropic client instance. Credentials are resolved in the following order (first match wins): 1. Explic
src/anthropic/_client.py:147
↓ 1 callersMethod__init__
(self, content: BetaFunctionToolResultType)
src/anthropic/lib/tools/_beta_functions.py:48
↓ 1 callersMethod__init__
( self, *, cast_to: type[_T], response: httpx.Response, client: Anthro
src/anthropic/lib/bedrock/_stream.py:15
↓ 1 callersMethod__init__
( self, *, aws_access_key: str | None = None, aws_secret_key: str | None = Non
src/anthropic/lib/bedrock/_mantle.py:177
↓ 1 callersMethod__init__
( self, aws_secret_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/bedrock/_client.py:138
↓ 1 callersMethod__init__
( self, *, api_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/aws/_client.py:33
↓ 1 callersMethod__init__
( self, *, region: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NO
src/anthropic/lib/vertex/_client.py:96
↓ 1 callersMethod__init__
( self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_re
src/anthropic/_decoders/jsonl.py:23
↓ 1 callersMethod__load__
(self)
src/anthropic/_utils/_proxy.py:65
↓ 1 callersMethod__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:262
↓ 1 callersMethod__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:550
↓ 1 callersMethod__stream__
(self)
src/anthropic/_streaming.py:255
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:131
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:280
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_messages.py:128
↓ 1 callersMethod__stream__
(self)
src/anthropic/lib/streaming/_messages.py:276
↓ 1 callersMethod__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:144
↓ 1 callersMethod__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:293
↓ 1 callersMethod__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:140
↓ 1 callersMethod__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:288
↓ 1 callersFunction_aforce_stop_quietly
Async version of :func:`_force_stop_quietly`.
src/anthropic/lib/environments/_poller.py:269
↓ 1 callersMethod_aiter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:459
↓ 1 callersFunction_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 callersFunction_apply_delta
Apply a content_block_delta to the accumulating block at `index`.
src/anthropic/lib/middleware/_fallbacks.py:1252
↓ 1 callersFunction_assert_list_type
(type_: type[object], value: object)
tests/utils.py:145
↓ 1 callersFunction_async_collect_files
(directory: anyio.Path, relative_to: anyio.Path, files: list[FileTypes])
src/anthropic/lib/_files.py:36
↓ 1 callersFunction_async_format_data
(data: object, format_: PropertyFormat, format_template: str | None)
src/anthropic/_utils/_transform.py:406
↓ 1 callersFunction_async_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:433
↓ 1 callersFunction_async_validate_no_symlink_escape
(target_path: AsyncPath, memory_root: AsyncPath)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:641
↓ 1 callersFunction_backfill
Fill `None` fields on `primary` from `fallback`.
src/anthropic/lib/middleware/_fallbacks.py:1511
↓ 1 callersFunction_build_discriminated_union_meta
(*, union: type, meta_annotations: tuple[Any, ...])
src/anthropic/_models.py:747
↓ 1 callersFunction_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 callersMethod_build_headers
(self, options: FinalRequestOptions, *, retries_taken: int = 0)
src/anthropic/_base_client.py:457
↓ 1 callersMethod_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:1199
↓ 1 callersMethod_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 callersFunction_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:247
↓ 1 callersMethod_call_oidc_federation
(self, auth: Dict[str, Any], *, force_refresh: bool = False)
src/anthropic/lib/credentials/_providers.py:570
↓ 1 callersMethod_call_provider
Call the provider, retrying once on a 401 from the token endpoint.
src/anthropic/lib/credentials/_cache.py:88
↓ 1 callersMethod_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:467
← previousnext →501–600 of 4,447, ranked by callers