MCPcopy Create free account

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

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

↓ 1 callersMethod_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:178
↓ 1 callersMethod_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:466
↓ 1 callersMethod_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:233
↓ 1 callersFunction_collect_files
(directory: Path, relative_to: Path, files: list[FileTypes])
src/anthropic/lib/_files.py:19
↓ 1 callersFunction_construct_field
(value: object, field: FieldInfo, key: str)
src/anthropic/_models.py:495
↓ 1 callersFunction_create_pydantic_model
(type_: _T)
src/anthropic/_models.py:901
↓ 1 callersMethod_create_schema_from_function
Create JSON schema from function signature using pydantic.
src/anthropic/lib/tools/_beta_functions.py:216
↓ 1 callersFunction_credentials_file_path
Path to ``<config_dir>/credentials/<profile>.json`` (secret, 0600).
src/anthropic/lib/credentials/_constants.py:186
↓ 1 callersFunction_custom_tool_result
(custom_tool_use_id: str)
tests/lib/tools/test_session_runner.py:85
↓ 1 callersFunction_dec
(*_: Any, **__: Any)
src/anthropic/_models.py:911
↓ 1 callersFunction_deepcopy_with_paths
(item: _T, paths: Sequence[Sequence[str]], index: int)
src/anthropic/_files.py:148
↓ 1 callersFunction_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:109
↓ 1 callersFunction_download_and_extract
Stream the skill archive to a temp file, then extract it into ``dest``.
src/anthropic/lib/tools/_skills.py:235
↓ 1 callersMethod_ensure_access_token
(self)
src/anthropic/lib/vertex/_client.py:166
↓ 1 callersMethod_ensure_access_token
(self)
src/anthropic/lib/vertex/_client.py:330
↓ 1 callersFunction_entered
()
src/anthropic/lib/tools/_beta_functions.py:561
↓ 1 callersMethod_execute
(self, ev: DispatchedToolUseEvent)
src/anthropic/lib/tools/_beta_session_runner.py:578
↓ 1 callersFunction_extract_field_schema_pv2
(model: type[BaseModel], field_name: str)
src/anthropic/_models.py:807
↓ 1 callersFunction_extract_items
( obj: object, path: Sequence[str], *, index: int, flattened_key: str | None, array_fo
src/anthropic/_utils/_utils.py:75
↓ 1 callersFunction_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:78
↓ 1 callersMethod_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:1237
↓ 1 callersMethod_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 callersFunction_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 callersFunction_format_data
(data: object, format_: PropertyFormat, format_template: str | None)
src/anthropic/_utils/_transform.py:238
↓ 1 callersMethod_gen
(self)
tests/lib/tools/test_session_runner.py:143
↓ 1 callersMethod_generate_tool_call_response
(self)
src/anthropic/lib/tools/_beta_runner.py:320
↓ 1 callersMethod_generate_tool_call_response
(self)
src/anthropic/lib/tools/_beta_runner.py:628
↓ 1 callersMethod_get_description_from_docstring
Extract description from parsed docstring.
src/anthropic/lib/tools/_beta_functions.py:207
↓ 1 callersFunction_get_extra_fields_type
(cls: type[pydantic.BaseModel])
src/anthropic/_models.py:510
↓ 1 callersMethod_get_last_assistant_message_content
(self)
src/anthropic/lib/tools/_beta_runner.py:389
↓ 1 callersMethod_get_last_assistant_message_content
(self)
src/anthropic/lib/tools/_beta_runner.py:621
↓ 1 callersMethod_get_page
(self)
src/anthropic/_base_client.py:314
↓ 1 callersFunction_get_parameters_info
(fn: BaseFunctionTool[Any])
tests/lib/tools/test_functions.py:444
↓ 1 callersFunction_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 callersFunction_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 callersMethod_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:174
↓ 1 callersMethod_handle_request
(self)
src/anthropic/lib/tools/_beta_runner.py:462
↓ 1 callersFunction_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 callersFunction_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 callersFunction_heartbeat_loop
Keep the work-item lease alive while a session is being served. ``work`` must be bound to a sub-client authenticated for the environment; thi
src/anthropic/lib/environments/_worker.py:90
↓ 1 callersFunction_is_supported_resource_mime_type
(mime_type: str | None)
src/anthropic/lib/tools/mcp.py:90
↓ 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:448
↓ 1 callersMethod_make_status_error
( self, err_msg: str, *, body: object, response: httpx.Response, )
src/anthropic/_client.py:925
↓ 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_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:88
↓ 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 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:1071
↓ 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_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:1400
↓ 1 callersFunction_prepend_seam_blocks_async
(response: AsyncAPIResponse[Any], seams: list[dict[str, Any]])
src/anthropic/lib/middleware/_fallbacks.py:1415
↓ 1 callersFunction_pycon_match
(match: Match[str])
scripts/utils/ruffen-docs.py:52
↓ 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:555
↓ 1 callersFunction_read_json
(response: httpx.Response)
src/anthropic/lib/middleware/_fallbacks.py:1454
↓ 1 callersFunction_read_json_async
(response: httpx.Response)
src/anthropic/lib/middleware/_fallbacks.py:1461
↓ 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:457
↓ 1 callersMethod_request_api_list
( self, model: Type[_T], page: Type[AsyncPageT], options: FinalRequestOptions,
src/anthropic/_base_client.py:2157
↓ 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:169
↓ 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:717
↓ 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:212
↓ 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:640
↓ 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:1176
↓ 1 callersMethod_should_retry
(self, response: httpx.Response)
src/anthropic/_client.py:400
↓ 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:368
↓ 1 callersMethod_splice_fallback_stream_async
( self, *, request: APIRequest, body: dict[str, Any], response: AsyncA
src/anthropic/lib/middleware/_fallbacks.py:402
↓ 1 callersMethod_spliced_frames
( self, *, request: APIRequest, body: dict[str, Any], response: APIRes
src/anthropic/lib/middleware/_fallbacks.py:458
↓ 1 callersMethod_spliced_frames_async
( self, *, request: APIRequest, body: dict[str, Any], response: AsyncA
src/anthropic/lib/middleware/_fallbacks.py:581
↓ 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_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:225
↓ 1 callersFunction_tool_result
(tool_use_id: str)
tests/lib/tools/test_session_runner.py:75
↓ 1 callersMethod_tools_for
(self, env: AgentToolContext)
src/anthropic/lib/environments/_worker.py:281
↓ 1 callersFunction_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:265
↓ 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:138
↓ 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_walk_grep
(rx: re.Pattern[str], search: Path)
src/anthropic/lib/tools/agent_toolset.py:676
↓ 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:214
↓ 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:121
↓ 1 callersFunctionasync_stream
()
examples/text_completions_streaming.py:29
← previousnext →601–700 of 4,447, ranked by callers