MCPcopy Create free account

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

Functions9,455 in github.com/anthropics/anthropic-sdk-python

↓ 3 callersFunctionwrite_text_exact
Write a UTF-8 file without newline translation.
src/anthropic/lib/tools/_files.py:18
↓ 2 callersMethod__aenter__
(self)
src/anthropic/lib/tools/_file_store.py:129
↓ 2 callersMethod__aenter__
(self)
tests/lib/tools/test_session_runner.py:155
↓ 2 callersMethod__enter__
(self)
src/anthropic/_streaming.py:161
↓ 2 callersMethod__exit__
( self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
src/anthropic/lib/tools/_toolsets/_runnable.py:129
↓ 2 callersMethod__init__
( self, *, raw: httpx2.Response, cast_to: type[R], client: BaseClient[
src/anthropic/_response.py:63
↓ 2 callersMethod__init__
( self, *, resource: str | None = None, api_key: str | None = None, az
src/anthropic/lib/foundry.py:94
↓ 2 callersMethod__init__
(self, *, sync: bool, runner: Any, timeline: list[str], requests: list[Any], desktop: Desktop)
tests/lib/tools/test_runner_eager_tools.py:1072
↓ 2 callersMethod__init__
(self)
tests/lib/tools/toolsets/_fakes.py:47
↓ 2 callersMethod__init__
(self)
tests/lib/tools/toolsets/_computer_fakes.py:36
↓ 2 callersMethod__stream__
(self)
src/anthropic/_streaming.py:64
↓ 2 callersFunction_active_profile
Resolve the active profile name. `ANTHROPIC_PROFILE` env var → `<config_dir>/active_config` pointer file → `"default"` literal. The resolved
src/anthropic/lib/credentials/_constants.py:98
↓ 2 callersMethod_applicable_body
The request's JSON body when this middleware applies to it, `None` otherwise.
src/anthropic/lib/middleware/_fallbacks.py:330
↓ 2 callersMethod_apply
(self, request: httpx2.Request, token: str)
src/anthropic/lib/credentials/_auth.py:87
↓ 2 callersFunction_archive_top_dir
Return the single top-level directory shared by every archive entry, or `""` if the entries don't all live under one common directory. Skill
src/anthropic/lib/tools/_skills.py:64
↓ 2 callersFunction_assert_only_files_and_dirs
(root: Path)
tests/lib/tools/test_skills.py:107
↓ 2 callersFunction_assert_reply_params_are_left_off_the_compaction_request_only
( respx_mock: MockRouter, tool_choice: BetaToolChoiceParam, fallbacks: Union[List[BetaFallbackPara
tests/lib/tools/test_runners.py:3293
↓ 2 callersFunction_assert_tool_runner_calls
(calls: List[MockRequestCall])
tests/lib/test_vertex.py:54
↓ 2 callersFunction_assert_tool_runner_calls
(calls: t.List[MockRequestCall])
tests/lib/test_bedrock.py:537
↓ 2 callersFunction_async_atomic_write_file
(target_path: AsyncPath, content: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:619
↓ 2 callersFunction_async_refusal
The same as `_refusal`, for a call on the async class.
tests/lib/tools/toolsets/test_refusals.py:37
↓ 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:458
↓ 2 callersFunction_atomic_write_file
(target_path: Path, content: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:282
↓ 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:1287
↓ 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:2018
↓ 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:66
↓ 2 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:348
↓ 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:55
↓ 2 callersFunction_collect_error
(match: Match[str])
scripts/utils/ruffen-docs.py:42
↓ 2 callersMethod_compact
(self, compaction: BetaCompactionConfigParam)
src/anthropic/lib/tools/_beta_runner.py:463
↓ 2 callersMethod_compact
(self, compaction: BetaCompactionConfigParam)
src/anthropic/lib/tools/_beta_runner.py:834
↓ 2 callersFunction_compacted_response_with_an_unmodelled_block
()
tests/lib/tools/test_runners.py:2489
↓ 2 callersFunction_compaction_response
()
tests/lib/tools/test_runners.py:823
↓ 2 callersFunction_compaction_then_forecast_responses
()
tests/lib/tools/test_runners.py:3288
↓ 2 callersFunction_config_file_path
Path to `<config_dir>/configs/<profile>.json` (non-secret, 0644).
src/anthropic/lib/credentials/_constants.py:179
↓ 2 callersFunction_credit_token
The refusal's minted credit token; only the beta surface carries one.
src/anthropic/lib/middleware/_fallbacks.py:1410
↓ 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:53
↓ 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:1218
↓ 2 callersFunction_default_worker_id
()
src/anthropic/lib/environments/_poller.py:76
↓ 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_eventstream_chunk_frame
Encode `payload` as one `chunk` event in AWS eventstream binary framing.
tests/lib/test_bedrock.py:351
↓ 2 callersFunction_eventstream_frame
(header_values: t.Mapping[str, str], body: bytes)
tests/lib/test_bedrock.py:359
↓ 2 callersFunction_expects_response_wrapper
Whether the given `cast_to` asks for the `APIResponse` wrapper itself.
src/anthropic/_base_client.py:2633
↓ 2 callersMethod_fallback
(self, request: APIRequest)
tests/test_middleware.py:137
↓ 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:1208
↓ 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:161
↓ 2 callersMethod_get_azure_ad_token
(self)
src/anthropic/lib/foundry.py:259
↓ 2 callersMethod_get_azure_ad_token
(self)
src/anthropic/lib/foundry.py:477
↓ 2 callersMethod_get_last_assistant_message
(self)
src/anthropic/lib/tools/_beta_runner.py:651
↓ 2 callersMethod_get_last_assistant_message
(self)
src/anthropic/lib/tools/_beta_runner.py:935
↓ 2 callersFunction_get_numeric
(value: StrBytesIntFloat, native_expected_type: str)
src/anthropic/_utils/_datetime_parse.py:33
↓ 2 callersFunction_get_params
(client: BaseClient[Any, Any])
tests/test_client.py:47
↓ 2 callersMethod_get_token
(self)
src/anthropic/lib/google_cloud/_client.py:316
↓ 2 callersMethod_handle_item
The per-item body shared by `run`'s poll loop and `handle_item`. Runs a `SessionToolRunner` for the work item's session while heartbe
src/anthropic/lib/environments/_worker.py:622
↓ 2 callersMethod_handle_request
(self, params: ParseMessageCreateParamsBase[ResponseFormatT])
src/anthropic/lib/tools/_beta_runner.py:459
↓ 2 callersMethod_handle_request
( self, params: ParseMessageCreateParamsBase[ResponseFormatT] )
src/anthropic/lib/tools/_beta_runner.py:828
↓ 2 callersFunction_has_explicit_active_config
True if the user wrote a non-empty `active_config` pointer file. This is an explicit opt-in signal equivalent to setting `ANTHROPIC_PROFILE`:
src/anthropic/lib/credentials/_constants.py:208
↓ 2 callersMethod_has_static_credential
(request: httpx2.Request)
src/anthropic/lib/credentials/_auth.py:84
↓ 2 callersMethod_hash_via_cache
(self, rel: str, full: Path, walk_start_ns: int)
src/anthropic/lib/tools/_file_store.py:266
↓ 2 callersFunction_heartbeat_loop
Keep the work-item lease alive while a session is being served. `work` must be bound to a sub-client authenticated for the environment; this
src/anthropic/lib/environments/_worker.py:170
↓ 2 callersMethod_idempotency_key
(self)
src/anthropic/_base_client.py:923
↓ 2 callersFunction_idle_script
Three empty polls, a fourth 301s later, a fifth, one claim, then one more empty poll before the script runs out.
tests/lib/environments/test_poller_method.py:343
↓ 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:69
↓ 2 callersMethod_info_to_options
(self, info: PageInfo)
src/anthropic/_base_client.py:236
↓ 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_iter_events
(self)
src/anthropic/_streaming.py:52
↓ 2 callersFunction_keep_client_header_params
Per-request header params arrive as `Omit` when unset, which would strip a value the client itself sends (e.g. `AnthropicAWS(workspace_id=...)`, a
src/anthropic/_client.py:129
↓ 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:77
↓ 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:372
↓ 2 callersMethod_make_sse_decoder
(self)
src/anthropic/_base_client.py:521
↓ 2 callersMethod_make_status_error_from_response
( self, response: httpx2.Response, )
src/anthropic/_base_client.py:451
↓ 2 callersFunction_make_zip
(path: Path, entries: dict[str, bytes])
tests/lib/tools/test_skills.py:37
↓ 2 callersFunction_marker_sha
(memory_store_id: str)
src/anthropic/lib/tools/_memories.py:75
↓ 2 callersMethod_maybe_override_cast_to
(self, cast_to: type[ResponseT], options: FinalRequestOptions)
src/anthropic/_base_client.py:666
↓ 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:2527
↓ 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:2515
↓ 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:1526
↓ 2 callersFunction_middleware_entry_mode
The raw-response mode the original caller entered the middleware chain with.
src/anthropic/_base_client.py:2602
↓ 2 callersFunction_middleware_name
(middleware: object)
src/anthropic/_middleware.py:66
↓ 2 callersMethod_mutate
(self, request: APIRequest)
tests/test_middleware.py:119
↓ 2 callersFunction_next_poll_result
(script: list[Any])
tests/lib/environments/test_poller_method.py:95
↓ 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:977
↓ 2 callersFunction_open_regular_file
(rel_path: str, dest: Path)
src/anthropic/lib/tools/_file_store.py:333
↓ 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 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:1568
↓ 2 callersFunction_poller_records
(caplog: pytest.LogCaptureFixture, level: int)
tests/lib/environments/test_poller_method.py:361
↓ 2 callersMethod_pop_compaction_request_params
( self, compaction: BetaCompactionConfigParam )
src/anthropic/lib/tools/_beta_runner.py:268
↓ 2 callersMethod_prepare_compaction_after_final_turn
( self, message: ParsedBetaMessage[ResponseFormatT] )
src/anthropic/lib/tools/_beta_runner.py:277
↓ 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:2612
↓ 2 callersFunction_prepare_options
(input_options: FinalRequestOptions)
src/anthropic/lib/bedrock/_client.py:37
↓ 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:1098
← previousnext →601–700 of 9,455, ranked by callers