MCPcopy Create free account

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

Functions13,873 in github.com/anthropics/anthropic-sdk-python

↓ 5 callersMethod__init__
(self, message: str, request: httpx2.Request, *, body: object | None)
src/anthropic/_exceptions.py:64
↓ 5 callersMethod__init__
( self, *, url: URL, )
src/anthropic/_base_client.py:182
↓ 5 callersMethod__init__
( self, *, family: ToolsetFamily, helper_tag: StainlessHelperHeaderValue,
src/anthropic/lib/tools/_toolsets/_base.py:117
↓ 5 callersMethod_available_tool_names
The tool names currently available, after applying any mid-conversation `tool_removal` / `tool_addition` blocks. Removal is only a hi
src/anthropic/lib/tools/_beta_runner.py:560
↓ 5 callersFunction_bearer_tokens
The token on each HTTP request so far, in order.
tests/lib/test_credentials.py:3872
↓ 5 callersFunction_chunk_bytes_to_sse
(raw: bytes)
src/anthropic/lib/bedrock/_stream_decoder.py:71
↓ 5 callersFunction_created_store
(root: Path, *, utf8_only: bool = False)
tests/lib/tools/test_file_store.py:31
↓ 5 callersFunction_disabled
(entry: Any)
tests/lib/tools/toolsets/test_computer_interface.py:53
↓ 5 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_two_pass.py:24
↓ 5 callersFunction_emit
(event: str, payload: dict[str, Any])
src/anthropic/lib/middleware/_fallbacks.py:1621
↓ 5 callersMethod_get_http_client
Return an `httpx2.Client`, lazily creating (and tracking) one we own.
src/anthropic/lib/credentials/_providers.py:432
↓ 5 callersFunction_is_base_client
True only for the base `Anthropic` / `AsyncAnthropic` classes, not subclasses. Subclasses (`AnthropicAWS`, `AnthropicFoundry`) have their own aut
src/anthropic/_client.py:54
↓ 5 callersMethod_load_config
Read and cache the config file, resolving `base_url` and `credentials_path`. On Unix, refuses a file that group or others can write.
src/anthropic/lib/credentials/_providers.py:306
↓ 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:2420
↓ 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:4926
↓ 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:5286
↓ 5 callersFunctionaccumulate_event
( *, event: BetaRawMessageStreamEvent, current_snapshot: ParsedBetaMessage[ResponseFormatT] | None
src/anthropic/lib/streaming/_beta_messages.py:494
↓ 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 callersMethodcancel
Stop a `pending` or `running` dream. The response shows `status` as `canceled`, unless the dream reached `completed` or `fai
src/anthropic/resources/beta/dreams.py:400
↓ 5 callersFunctioncapturing
(contexts: list[AgentToolContext])
tests/lib/environments/test_worker.py:81
↓ 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:73
↓ 5 callersMethodcreate_root
Create the root directory and any missing ancestors; already existing is fine.
src/anthropic/lib/tools/_file_store.py:115
↓ 5 callersMethoddo
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/toolsets/_computer_fakes.py:44
↓ 5 callersFunctionemitting
(*calls: Call)
tests/lib/tools/test_session_runner.py:100
↓ 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 callersFunctionerror
(status: int, message: str)
tests/lib/tools/_fake_sessions_api.py:790
↓ 5 callersMethodexecute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_confirm.py:224
↓ 5 callersFunctionfield_outer_type
(field: FieldInfo)
src/anthropic/_compat.py:99
↓ 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:248
↓ 5 callersFunctionhop_refusal
A fallback hop that contributes one text block, then refuses with a fresh token.
tests/lib/test_refusal_fallback_streaming.py:723
↓ 5 callersFunctionis_fatal
(status: int | str)
tests/lib/tools/_fake_sessions_api.py:786
↓ 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 callersFunctionjitter
Uniform random delay in `[low, high)` — spreads out retry storms.
src/anthropic/lib/_retry.py:51
↓ 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 callersMethodls
The relative path of every file under the directory `under`.
src/anthropic/lib/tools/_file_store.py:169
↓ 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 callersMethodof
(self, *kinds: str)
tests/lib/environments/test_worker_properties.py:114
↓ 5 callersMethodpatch
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/anthropic/_base_client.py:1701
↓ 5 callersMethodpermission
(self, session: FakeSession, state: CallState)
tests/lib/tools/test_session_runner_properties.py:187
↓ 5 callersFunctionposted
(id: str)
tests/lib/tools/test_session_runner.py:304
↓ 5 callersMethodprovider
(*, force_refresh: bool = False)
tests/lib/test_credentials.py:1614
↓ 5 callersMethodpush
(self, *items: Event | str)
tests/lib/tools/_fake_sessions_api.py:211
↓ 5 callersFunctionrefusal
(status: int, details: object = None)
tests/lib/environments/_fake_work_api.py:547
↓ 5 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1976
↓ 5 callersMethodreset
(self)
src/anthropic/lib/environments/_poller.py:80
↓ 5 callersMethodretrieve
Get a specific model. The Models API response can be used to determine information about a specific model or resolve a model
src/anthropic/resources/models.py:45
↓ 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:961
↓ 5 callersFunctionsetting
(name: str, value: object)
tests/lib/tools/test_session_runner.py:124
↓ 5 callersFunctionshort_turn
(at: float)
tests/lib/tools/memory_sync/test_e2e_memory.py:40
↓ 5 callersFunctiontext
(value: str)
tests/lib/tools/test_runner_eager_tools.py:821
↓ 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:1017
↓ 5 callersMethodunyielded
(self, session: FakeSession)
tests/lib/tools/test_session_runner_properties.py:308
↓ 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:953
↓ 5 callersMethodwalk
()
src/anthropic/lib/tools/_file_store.py:173
↓ 5 callersMethodwas_given
(self, session: FakeSession, ids: set[str])
tests/lib/tools/test_session_runner_properties.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
↓ 4 callersMethod__init__
( self, cls: type[BaseToolset[Any, Any, Any]], *, configs: BetaBrowserToolsetC
src/anthropic/lib/tools/_toolsets/_browser.py:117
↓ 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:2440
↓ 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:916
↓ 4 callersFunction_call
(browser: FakeBrowser | AsyncFakeBrowser, name: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_pipeline.py:345
↓ 4 callersFunction_canonicalize
Return `path` with `.`/`..` collapsed lexically and every symlink followed, or raise `OSError` — the same outcome on every supported Python, a
src/anthropic/lib/tools/agent_toolset.py:374
↓ 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 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
← previousnext →501–600 of 13,873, ranked by callers