MCPcopy Create free account

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

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

↓ 10 callersFunctionbeta_edit_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:548
↓ 10 callersFunctionbeta_read_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:491
↓ 10 callersMethodclose
(self)
src/anthropic/lib/tools/agent_toolset.py:414
↓ 10 callersMethodcopy
( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] — subclass intentionally drop
src/anthropic/lib/aws/_client.py:167
↓ 10 callersMethodcreate_enrollment_url
Create Enrollment URL Args: betas: Optional header to specify the beta version(s) you want to use. extra_header
src/anthropic/resources/beta/user_profiles.py:306
↓ 10 callersFunctiondelta
(event_id: str, text: str, index: int | None = None)
tests/lib/sessions/test_accumulate.py:43
↓ 10 callersFunctionget_args
(t: type[Any])
src/anthropic/_compat.py:30
↓ 10 callersFunctionget_origin
(t: type[Any])
src/anthropic/_compat.py:36
↓ 10 callersFunctionget_origin
(tp: type[Any])
src/anthropic/_utils/_compat.py:19
↓ 10 callersMethodheartbeat
( self, work_id: str, *, environment_id: str, expected_last_heartbeat:
tests/lib/environments/test_worker.py:42
↓ 10 callersFunctionmake_event_iterator
( content: Iterator[bytes], *, sync: bool, client: Anthropic, async_client: AsyncAnthropic
tests/test_streaming.py:266
↓ 10 callersMethodmcp_oauth_validate
Validate Credential Args: betas: Optional header to specify the beta version(s) you want to use. extra_headers:
src/anthropic/resources/beta/vaults/credentials.py:414
↓ 10 callersFunctionmodel_copy
(model: _ModelT, *, deep: bool = False)
src/anthropic/_compat.py:122
↓ 10 callersFunctionopenapi_dumps
Serialize an object to UTF-8 encoded JSON bytes. Extends the standard json.dumps with support for additional types commonly used in the
src/anthropic/_utils/_json.py:11
↓ 10 callersMethodpause
Pause Deployment Args: betas: Optional header to specify the beta version(s) you want to use. extra_headers: Se
src/anthropic/resources/beta/deployments.py:425
↓ 10 callersMethodpoll
(self, environment_id: str, **kwargs: Any)
tests/lib/environments/test_poller_method.py:54
↓ 10 callersMethodredact
Redact a memory version Args: betas: Optional header to specify the beta version(s) you want to use. extra_head
src/anthropic/resources/beta/memory_stores/memory_versions.py:210
↓ 10 callersFunctionresolve_workspace_id
Resolve the workspace ID from constructor arg or env var(s). Returns None if no workspace ID is available (caller should raise).
src/anthropic/lib/aws/_credentials.py:93
↓ 10 callersMethodresults
Streams the results of a Message Batch as a `.jsonl` file. Each line in the file is a JSON object containing the result of a single
src/anthropic/resources/messages/batches.py:285
↓ 10 callersMethodretrieve_metadata
Get File Metadata Args: file_id: ID of the File. betas: Optional header to specify the beta version(s) you want
src/anthropic/resources/beta/files.py:237
↓ 10 callersMethodreveal_token
The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
src/anthropic/resources/beta/tunnels/tunnels.py:295
↓ 10 callersMethodrotate_token
The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
src/anthropic/resources/beta/tunnels/tunnels.py:351
↓ 10 callersMethodstats
Get statistics about the work queue for an environment. Args: betas: Optional header to specify the beta version(s) you wa
src/anthropic/resources/beta/environments/work.py:466
↓ 10 callersMethodunpause
Unpause Deployment Args: betas: Optional header to specify the beta version(s) you want to use. extra_headers:
src/anthropic/resources/beta/deployments.py:519
↓ 10 callersMethoduntil_done
Blocks until the stream has been consumed
src/anthropic/lib/streaming/_messages.py:118
↓ 10 callersMethodupload
Upload File Args: file: The file to upload betas: Optional header to specify the beta version(s) you want to us
src/anthropic/resources/beta/files.py:286
↓ 9 callersFunction_fake_client
(work: _FakeWorkResource, sessions: _FakeSessions)
tests/lib/environments/test_worker.py:84
↓ 9 callersFunctionaccumulate_managed_agents_event
( accumulated: AccumulatedEvent | None, event: BetaManagedAgentsAgentMessageEvent, )
src/anthropic/lib/sessions/_accumulate.py:22
↓ 9 callersMethodadd
Add Session Resource Args: file_id: ID of a previously uploaded file. mount_path: Mount path in the container.
src/anthropic/resources/beta/sessions/resources.py:296
↓ 9 callersFunctionaiter_work
Async version of :func:`iter_work`. See its docstring for semantics, including how ``extra_headers`` is passed through per request.
src/anthropic/lib/environments/_poller.py:189
↓ 9 callersFunctionassert_empty_iter
(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent])
tests/test_streaming.py:261
↓ 9 callersMethodbind_base_url
Set the API ``base_url`` the token exchange POSTs to. Called by :class:`anthropic.Anthropic` when this object is passed as ``credenti
src/anthropic/lib/credentials/_workload.py:204
↓ 9 callersMethodclose
(self)
src/anthropic/_client.py:418
↓ 9 callersMethodclose
(self)
src/anthropic/_client.py:832
↓ 9 callersMethodcopy
Create a new client re-using the current options, with optional overrides. Passing either of ``token_provider`` / ``credentials`` replaces th
src/anthropic/lib/google_cloud/_client.py:365
↓ 9 callersFunctionmessage_start
()
tests/lib/test_refusal_fallback_streaming.py:110
↓ 9 callersFunctionmiddleware_request_body
(request: APIRequest)
tests/test_middleware.py:83
↓ 9 callersMethodmodel_dump_json
Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json Generates a JSON representation of the model using
src/anthropic/_models.py:364
↓ 9 callersFunctionrequest_bodies
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:97
↓ 9 callersFunctionseed
(event_id: str)
tests/lib/sessions/test_accumulate.py:28
↓ 9 callersMethodstr_replace
Replace text in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:144
↓ 8 callersMethod__anext__
(self)
src/anthropic/_streaming.py:235
↓ 8 callersFunction_blob_resource
(uri: str = "file:///x.bin", blob: str = "", mime: str | None = None)
tests/lib/tools/test_mcp_tool.py:48
↓ 8 callersMethod_calculate_nonstreaming_timeout
(self, max_tokens: int, max_nonstreaming_tokens: int | None)
src/anthropic/_base_client.py:769
↓ 8 callersFunction_idle_end_turn
()
tests/lib/tools/test_session_runner.py:106
↓ 8 callersFunction_merge_output_configs
( output_config: BetaOutputConfigParam | Omit, output_format: Optional[BetaJSONOutputFormatParam] | Om
src/anthropic/resources/beta/messages/messages.py:4206
↓ 8 callersFunction_message_json
()
tests/lib/test_stainless_helpers.py:34
↓ 8 callersFunctionconstruct_type_unchecked
Loose coercion to the expected type with construction of nested values. Note: the returned value from this function is not guaranteed to match th
src/anthropic/_models.py:569
↓ 8 callersFunctionerror_body
(*, type: str, message: str)
tests/test_middleware.py:75
↓ 8 callersFunctionfold
( msg: BetaManagedAgentsAgentMessageEvent, ev: BetaManagedAgentsDeltaEvent, )
tests/lib/sessions/test_accumulate.py:34
↓ 8 callersFunctionis_list
(obj: object)
src/anthropic/_utils/_utils.py:198
↓ 8 callersFunctionis_mapping
(obj: object)
src/anthropic/_utils/_utils.py:186
↓ 8 callersMethodparse
(self, *, to: type[_T])
src/anthropic/_response.py:307
↓ 8 callersMethodparse
(self, *, to: type[_T])
src/anthropic/_response.py:416
↓ 8 callersFunctionrefusal_delta
(token: str | None = "tok_abc", has_prefill_claim: bool = True)
tests/lib/test_refusal_fallback_streaming.py:128
↓ 8 callersFunctionresolve_path
Resolve ``p`` against the workdir; reject results that escape it. Absolute and relative inputs go through the same canonicalise-then-contain
src/anthropic/lib/tools/agent_toolset.py:258
↓ 8 callersFunctiontag_helper
Mark an object as created by a named SDK helper.
src/anthropic/lib/_stainless_helpers.py:84
↓ 8 callersMethodto_json
Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation). By default, fields th
src/anthropic/_models.py:177
↓ 7 callersMethod_auth_block
Return the cached ``authentication`` sub-object from the config file.
src/anthropic/lib/credentials/_providers.py:473
↓ 7 callersMethod_ensure_memory_root
Ensure the memory root directory exists
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:669
↓ 7 callersFunction_extract_skill_archive
Extract a skill download (a zip or tar.* archive) from disk into ``dest``. Skill bundles are wrapped in a single directory named after the skill;
src/anthropic/lib/tools/_skills.py:108
↓ 7 callersFunction_install_scoped_client
Intercept the shared bearer-auth client factory. Returns the list of args the factory was called with so a test can assert on the helper-tele
tests/lib/environments/test_worker.py:90
↓ 7 callersMethod_make_client
(self)
tests/lib/test_bedrock_mantle.py:120
↓ 7 callersFunction_mock_client
Return a mock that quacks like ClientSession.call_tool.
tests/lib/tools/test_mcp_tool.py:56
↓ 7 callersFunction_read_result
(contents: list[Any])
tests/lib/tools/test_mcp_tool.py:52
↓ 7 callersFunction_result_text
Concatenated text of the posted-back result's text blocks.
tests/lib/tools/test_session_runner.py:116
↓ 7 callersFunction_send_message_async
(client: AsyncAnthropic)
tests/lib/test_credentials.py:2565
↓ 7 callersFunction_text_resource
(uri: str = "file:///x.txt", text: str = "hello", mime: str | None = None)
tests/lib/tools/test_mcp_tool.py:44
↓ 7 callersMethod_validate_path
Validate and resolve memory paths
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:387
↓ 7 callersFunctionbeta_agent_toolset_20260401
Return the ``agent_toolset_20260401`` implementations bound to ``ctx``. The result is a plain list of :class:`~anthropic.lib.tools.BetaAsyncFunct
src/anthropic/lib/tools/agent_toolset.py:730
↓ 7 callersFunctionbeta_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:102
↓ 7 callersFunctionblock_starts
(events: list[BetaRawMessageStreamEvent])
tests/lib/test_refusal_fallback_streaming.py:189
↓ 7 callersMethodexec
(self, cmd: str, timeout: float = BASH_DEFAULT_TIMEOUT)
src/anthropic/lib/tools/agent_toolset.py:338
↓ 7 callersMethodextra_headers
Return headers derived from the config file (e.g. ``workspace_id``). Eagerly reads the config if not yet loaded. The returned dict is
src/anthropic/lib/credentials/_providers.py:259
↓ 7 callersFunctionextract_type_arg
(typ: type, index: int)
src/anthropic/_utils/_typing.py:83
↓ 7 callersFunctionextract_type_var_from_base
Given a type like `Foo[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g. ```py
src/anthropic/_utils/_typing.py:91
↓ 7 callersFunctionget_args
(tp: type[Any])
src/anthropic/_utils/_compat.py:15
↓ 7 callersFunctionmodel_dump
( model: pydantic.BaseModel, *, exclude: IncEx | None = None, exclude_unset: bool = False,
src/anthropic/_compat.py:144
↓ 7 callersMethodparse
(self, *, to: type[_T])
src/anthropic/_legacy_response.py:97
↓ 7 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1083
↓ 7 callersFunctionrequest_body
(call: MockRequestCall)
tests/test_middleware.py:79
↓ 7 callersFunctionvalidate_credentials
Raise if only one of aws_access_key/aws_secret_key is provided.
src/anthropic/lib/aws/_credentials.py:7
↓ 6 callersMethod_build_workload_delegate
(self, auth: Dict[str, Any])
src/anthropic/lib/credentials/_providers.py:670
↓ 6 callersFunction_install_run_session_tools
(monkeypatch: pytest.MonkeyPatch, record: dict[str, Any])
tests/lib/environments/test_worker.py:123
↓ 6 callersFunction_mock_token_endpoint
(respx_mock: MockRouter)
tests/lib/test_credentials.py:1853
↓ 6 callersMethod_validate_path
Validate and resolve memory paths
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:673
↓ 6 callersMethod_walk_sync_auth
(client: Anthropic)
tests/lib/test_credentials.py:2938
↓ 6 callersMethod_workload_provider
(self, handler: Callable[[httpx.Request], httpx.Response])
tests/lib/test_credentials.py:3251
↓ 6 callersMethodaclose
(self)
src/anthropic/lib/middleware/_fallbacks.py:1563
↓ 6 callersFunctionasync_to_httpx_files
(files: None)
src/anthropic/_files.py:86
↓ 6 callersFunctionasyncify
Take a blocking function and create an async one that receives the same positional and keyword arguments. Usage: ```python def
src/anthropic/_utils/_sync.py:28
↓ 6 callersFunctionbeta_async_tool
(func: AsyncFunctionT)
src/anthropic/lib/tools/_beta_functions.py:468
↓ 6 callersFunctionextract_response_type
Given a type like `APIResponse[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g.
src/anthropic/_response.py:860
↓ 6 callersFunctionfoo
(a: str | None = None)
tests/test_required_args.py:10
↓ 6 callersMethodinvalidate
Clear the cached token so the next :meth:`get_token` re-invokes the provider. Also sets a one-shot ``force_refresh`` flag so on-disk provider
src/anthropic/lib/credentials/_cache.py:177
↓ 6 callersFunctionis_annotated_type
(typ: type)
src/anthropic/_utils/_typing.py:21
↓ 6 callersFunctionmcp_resource_to_content
Convert MCP resource contents to an Anthropic content block. Finds the first resource with a supported MIME type from the result's ``contents
src/anthropic/lib/tools/mcp.py:252
↓ 6 callersMethodparse
( self, *, max_tokens: int, messages: Iterable[MessageParam], model: M
src/anthropic/resources/messages/messages.py:1202
↓ 6 callersMethodrun
Poll the environment and service each claimed session until cancelled. Loops forever; cancel the task (or wrap it in :func:`asyncio.wait_for`
src/anthropic/lib/environments/_worker.py:292
↓ 6 callersMethodstop
Track a content_block_stop, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1231
← previousnext →101–200 of 4,857, ranked by callers