MCPcopy Create free account

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

Functions12,274 in github.com/anthropics/anthropic-sdk-python

↓ 5 callersFunction_member_use
(name: str, id: str, input: dict[str, Any], family: str = "computer")
tests/lib/tools/toolsets/test_computer_runner.py:56
↓ 5 callersFunction_mock_token_exchange
(respx_mock: MockRouter, base_url: str, token: str)
tests/lib/test_credentials.py:2415
↓ 5 callersFunction_noop_tool
(flavour: str, name: str)
tests/lib/tools/toolsets/test_browser_runner.py:393
↓ 5 callersMethod_prepare_options
(self, options: FinalRequestOptions)
src/anthropic/lib/foundry.py:267
↓ 5 callersFunction_ran_result
(tool_use_id: str, label: str)
tests/lib/tools/test_runners.py:1632
↓ 5 callersFunction_run_sync_tool_use
Drive a tool runner over `messages` and collect the tool_result messages it generated.
tests/lib/tools/test_runners.py:1018
↓ 5 callersMethod_sent_host_and_workspace
( client: Anthropic | AsyncAnthropic, respx_mock: MockRouter )
tests/lib/test_credentials.py:4601
↓ 5 callersFunction_to_session_content
(content: Any)
tests/lib/tools/test_session_runner.py:2209
↓ 5 callersFunction_use
(name: str, input: dict[str, Any], id: str = "toolu_1")
tests/lib/tools/toolsets/test_pipeline.py:52
↓ 5 callersMethod_write_refresh_profile
(self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4961
↓ 5 callersFunctionaccumulate_event
( *, event: BetaRawMessageStreamEvent, current_snapshot: ParsedBetaMessage[ResponseFormatT] | None
src/anthropic/lib/streaming/_beta_messages.py:492
↓ 5 callersFunctionapi_error_response
( status: int, error_type: str, message: str, *, error_code: str | None = None, **details: Any )
tests/lib/threads/helpers.py:766
↓ 5 callersFunctionassert_different_identities
(obj1: object, obj2: object)
tests/test_files.py:110
↓ 5 callersFunctionassert_message_matches
(message: BetaMessage, expected: Dict[str, Any])
tests/lib/streaming/test_beta_messages.py:231
↓ 5 callersFunctionasync_mcp_tool
Convert an MCP tool to an async runnable tool for `tool_runner()`. Example: ```py from anthropic.lib.tools.mcp import async_mcp_tool
src/anthropic/lib/tools/mcp.py:380
↓ 5 callersFunctionasync_prepare_request_data
`prepare_request_data`, reading `pathlib.Path` inputs without blocking the event loop.
src/anthropic/_utils/_prepare.py:64
↓ 5 callersFunctionbounded_error
`checked_error` with no check: each text block cut to the field limit, for a family with nothing to redact.
src/anthropic/lib/tools/_toolsets/_base.py:565
↓ 5 callersFunctionbounded_tab_url
A tab's or download's URL as the model reads it: folded to one line, not parsed, held to `FIELD_MAX`. A longer one becomes `…` plus its first `FIE
src/anthropic/lib/tools/_toolsets/_sanitize.py:99
↓ 5 callersFunctionbuild
Construct a BaseModel class without validation. This is useful for cases where you need to instantiate a `BaseModel` from an API response as
src/anthropic/_models.py:629
↓ 5 callersMethodcopy
( self, *, method: str | NotGiven = not_given, url: str | NotGiven = not_given
src/anthropic/_request.py:69
↓ 5 callersFunctioncopy_scoped_client
Return a copy of `scoped`, a client that `_copy_client_with_bearer_auth` made, with `open_telemetry` as its option. A new client reads `ANTHROPIC
src/anthropic/lib/_scoped_client.py:70
↓ 5 callersMethodcreate_root
Create the root directory and any missing ancestors; already existing is fine.
src/anthropic/lib/tools/_file_store.py:115
↓ 5 callersMethoddisarm
Cancel the idle countdown; only signals on an actual transition.
src/anthropic/lib/tools/_beta_session_runner.py:217
↓ 5 callersMethoddispose
Remove every store directory that `download` created. Pre-existing directories are left alone — that is `FileStore.dispose`'s own rul
src/anthropic/lib/tools/_memories.py:540
↓ 5 callersMethoddo
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/toolsets/_computer_fakes.py:44
↓ 5 callersFunctiondownload_session_skills
Download the session agent's skills into `{workdir}/skills/<name>/`. Reads the resolved agent off `session`, and for each skill fetches its f
src/anthropic/lib/tools/_skills.py:200
↓ 5 callersMethodend_turn
Mark the turn in flight finished, take back the messages it was started with unless a reply to them started, and apply the history edits defer
src/anthropic/lib/threads/_thread_state.py:257
↓ 5 callersMethodexecute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_confirm.py:224
↓ 5 callersMethodfor_base_url
Return the provider a client with `base_url` should exchange through. Binds in place, unless another client already bound this instance to a
src/anthropic/lib/credentials/_providers.py:246
↓ 5 callersFunctionhelper_header
The `x-stainless-helper: <value>` header dict, for passing into a `merge_headers` call or as `extra_headers`/`default_headers`. Typing keeps
src/anthropic/lib/_stainless_helpers.py:76
↓ 5 callersFunctionhop_refusal
A fallback hop that contributes one text block, then refuses with a fresh token.
tests/lib/test_refusal_fallback_streaming.py:721
↓ 5 callersFunctionis_fatal_status_error
True for a 4xx that retrying will not fix (bad key, missing resource). Aligns with the core client's `_should_retry` policy: 408 / 409 / 429 are
src/anthropic/lib/_retry.py:42
↓ 5 callersFunctionis_mapping_t
(obj: _MappingT | object)
src/anthropic/_utils/_utils.py:190
↓ 5 callersMethodis_recording
(self)
tests/test_tracing.py:41
↓ 5 callersMethoditer_bytes
A byte-iterator over the decoded response content. This automatically handles gzip, deflate and brotli encoded responses.
src/anthropic/_response.py:388
↓ 5 callersMethodlist
List Files Args: ids: Restrict the result set to Files whose `id` is in this list. At most 100 entries (afte
src/anthropic/resources/files.py:59
↓ 5 callersFunctionmake_lenient_client
A client with the default (non-strict) response validation. The fixture wire's terminal refusal delta self-reports a `{type: "message"}` iter
tests/lib/test_refusal_fallback_streaming.py:85
↓ 5 callersFunctionmcp_tool
Convert an MCP tool to a sync runnable tool for `tool_runner()`. Example: ```py from anthropic.lib.tools.mcp import mcp_tool tools_
src/anthropic/lib/tools/mcp.py:316
↓ 5 callersFunctionmerge_output_config
`output_config` with `output_format` as its `format`, when given.
src/anthropic/lib/_parse/_transform.py:44
↓ 5 callersFunctionmodel_dump
( model: pydantic.BaseModel, *, exclude: IncEx | None = None, exclude_unset: bool = False,
src/anthropic/_compat.py:139
↓ 5 callersMethodprovider
(*, force_refresh: bool = False)
tests/lib/test_credentials.py:1609
↓ 5 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1960
↓ 5 callersFunctionset_error_status
Sets the `ERROR` status and `error.type`. Anything but an `Exception`, such as a `CancelledError`, is the application stopping the operation,
src/anthropic/_tracing.py:753
↓ 5 callersMethodset_messages
Take the history from `messages`: additions to the current history are staged, and any other list replaces it and starts a new thread.
src/anthropic/lib/threads/_thread_state.py:189
↓ 5 callersFunctionset_pydantic_config
Add a pydantic config for the given type. Note: this is a no-op on Pydantic v1.
src/anthropic/_models.py:957
↓ 5 callersFunctiontext
(value: str)
tests/lib/tools/test_runner_eager_tools.py:821
↓ 5 callersFunctionto_json_output_format
The `output_config.format` param that asks for replies matching `output_format`'s JSON schema.
src/anthropic/lib/_parse/_transform.py:29
↓ 5 callersFunctiontool_removal
(name: str)
tests/lib/threads/helpers.py:207
↓ 5 callersFunctiontoolset_result_block
The `tool_result` answering a member `tool_use`. `toolset_name` is required on a member result (the API rejects a mismatch), so it is echoed on er
src/anthropic/lib/tools/_toolsets/_runnable.py:264
↓ 5 callersFunctiontransforming_stream
A hop whose message_start reports `input_transformations`. It serves — its terminal message_delta carrying `delta_transformations` only when given
tests/lib/test_refusal_fallback_streaming.py:1014
↓ 5 callersMethodupdate
Update a member's organization role. Args: user_id: ID of the User. role: New role for the User.
src/anthropic/resources/organization/users.py:86
↓ 5 callersFunctionvalidate_type
Strict validation that the given value matches the expected type
src/anthropic/_models.py:949
↓ 5 callersMethodwalk
()
src/anthropic/lib/tools/_file_store.py:173
↓ 5 callersFunctionwith_environment_headers
Adds the headers of `ANTHROPIC_CUSTOM_HEADERS` to `default_headers`, which win, as `Anthropic` does.
src/anthropic/lib/_env.py:7
↓ 5 callersMethodworker
()
tests/lib/test_credentials.py:1795
↓ 4 callersMethod__init__
( self, cls: type[BaseToolset[Any, Any, Any]], *, configs: BetaBrowserToolsetC
src/anthropic/lib/tools/_toolsets/_browser.py:117
↓ 4 callersFunction_adrain_one
(ait: AsyncIterator[Any])
tests/lib/environments/test_poller_method.py:144
↓ 4 callersFunction_apply_hop
`entry` applied as a patch against `body`: a field set to a value overrides it, a field explicitly `None` unsets it (absent from the retried r
src/anthropic/lib/middleware/_fallbacks.py:1543
↓ 4 callersFunction_assert_credential_chain_off
(client: AnthropicGoogleCloud | AsyncAnthropicGoogleCloud)
tests/lib/test_google_cloud.py:1187
↓ 4 callersFunction_assert_exchanged_and_called_own_deployment
The traffic seen by `base_url` is exactly one exchange followed by one request bearing the token that exchange minted.
tests/lib/test_credentials.py:2435
↓ 4 callersFunction_async_secure_mkdir
(path: AsyncPath, mode: int = _DIR_CREATE_MODE)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:665
↓ 4 callersMethod_calculate_retry_timeout
( self, remaining_retries: int, options: FinalRequestOptions, response_headers
src/anthropic/_base_client.py:908
↓ 4 callersFunction_call
(browser: FakeBrowser | AsyncFakeBrowser, name: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_pipeline.py:345
↓ 4 callersFunction_count
(respx_mock: MockRouter)
tests/lib/test_output_format_helpers.py:19
↓ 4 callersFunction_current_messages
(runner: Union[BetaToolRunner[None], BetaAsyncToolRunner[None]])
tests/lib/tools/test_runners.py:2570
↓ 4 callersFunction_end_turn
Record the stream and free the thread, unless the turn has ended already: the whole reply if the stream reached `message_stop`, the partial reply
src/anthropic/lib/threads/_stream_managers.py:113
↓ 4 callersMethod_for_tool_runner
The thread of a tool runner that is made from the params of its requests. It sends no `thread` field on a client without message threads or wh
src/anthropic/lib/threads/_beta_threads.py:71
↓ 4 callersFunction_format_file_size
(bytes_size: int)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:376
↓ 4 callersMethod_get_last_message
(self)
src/anthropic/lib/tools/_beta_runner.py:884
↓ 4 callersMethod_get_last_message
(self)
src/anthropic/lib/tools/_beta_runner.py:1331
↓ 4 callersFunction_get_open_connections
(client: Anthropic | AsyncAnthropic)
tests/test_client.py:109
↓ 4 callersFunction_idle
(stop_reason: str)
tests/lib/tools/test_session_runner.py:123
↓ 4 callersMethod_item
(self, path: str, *, view: str = "full")
tests/lib/tools/memory_sync/_fake_anthropic.py:96
↓ 4 callersFunction_json_dumps
(value: Any)
src/anthropic/lib/middleware/_fallbacks.py:1599
↓ 4 callersFunction_last_body
(respx_mock: MockRouter)
tests/lib/test_output_format_helpers.py:23
↓ 4 callersMethod_make_status_error
( self, err_msg: str, *, body: object, response: httpx2.Response,
src/anthropic/_base_client.py:544
↓ 4 callersFunction_max_tokens_with_tool_use
()
tests/lib/tools/test_runners.py:879
↓ 4 callersFunction_member_use
(name: str, id: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_browser_runner.py:52
↓ 4 callersFunction_mock_work_api
( respx_mock: MockRouter, polls: list[httpx2.Response], actions: tuple[str, ...] = ("ack", "stop") )
tests/lib/environments/test_poller_method.py:590
↓ 4 callersMethod_prepare_options
(self, options: FinalRequestOptions)
src/anthropic/lib/foundry.py:481
↓ 4 callersFunction_read_env
Return the first non-None value from the given env vars, or None.
src/anthropic/lib/aws/_credentials.py:22
↓ 4 callersFunction_refusal
The refusal behind the `ToolError` a call raises: its cause, whose own text is what the model reads.
tests/lib/tools/toolsets/test_refusals.py:47
↓ 4 callersFunction_require_https
Reject non-`https://` token-endpoint URLs. Localhost is allowed for testing so `base_url="http://localhost:8080"` works against a local serve
src/anthropic/lib/credentials/_constants.py:112
↓ 4 callersFunction_run_tool_use
`_run_sync_tool_use` for either client.
tests/lib/tools/test_runners.py:2246
↓ 4 callersFunction_runner_class
(*, sync: bool, stream: bool)
tests/lib/tools/test_runners.py:3573
↓ 4 callersFunction_secure_mkdir
Create `path` and any missing parents with `mode`, regardless of umask. `Path.mkdir(parents=True, mode=...)` and `os.makedirs(mode=...)` apply th
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:308
↓ 4 callersFunction_sse_body
( id: str, text: str = "Hello there!", *, tool_use_id: str | None = None, container: str |
tests/lib/threads/helpers.py:675
↓ 4 callersFunction_tar_file
( name: str, data: bytes, *, mode: int = 0o644, type: bytes = tarfile.REGTYPE )
tests/lib/tools/test_skills.py:99
↓ 4 callersMethod_toolset_confirm
The approval gate: every call about to run is shown to `confirm` first, inside the pipeline and under the lock, so no override of `execute` or
src/anthropic/lib/tools/_toolsets/_base.py:324
↓ 4 callersMethod_toolset_member_method
Resolve `name` through the registry before touching the instance: `getattr(self, name)` on raw model output would reach `__init__` or any othe
src/anthropic/lib/tools/_toolsets/_base.py:238
↓ 4 callersMethod_turn_options
The runner's request options for a turn on `thread`. A turn's `extra_headers` replace the thread's, so the runner's helper tags go on top of t
src/anthropic/lib/tools/_beta_runner.py:278
↓ 4 callersFunction_weather_tool
A `get_weather(location, units)` tool over `run`, synchronous or asynchronous.
tests/lib/tools/test_runners.py:2235
↓ 4 callersFunction_zip_entry
(name: str, *, mode: int, create_system: int = 3)
tests/lib/tools/test_skills.py:124
↓ 4 callersFunctionaccumulate_event
( *, event: RawMessageStreamEvent, current_snapshot: ParsedMessage[ResponseFormatT] | None, js
src/anthropic/lib/streaming/_messages.py:464
↓ 4 callersMethodaiter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:371
↓ 4 callersFunctionas_sent
A copy of `value` with every model in it dumped as a request body sends it.
src/anthropic/lib/threads/_thread_state.py:641
↓ 4 callersFunctionasync_interrupted_stream_response
( id: str, text: str, *, error: type[httpx2.TransportError] | None = None )
tests/lib/threads/helpers.py:502
↓ 4 callersFunctionasync_requester
A method shaped like a generated streaming method, whose response is `body`.
tests/utils.py:242
↓ 4 callersFunctionasync_to_custom_raw_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support returning the given respo
src/anthropic/_response.py:844
↓ 4 callersFunctionasync_to_custom_streamed_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support streaming and returning t
src/anthropic/_response.py:762
← previousnext →501–600 of 12,274, ranked by callers