MCPcopy Create free account

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

Functions5,052 in github.com/anthropics/anthropic-sdk-python

↓ 1 callersFunction_make_async_iterator
(iterable: Iterable[T], counter: Optional[Counter] = None)
tests/test_client.py:99
↓ 1 callersMethod_make_status_error
( self, err_msg: str, *, body: object, response: httpx.Response, )
src/anthropic/_base_client.py:448
↓ 1 callersMethod_make_status_error
( self, err_msg: str, *, body: object, response: httpx.Response, )
src/anthropic/_client.py:938
↓ 1 callersFunction_make_sync_iterator
(iterable: Iterable[T], counter: Optional[Counter] = None)
tests/test_client.py:92
↓ 1 callersFunction_make_targz_modes
(path: Path, entries: dict[str, tuple[bytes, int]])
tests/lib/tools/test_skills.py:52
↓ 1 callersFunction_make_zip_modes
(path: Path, entries: dict[str, tuple[bytes, int]])
tests/lib/tools/test_skills.py:43
↓ 1 callersFunction_media_type_literal_values
Extract the values of a ``Required[Literal[...]]`` TypedDict field.
tests/lib/tools/test_agent_toolset.py:306
↓ 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:2547
↓ 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:722
↓ 1 callersMethod_params_from_url
(self, url: URL)
src/anthropic/_base_client.py:214
↓ 1 callersMethod_parse
(self, *, to: type[_T] | None = None)
src/anthropic/_legacy_response.py:199
↓ 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:784
↓ 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:1488
↓ 1 callersMethod_prepare_options
Hook for mutating the given options
src/anthropic/_base_client.py:1064
↓ 1 callersMethod_prepare_options
Hook for mutating the given options
src/anthropic/_base_client.py:1803
↓ 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:1810
↓ 1 callersMethod_prepare_request
(self, request: httpx.Request)
src/anthropic/lib/bedrock/_mantle.py:459
↓ 1 callersMethod_prepare_request
(self, request: httpx.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:492
↓ 1 callersFunction_prepend_seam_blocks
(response: APIResponse[Any], seams: list[dict[str, Any]])
src/anthropic/lib/middleware/_fallbacks.py:1437
↓ 1 callersFunction_prepend_seam_blocks_async
(response: AsyncAPIResponse[Any], seams: list[dict[str, Any]])
src/anthropic/lib/middleware/_fallbacks.py:1452
↓ 1 callersMethod_primitive_value_to_str
(self, value: PrimitiveData)
src/anthropic/_qs.py:120
↓ 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:596
↓ 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: httpx.Response)
src/anthropic/lib/middleware/_fallbacks.py:1525
↓ 1 callersFunction_read_json_async
(response: httpx.Response)
src/anthropic/lib/middleware/_fallbacks.py:1532
↓ 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:553
↓ 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:110
↓ 1 callersMethod_request_api_list
( self, model: Type[_T], page: Type[AsyncPageT], options: FinalRequestOptions,
src/anthropic/_base_client.py:2157
↓ 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:154
↓ 1 callersFunction_require_env
(name: str)
examples/managed-agents-self-hosted-sandbox-worker.py:47
↓ 1 callersFunction_resolve_skill_version
Resolve ``version`` to the concrete numeric timestamp the ``/v1/skills/{id}/versions/{version}`` endpoints require. ``session.agent.skills[].
src/anthropic/lib/tools/_skills.py:200
↓ 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:965
↓ 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:288
↓ 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. ``tool_use_id`` is the originating tool-call event id — passed
src/anthropic/lib/tools/_beta_session_runner.py:888
↓ 1 callersMethod_serialize_multipartform
(self, data: Mapping[object, object])
src/anthropic/_base_client.py:616
↓ 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:548
↓ 1 callersMethod_should_retry
(self, response: httpx.Response)
src/anthropic/_client.py:410
↓ 1 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Respons
src/anthropic/_base_client.py:1323
↓ 1 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Respons
src/anthropic/_base_client.py:2075
↓ 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_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:966
↓ 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:315
↓ 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:301
↓ 1 callersFunction_tool_result
(tool_use_id: str)
tests/lib/tools/test_session_runner.py:83
↓ 1 callersMethod_tools_for
(self, env: AgentToolContext)
src/anthropic/lib/environments/_worker.py:281
↓ 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_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 given default headers and custom headers. Does nothing by default.
src/anthropic/_base_client.py:731
↓ 1 callersMethod_validate_headers
(self, headers: Headers, custom_headers: Headers)
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:337
↓ 1 callersFunction_validate_non_model_type
(*, type_: type[_T], value: object)
src/anthropic/_models.py:879
↓ 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:952
↓ 1 callersFunction_walk_grep
(rx: re.Pattern[str], search: Path)
src/anthropic/lib/tools/agent_toolset.py:837
↓ 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:84
↓ 1 callersFunction_zip_info_is_dir
(info: zipfile.ZipInfo)
src/anthropic/lib/tools/_skills.py:109
↓ 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:102
↓ 1 callersMethodaiter_lines
(self)
src/anthropic/_legacy_response.py:493
↓ 1 callersMethodaiter_text
(self, chunk_size: int | None = None)
src/anthropic/_legacy_response.py:490
↓ 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:28
↓ 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_stream
()
examples/text_completions_streaming.py:29
↓ 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 callersFunctionbackoff
Exponential backoff for ``attempt`` (1-indexed), capped at ``cap``.
src/anthropic/lib/_retry.py:32
↓ 1 callersFunctionbeta_bash_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:537
↓ 1 callersMethodbuild
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:191
↓ 1 callersMethodbuild_request
(options: FinalRequestOptions)
tests/test_client.py:268
↓ 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:602
↓ 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:1785
↓ 1 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_streaming.py:352
↓ 1 callersMethodclose
(self)
src/anthropic/lib/tools/agent_toolset.py:270
↓ 1 callersMethodclose
(self)
src/anthropic/lib/middleware/_fallbacks.py:1621
↓ 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:233
↓ 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:229
↓ 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 callersFunctioncollect_helpers
Collect deduplicated helper names from tools and messages.
src/anthropic/lib/_stainless_helpers.py:97
↓ 1 callersFunctionconversation_loop
()
examples/memory/basic.py:70
↓ 1 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_client.py:421
← previousnext →701–800 of 5,052, ranked by callers