MCPcopy Create free account

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

Functions6,358 in github.com/anthropics/anthropic-sdk-python

↓ 15 callersFunctionis_dict
(obj: object)
src/anthropic/_utils/_utils.py:194
↓ 15 callersMethodupdate
Update Vault Args: display_name: Updated human-readable name for the vault. 1-255 characters. metadata: Metadat
src/anthropic/resources/beta/vaults/vaults.py:168
↓ 14 callersFunction_downloaded
A ``SessionMemoryStores`` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_folder_trust.py:32
↓ 14 callersFunction_mock_messages_endpoint
(respx_mock: MockRouter)
tests/lib/test_credentials.py:1972
↓ 14 callersFunction_tool_confirmation
The user's allow/deny verdict for an ask-gated (``always_ask``) tool call.
tests/lib/tools/test_session_runner.py:91
↓ 14 callersMethodcopy
( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] — narrows `credentials` to No
src/anthropic/lib/aws/_client.py:169
↓ 14 callersMethodinsert
Insert text at a specific line number in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:149
↓ 14 callersFunctionresolve_path
Resolve ``p`` against the workdir; reject results outside the permitted roots. The permitted roots are ``workdir`` plus each entry of ``allowed_r
src/anthropic/lib/tools/agent_toolset.py:386
↓ 14 callersMethodstart
(self)
examples/memory/basic.py:50
↓ 14 callersMethodstream
Create a Message stream
src/anthropic/resources/messages/messages.py:1000
↓ 13 callersFunctionTypeAdapter
(*_args: Any, **_kwargs: Any)
src/anthropic/_models.py:912
↓ 13 callersFunction_install_run_session_tools
( monkeypatch: pytest.MonkeyPatch, record: dict[str, Any], *, serve: Callable[[], Awaitable[No
tests/lib/environments/test_worker.py:189
↓ 13 callersFunctionbeta_edit_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:738
↓ 13 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:370
↓ 13 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:494
↓ 13 callersMethodsend
Send Events Args: events: Events to send to the `session`. betas: Optional header to specify the beta version(s
src/anthropic/resources/beta/sessions/events.py:158
↓ 13 callersMethodview
View the contents of a memory path.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:134
↓ 13 callersMethodwrite
(profile: str, *, with_base_url: Optional[str])
tests/lib/test_credentials.py:375
↓ 12 callersMethod__class__
(self)
src/anthropic/_utils/_proxy.py:48
↓ 12 callersFunction_as_dict
(value: object)
src/anthropic/lib/middleware/_fallbacks.py:1519
↓ 12 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:300
↓ 12 callersFunctionerror_logs
Messages the middleware logged at ERROR — refusals surfaced rather than retried.
tests/lib/test_refusal_fallback_streaming.py:37
↓ 12 callersFunctionev
Serialize one event payload as an SSE frame (its `type` is the event name).
tests/lib/test_refusal_fallback_streaming.py:105
↓ 12 callersFunctionget_args
(t: type[Any])
src/anthropic/_compat.py:30
↓ 12 callersFunctioniter_next
(iter: Iterator[_T] | AsyncIterator[_T])
tests/test_streaming.py:254
↓ 12 callersFunctionresolve_api_key
Resolve the API key. Returns None if using SigV4.
src/anthropic/lib/aws/_credentials.py:65
↓ 12 callersMethodstop
(self, work_id: str, **kwargs: Any)
tests/lib/environments/test_poller_method.py:64
↓ 11 callersFunction_downloaded
A ``SessionMemoryStores`` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_memory_sync.py:31
↓ 11 callersFunction_end_turn_response
()
tests/lib/tools/test_runners.py:1000
↓ 11 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:228
↓ 11 callersFunctionbody
()
tests/test_streaming.py:18
↓ 11 callersMethodclose
(self)
src/anthropic/lib/tools/agent_toolset.py:561
↓ 11 callersFunctiondeleted
(path: str, *, was: str)
tests/lib/tools/memory_sync/_fake_anthropic.py:81
↓ 11 callersMethodgenerate_tool_call_response
Generate a MessageParam by calling tool functions with any tool use blocks from the last message. Note the tool call response is cached, repe
src/anthropic/lib/tools/_beta_runner.py:246
↓ 11 callersMethodheartbeat
(self, work_id: str, **_kwargs: Any)
tests/lib/environments/test_worker.py:1106
↓ 11 callersMethodmonotonic
(self)
tests/lib/environments/test_worker.py:1008
↓ 11 callersMethodread
()
src/anthropic/lib/tools/_file_store.py:155
↓ 11 callersMethodrename
Rename or move a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:159
↓ 11 callersFunctionresolve_base_url
Resolve the base URL from constructor arg, env var, or region. Returns None if no base URL is resolvable (caller should raise).
src/anthropic/lib/aws/_credentials.py:108
↓ 11 callersFunctionresolve_region
Resolve the AWS region from constructor arg or env var. Does not silently default — returns None if no region is available.
src/anthropic/lib/aws/_credentials.py:82
↓ 11 callersMethodsend
(self, session_id: str, *, events: list[Any], extra_headers: Any = None)
tests/lib/tools/test_session_runner.py:225
↓ 10 callersFunction_downloaded
A ``SessionMemoryStores`` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_delete_discipline.py:32
↓ 10 callersFunction_install_aiter_work
(monkeypatch: pytest.MonkeyPatch, items: list[Any])
tests/lib/environments/test_worker.py:181
↓ 10 callersFunction_work_item
( *, work_type: str = "session", work_id: str = "w_1", session_id: str = "s_1", secret: str | None = None
tests/lib/environments/test_worker.py:173
↓ 10 callersMethodack
(self, work_id: str, **kwargs: Any)
tests/lib/environments/test_poller_method.py:61
↓ 10 callersMethodbind_base_url
Set the API ``base_url`` the token exchange POSTs to. For standalone use (no client) or tests. Clients bind through :meth:`for_base_u
src/anthropic/lib/credentials/_workload.py:205
↓ 10 callersMethodclose
(self)
src/anthropic/_client.py:410
↓ 10 callersMethodclose
(self)
src/anthropic/_client.py:826
↓ 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:327
↓ 10 callersFunctiondelta
(event_id: str, text: str, index: int | None = None)
tests/lib/sessions/test_accumulate.py:43
↓ 10 callersMethodflush_writes
Upload new and changed files; send no deletes and pull nothing. The push-only rescue pass for a session ending on an error or cancel —
src/anthropic/lib/tools/_memories.py:444
↓ 10 callersFunctionget_auth_headers
( *, method: str, url: str, headers: httpx2.Headers, aws_access_key: str | None, aws_s
src/anthropic/lib/aws/_auth.py:33
↓ 10 callersFunctionget_origin
(t: type[Any])
src/anthropic/_compat.py:36
↓ 10 callersFunctionget_origin
(tp: type[Any])
src/anthropic/_utils/_compat.py:19
↓ 10 callersMethodhashtree
``{rel_path: sha256_hex}`` of every file under the directory ``under``. Unchanged files — same size, mtime, and ctime since the last call —
src/anthropic/lib/tools/_file_store.py:184
↓ 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:418
↓ 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:440
↓ 10 callersMethodpoll
(self, environment_id: str, **kwargs: Any)
tests/lib/environments/test_poller_method.py:57
↓ 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:218
↓ 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:289
↓ 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:299
↓ 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:355
↓ 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:473
↓ 10 callersFunctiontag_helper
Mark an object as created by a named SDK helper.
src/anthropic/lib/_stainless_helpers.py:84
↓ 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:534
↓ 9 callersMethod__anext__
(self)
src/anthropic/_streaming.py:191
↓ 9 callersFunction_result_text
Concatenated text of the posted-back result's text blocks.
tests/lib/tools/test_session_runner.py:120
↓ 9 callersFunction_send_message_async
(client: AsyncAnthropic)
tests/lib/test_credentials.py:2811
↓ 9 callersFunctionaccumulate_managed_agents_event
( accumulated: AccumulatedEvent | None, event: BetaManagedAgentsAgentMessageEvent, )
src/anthropic/lib/sessions/_accumulate.py:22
↓ 9 callersFunctionassert_empty_iter
(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent])
tests/test_streaming.py:261
↓ 9 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
↓ 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:359
↓ 9 callersFunctionis_mapping
(obj: object)
src/anthropic/_utils/_utils.py:186
↓ 9 callersFunctionmessage_start
()
tests/lib/test_refusal_fallback_streaming.py:110
↓ 9 callersFunctionmiddleware_request_body
(request: APIRequest)
tests/test_middleware.py:82
↓ 9 callersMethodparse
(self, *, to: type[_T])
src/anthropic/_response.py:307
↓ 9 callersMethodparse
(self, *, to: type[_T])
src/anthropic/_response.py:420
↓ 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
↓ 9 callersMethodvalidate
Validate an external key config against the customer's KMS. Anthropic performs an encrypt/decrypt roundtrip against the configured K
src/anthropic/resources/beta/organization/external_keys.py:282
↓ 8 callersMethod_auth_block
Return the cached ``authentication`` sub-object from the config file.
src/anthropic/lib/credentials/_providers.py:501
↓ 8 callersFunction_blob_resource
(uri: str = "file:///x.bin", blob: str = "", mime: str | None = None)
tests/lib/tools/test_mcp_tool.py:47
↓ 8 callersMethod_calculate_nonstreaming_timeout
(self, max_tokens: int, max_nonstreaming_tokens: int | None)
src/anthropic/_base_client.py:748
↓ 8 callersFunction_downloaded
A ``SessionMemoryStores`` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_final_flush.py:26
↓ 8 callersFunction_idle_end_turn
()
tests/lib/tools/test_session_runner.py:110
↓ 8 callersFunction_message_json
()
tests/lib/test_stainless_helpers.py:38
↓ 8 callersMethod_resolve_under_root
(self, rel_path: str)
src/anthropic/lib/tools/_file_store.py:252
↓ 8 callersFunction_workload_credentials
()
tests/lib/test_credentials.py:2005
↓ 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:575
↓ 8 callersFunctionerror_body
(*, type: str, message: str)
tests/test_middleware.py:74
↓ 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 callersFunctionrefusal_delta
(token: str | None = "tok_abc", has_prefill_claim: bool = True)
tests/lib/test_refusal_fallback_streaming.py:128
↓ 8 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1062
↓ 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:183
↓ 7 callersFunction_api_status_error
(code: int)
tests/lib/tools/test_session_runner.py:125
← previousnext →101–200 of 6,358, ranked by callers