MCPcopy Create free account

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

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

↓ 1 callersFunction_iter
()
tests/lib/environments/test_worker.py:151
↓ 1 callersMethod_iter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:437
↓ 1 callersMethod_iter_events
(self)
src/anthropic/_streaming.py:242
↓ 1 callersFunction_make_async_iterator
(iterable: Iterable[T], counter: Optional[Counter] = None)
tests/test_client.py:100
↓ 1 callersMethod_make_status_error
( self, err_msg: str, *, body: object, response: httpx.Response, )
src/anthropic/_base_client.py:447
↓ 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:93
↓ 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:743
↓ 1 callersMethod_params_from_url
(self, url: URL)
src/anthropic/_base_client.py:213
↓ 1 callersMethod_parse
(self, *, to: type[_T] | None = None)
src/anthropic/_legacy_response.py:203
↓ 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:783
↓ 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:1063
↓ 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:491
↓ 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:574
↓ 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_request_api_list
( self, model: Type[_T], page: Type[AsyncPageT], options: FinalRequestOptions,
src/anthropic/_base_client.py:2158
↓ 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:158
↓ 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:999
↓ 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:909
↓ 1 callersMethod_serialize_multipartform
(self, data: Mapping[object, object])
src/anthropic/_base_client.py:615
↓ 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:2076
↓ 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: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: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: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:287
↓ 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:730
↓ 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: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:986
↓ 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:497
↓ 1 callersMethodaiter_text
(self, chunk_size: int | None = None)
src/anthropic/_legacy_response.py:494
↓ 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_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:537
↓ 1 callersMethodbuild
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:191
↓ 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: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: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_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
← previousnext →701–800 of 5,068, ranked by callers