MCPcopy Create free account

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

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

↓ 2 callersFunction_async_validate_no_symlink_escape
(target_path: AsyncPath, memory_root: AsyncPath)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:659
↓ 2 callersMethod_atomic_write_credentials
Atomic write to the credentials file (NOT the config file). `data` may hold `SecretStr` token values (see `_read_credentials`); they
src/anthropic/lib/credentials/_providers.py:460
↓ 2 callersFunction_atomic_write_file
(target_path: Path, content: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:283
↓ 2 callersMethod_attempt_request
Prepare, build and send a single HTTP attempt. Returns the response regardless of its status code, along with the prepared options it
src/anthropic/_base_client.py:1421
↓ 2 callersMethod_attempt_request
Prepare, build and send a single HTTP attempt. Returns the response regardless of its status code, along with the prepared options it
src/anthropic/_base_client.py:2211
↓ 2 callersFunction_bind_credentials_base_url
Return the provider this client should exchange tokens through. See `BaseURLBoundProvider`; any other provider (plain callables, custom impls
src/anthropic/_client.py:69
↓ 2 callersMethod_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:2143
↓ 2 callersFunction_build_result_event
Build the result-event params matching `ev`'s tool-call kind. A custom tool call (`agent.custom_tool_use`) is answered with a `user.custom_to
src/anthropic/lib/tools/_beta_session_runner.py:237
↓ 2 callersMethod_calls_among
A new ID can be that of a later call.
src/anthropic/lib/tools/_beta_session_runner.py:831
↓ 2 callersMethod_check
(self, request: APIRequest, response: BaseAPIResponse[Any])
src/anthropic/lib/_retry.py:91
↓ 2 callersFunction_check_message_threads_supported
(client: Anthropic | AsyncAnthropic)
src/anthropic/lib/threads/_beta_threads.py:564
↓ 2 callersMethod_check_size
(self, content: str)
tests/lib/tools/memory_sync/_fake_anthropic.py:136
↓ 2 callersFunction_check_sync_interval
(interval: float)
src/anthropic/lib/tools/_memories.py:57
↓ 2 callersMethod_compact
(self, compaction: BetaCompactionConfigParam)
src/anthropic/lib/tools/_beta_runner.py:665
↓ 2 callersMethod_compact
(self, compaction: BetaCompactionConfigParam)
src/anthropic/lib/tools/_beta_runner.py:1197
↓ 2 callersFunction_compacted_response_with_an_unmodelled_block
()
tests/lib/tools/test_runners.py:2498
↓ 2 callersFunction_compaction_response
()
tests/lib/tools/test_runners.py:795
↓ 2 callersFunction_compaction_then_forecast_responses
()
tests/lib/tools/test_runners.py:3324
↓ 2 callersFunction_config_file_path
Path to `<config_dir>/configs/<profile>.json` (non-secret, 0644).
src/anthropic/lib/credentials/_constants.py:175
↓ 2 callersFunction_config_with_its_own_host_and_workspace
(tmp_path: pathlib.Path)
tests/lib/test_scoped_client.py:160
↓ 2 callersMethod_create_with_recovery
(self, overrides: TurnOverrides, *, stream: Literal[False])
src/anthropic/lib/threads/_beta_threads.py:329
↓ 2 callersMethod_create_with_recovery
(self, overrides: TurnOverrides, *, stream: Literal[False])
src/anthropic/lib/threads/_beta_threads.py:542
↓ 2 callersFunction_credit_token
The refusal's minted credit token; only the beta surface carries one.
src/anthropic/lib/middleware/_fallbacks.py:1424
↓ 2 callersFunction_credit_token_param
The retry's `fallback_credit_token`, in the object form. `best_effort` keeps the retry serving even when redemption fails — a bare string wou
src/anthropic/lib/middleware/_fallbacks.py:55
↓ 2 callersFunction_declined_iteration_entries
The `usage.iterations` entries a declined hop contributes to the chain. The hop's refusal self-reports its iterations: adopt them, retyped to
src/anthropic/lib/middleware/_fallbacks.py:1232
↓ 2 callersFunction_default_bash_env
The default environment of the bash subprocess, and the environment of `rg`, with the runner's own credentials scrubbed. The bash tool runs m
src/anthropic/lib/tools/agent_toolset.py:158
↓ 2 callersFunction_default_worker_id
()
src/anthropic/lib/environments/_poller.py:85
↓ 2 callersFunction_echo
(name: str, input: object)
tests/lib/tools/toolsets/_stubs.py:26
↓ 2 callersMethod_end_failed_refresh
Release any waiters. Returns the stale token to serve if this was an advisory refresh, or `None` if the caller should re-raise `err`.
src/anthropic/lib/credentials/_cache.py:306
↓ 2 callersMethod_end_refresh
(self, fresh: AccessToken, refresh: Refresh[_EventT])
src/anthropic/lib/credentials/_cache.py:285
↓ 2 callersFunction_error_details
The `error.details` object of the response body, or an empty one when the body has none.
src/anthropic/lib/threads/_thread_state.py:609
↓ 2 callersFunction_eventstream_chunk_frame
Encode `payload` as one `chunk` event in AWS eventstream binary framing.
tests/lib/test_bedrock.py:580
↓ 2 callersFunction_eventstream_frame
(header_values: t.Mapping[str, str], body: bytes)
tests/lib/test_bedrock.py:588
↓ 2 callersFunction_expected_urls
(segments: tuple[str, str, str])
tests/lib/test_google_cloud.py:102
↓ 2 callersFunction_expects_response_wrapper
Whether the given `cast_to` asks for the `APIResponse` wrapper itself.
src/anthropic/_base_client.py:2868
↓ 2 callersMethod_fallback
(self, request: APIRequest)
tests/test_middleware.py:138
↓ 2 callersFunction_file_json
()
tests/lib/test_stainless_helpers.py:54
↓ 2 callersFunction_filenames_in_dir
Every regular file under `base` as `(rel_path, path)`; an absent `base` is empty, a present non-directory is refused.
src/anthropic/lib/tools/_file_store.py:365
↓ 2 callersFunction_forward_input_transformations
Copy `input_transformations` from a fallback's `message_start` that was not re-emitted onto the emitted `message_delta`, matching what a server-si
src/anthropic/lib/middleware/_fallbacks.py:1222
↓ 2 callersMethod_from_state
(cls, client: ClientT, state: ThreadState[RunnableToolT, ResponseFormatT])
src/anthropic/lib/threads/_beta_threads.py:64
↓ 2 callersFunction_from_unix_seconds
(seconds: Union[int, float])
src/anthropic/_utils/_datetime_parse.py:44
↓ 2 callersFunction_fs_reason
Map a filesystem `OSError` to a consistent, runtime-independent phrase. The raw `OSError` string is platform-specific (`[Errno 2] ENOENT: ...`)
src/anthropic/lib/tools/agent_toolset.py:175
↓ 2 callersMethod_get_azure_ad_token
(self)
src/anthropic/lib/foundry.py:254
↓ 2 callersMethod_get_azure_ad_token
(self)
src/anthropic/lib/foundry.py:466
↓ 2 callersFunction_get_numeric
(value: StrBytesIntFloat, native_expected_type: str)
src/anthropic/_utils/_datetime_parse.py:33
↓ 2 callersFunction_get_own_core_schema
(cls: type[pydantic.BaseModel])
src/anthropic/_models.py:603
↓ 2 callersFunction_get_params
(client: BaseClient[Any, Any])
tests/test_client.py:48
↓ 2 callersMethod_get_token
(self)
src/anthropic/lib/google_cloud/_client.py:371
↓ 2 callersMethod_hand_over_messages
Give the thread the history as the loop body left it. `reply` follows it unless `append_messages()` was called, which leaves the history to th
src/anthropic/lib/tools/_beta_runner.py:447
↓ 2 callersMethod_handle_heartbeat
(self, item: Item, client: str, expected: str | None, token: Token | None)
tests/lib/environments/_fake_work_api.py:431
↓ 2 callersMethod_handle_poll
(self, client: str)
tests/lib/environments/_fake_work_api.py:401
↓ 2 callersMethod_handle_request
(self, thread: BetaMessageThread[ResponseFormatT])
src/anthropic/lib/tools/_beta_runner.py:661
↓ 2 callersMethod_handle_request
(self, thread: BetaAsyncMessageThread[ResponseFormatT])
src/anthropic/lib/tools/_beta_runner.py:1193
↓ 2 callersMethod_handle_stop
(self, item: Item, force: bool, token: Token | None)
tests/lib/environments/_fake_work_api.py:463
↓ 2 callersFunction_has_explicit_active_config
True if the user wrote a non-empty `active_config` pointer file. The user has told us which profile is active. If the chain gets as far as th
src/anthropic/lib/credentials/_constants.py:204
↓ 2 callersMethod_has_static_credential
(request: httpx2.Request)
src/anthropic/lib/credentials/_auth.py:76
↓ 2 callersMethod_hash_via_cache
(self, rel: str, full: Path, walk_start_ns: int)
src/anthropic/lib/tools/_file_store.py:266
↓ 2 callersMethod_idempotency_key
(self)
src/anthropic/_base_client.py:1002
↓ 2 callersMethod_idles_on_calls
(self, thread: str)
tests/lib/tools/_fake_sessions_api.py:661
↓ 2 callersFunction_infer_region
Infer the AWS region from the environment variables or from the boto3 session if available.
src/anthropic/lib/bedrock/_client.py:87
↓ 2 callersMethod_info_to_options
(self, info: PageInfo)
src/anthropic/_base_client.py:252
↓ 2 callersFunction_interrupted_sse_body
(id: str, text: str, error: type[httpx2.TransportError] | None)
tests/lib/threads/helpers.py:512
↓ 2 callersMethod_invalidate_rejected
`invalidate()`, unless the cache already replaced `token`, the one a 401 rejected. A late 401 for an older token would otherwise force a refr
src/anthropic/lib/credentials/_cache.py:334
↓ 2 callersFunction_is_async_callable
Whether calling the given object returns a coroutine. Unlike `inspect.iscoroutinefunction(obj)` this also handles class instances that define
src/anthropic/_middleware.py:73
↓ 2 callersMethod_is_rejected_as_earlier
(self, item: Item, token: Token | None)
tests/lib/environments/_fake_work_api.py:471
↓ 2 callersMethod_iter_events
(self)
src/anthropic/_streaming.py:70
↓ 2 callersMethod_keep
(self, text: str)
src/anthropic/lib/tools/agent_toolset.py:811
↓ 2 callersFunction_keeps_base_url
Whether a `copy()` stays on the parent's deployment. Tokens are only valid for the deployment that minted them, so the parent's `TokenCache`
src/anthropic/_client.py:80
↓ 2 callersMethod_kill_group
(self)
src/anthropic/lib/tools/agent_toolset.py:668
↓ 2 callersMethod_logged
(self, id: str)
tests/lib/tools/_fake_sessions_api.py:645
↓ 2 callersFunction_make
(fn: FunctionT)
src/anthropic/lib/tools/_beta_functions.py:427
↓ 2 callersMethod_make_pin
Pin requests sharing the state to the entry being tried (or warn that there is none).
src/anthropic/lib/middleware/_fallbacks.py:386
↓ 2 callersMethod_make_sse_decoder
( self, options: FinalRequestOptions | None = None, # noqa: ARG002 )
src/anthropic/_base_client.py:592
↓ 2 callersMethod_make_status_error_from_response
( self, response: httpx2.Response, )
src/anthropic/_base_client.py:521
↓ 2 callersFunction_make_zip
(path: Path, entries: dict[str, bytes])
tests/lib/tools/test_skills.py:64
↓ 2 callersFunction_marker_sha
(memory_store_id: str)
src/anthropic/lib/tools/_memories.py:77
↓ 2 callersMethod_maybe_override_cast_to
(self, cast_to: type[ResponseT], options: FinalRequestOptions)
src/anthropic/_base_client.py:745
↓ 2 callersFunction_merge_extra_json
Merge `extra_json` into `json_data` in place, as `_build_request` would. This runs before `_prepare_options` so that client hooks, such as Bedroc
src/anthropic/_base_client.py:2762
↓ 2 callersFunction_merge_mappings
Merge two mappings of the same type, removing any values that are instances of `Omit`. In cases with duplicate keys the second mapping takes prec
src/anthropic/_base_client.py:2750
↓ 2 callersFunction_merged_body
The non-streaming retry body: the fallback entry applied as a patch against the original params, plus the refusal's credit token when it minted on
src/anthropic/lib/middleware/_fallbacks.py:1583
↓ 2 callersFunction_middleware_entry_mode
The raw-response mode the original caller entered the middleware chain with.
src/anthropic/_base_client.py:2837
↓ 2 callersFunction_middleware_name
(middleware: object)
src/anthropic/_middleware.py:66
↓ 2 callersFunction_model_with_slow_build
(entered: threading.Event, release: threading.Event, builds: List[str])
tests/test_models.py:1165
↓ 2 callersMethod_move_user_profile_id_to_body
Mantle reads the user profile ID from the body of these requests, and from the header on other routes.
src/anthropic/lib/bedrock/_mantle.py:77
↓ 2 callersMethod_mutate
(self, request: APIRequest)
tests/test_middleware.py:120
↓ 2 callersMethod_next_step
Decide under the lock what the caller does next. A `str` is the token to serve. An event is a refresh in flight to wait on before ask
src/anthropic/lib/credentials/_cache.py:237
↓ 2 callersMethod_open
Open the wire for this hop: its message_start (raw for stream A; suppressed or id-rewritten for a spliced hop), the queued seam frames,
src/anthropic/lib/middleware/_fallbacks.py:991
↓ 2 callersMethod_open_stream
( self, messages: Iterable[BetaMessageParam | BetaMessage], overrides: TurnOverrides )
src/anthropic/lib/threads/_beta_threads.py:318
↓ 2 callersMethod_parse
(self, *, to: type[_T] | None = None)
src/anthropic/_response.py:130
↓ 2 callersMethod_parse_message_from_event
(self, event: EventStreamMessage)
src/anthropic/lib/bedrock/_stream_decoder.py:55
↓ 2 callersMethod_parse_reply
(self, reply: BetaMessage)
src/anthropic/lib/threads/_beta_threads.py:132
↓ 2 callersFunction_passthrough_sse
Forward a decoded event in its original wire bytes, preserving SSE fields beyond `event:`/`data:` (`id:`, `retry:`, comment lines). Falls back to
src/anthropic/lib/middleware/_fallbacks.py:1625
↓ 2 callersFunction_patch
`overrides` applied flat against `base`: a key set to a value overrides it, a key explicitly `None` unsets it, an absent key keeps the base value.
src/anthropic/lib/middleware/_fallbacks.py:1570
↓ 2 callersMethod_prepare_bedrock_options
(self, options: FinalRequestOptions)
src/anthropic/lib/bedrock/_client.py:132
↓ 2 callersMethod_prepare_compaction_after_final_turn
( self, message: ParsedBetaMessage[ResponseFormatT] )
src/anthropic/lib/tools/_beta_runner.py:405
↓ 2 callersFunction_prepare_middleware_options
Build the options the base middleware handler hands to `_attempt_request()`. Returns a copy so that mutations made by the request pipeline never
src/anthropic/_base_client.py:2847
↓ 2 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:1183
↓ 2 callersMethod_prepare_request
(self, request: httpx2.Request)
src/anthropic/lib/bedrock/_mantle.py:253
↓ 2 callersMethod_process_response
( self, *, cast_to: Type[ResponseT], options: FinalRequestOptions, res
src/anthropic/_base_client.py:1518
↓ 2 callersMethod_process_response
( self, *, cast_to: Type[ResponseT], options: FinalRequestOptions, res
src/anthropic/_base_client.py:2310
← previousnext →901–1,000 of 13,873, ranked by callers