MCPcopy Create free account

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

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

↓ 2 callersMethod_make_sse_decoder
(self)
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:61
↓ 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:737
↓ 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:2746
↓ 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:2734
↓ 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:2821
↓ 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:1146
↓ 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 callersFunction_next_poll_result
(script: list[Any])
tests/lib/environments/test_poller_method.py:111
↓ 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_note_primary_thread
Remembers the thread of the log's first `session.thread_status_*` event as the session's primary thread. Only the primary thread exists when
src/anthropic/lib/tools/_beta_session_runner.py:768
↓ 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 callersFunction_polled_work_ids
The IDs of the items that a draining poller of a client with `open_telemetry` gives.
tests/lib/environments/test_poller_method.py:767
↓ 2 callersFunction_poller_records
(caplog: pytest.LogCaptureFixture, level: int)
tests/lib/environments/test_poller_method.py:377
↓ 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:2831
↓ 2 callersFunction_prepare_options
(input_options: FinalRequestOptions)
src/anthropic/lib/bedrock/_client.py:38
↓ 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:1171
↓ 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:1506
↓ 2 callersMethod_process_response
( self, *, cast_to: Type[ResponseT], options: FinalRequestOptions, res
src/anthropic/_base_client.py:2294
↓ 2 callersFunction_project_from_credentials
Best-effort project from an explicit credentials object — service-account / impersonated credentials usually know theirs.
src/anthropic/lib/google_cloud/_client.py:230
↓ 2 callersFunction_raise_token_endpoint_error
Raise a redacted `WorkloadIdentityError` from a non-200 token-endpoint response. Shared between the jwt-bearer exchange path in this module and t
src/anthropic/lib/credentials/_workload.py:73
↓ 2 callersFunction_read_active_config_pointer
Return the stripped contents of `<config_dir>/active_config`, or `None` if the pointer file is missing or empty.
src/anthropic/lib/credentials/_constants.py:84
↓ 2 callersMethod_read_credentials
Read the credentials file. Re-reads on every call — daemons rotate it. Secret values in the returned dict (every string field not in
src/anthropic/lib/credentials/_providers.py:366
↓ 2 callersMethod_read_tools
Take the runnable tools and the request definitions from the tools. A list is kept as given and read again for each turn, like any other field
src/anthropic/lib/threads/_thread_state.py:150
↓ 2 callersFunction_refusal_category
The policy category that caused the refusal; only the beta surface carries one.
src/anthropic/lib/middleware/_fallbacks.py:1431
↓ 2 callersFunction_refusal_with_tool_use
()
tests/lib/tools/test_runners.py:556
↓ 2 callersMethod_register_compaction_response
( self, thread: ThreadT, message: ParsedBetaMessage[ResponseFormatT], compacted_count: int )
src/anthropic/lib/tools/_beta_runner.py:427
↓ 2 callersFunction_reject_compaction_param
(params: ParseMessageCreateParamsBase[Any])
src/anthropic/lib/tools/_beta_runner.py:134
↓ 2 callersFunction_reject_skip_auth_conflict
( *, skip_auth: bool, token_provider: object | None, credentials: object | None, )
src/anthropic/lib/google_cloud/_client.py:217
↓ 2 callersMethod_release_hold
Drops the idle-clock hold of `ev`. While `_idle_may_be_stale` is True, a call of a terminated thread drops the deferred countdown with its ho
src/anthropic/lib/tools/_beta_session_runner.py:794
↓ 2 callersMethod_release_terminated_holds
Drops the held calls of terminated threads and their idle-clock holds: the API takes no result for them.
src/anthropic/lib/tools/_beta_session_runner.py:787
↓ 2 callersMethod_repeats_last_reply
Whether `message` is the reply last recorded, as returned, or a copy of it appended right after it.
src/anthropic/lib/threads/_thread_state.py:118
↓ 2 callersFunction_request
(*, extra: str = "vertex")
src/anthropic/lib/_extras/_google_auth.py:38
↓ 2 callersFunction_require_env
(name: str)
examples/managed-agents-observe-tool-calls.py:45
↓ 2 callersMethod_require_utf8
(self, rel_path: str, data: bytes)
src/anthropic/lib/tools/_file_store.py:258
↓ 2 callersFunction_resolve_base_url
base_url (arg or `ANTHROPIC_GOOGLE_CLOUD_BASE_URL`, resolved by the caller) > derived template. Returns `None` when derivation must wait for
src/anthropic/lib/google_cloud/_client.py:187
↓ 2 callersMethod_resolve_deferred_base_url
Derive and set the real base URL once the project is known. Called on every request (after the project back-fill from ADC, if any); a
src/anthropic/lib/google_cloud/_client.py:155
↓ 2 callersMethod_resolve_denied
Resolve a denied call without executing it. The denial itself resolves the call server-side — no result event will ever be posted for
src/anthropic/lib/tools/_beta_session_runner.py:886
↓ 2 callersFunction_resolve_mantle_config
Resolve and validate all Mantle client configuration. Returns (resolved_api_key, resolved_base_url, use_sigv4, merged_headers).
src/anthropic/lib/bedrock/_mantle.py:93
↓ 2 callersFunction_resolve_under
Assert `candidate` resolves to a descendant of `base`, return it verbatim. The containment check uses `resolve(strict=False)` on both sides so
src/anthropic/lib/credentials/_constants.py:157
↓ 2 callersFunction_resource_contents_to_block
Convert MCP resource contents to an Anthropic content block.
src/anthropic/lib/tools/mcp.py:163
↓ 2 callersFunction_result_content
The content blocks the runner computed and posted back, as carried in `result` (the flat `content` convenience field was removed).
tests/lib/tools/test_session_runner.py:131
↓ 2 callersMethod_route_tool_event
Enqueue `ev` for dispatch, honoring its evaluated permission. A call of a terminated thread is not enqueued. A builtin call the serv
src/anthropic/lib/tools/_beta_session_runner.py:803
↓ 2 callersMethod_run
Drive the session tool loop, yielding an iterator of `DispatchedToolCall`. `__aiter__` (and the module-level `_run_session_tools` shim
src/anthropic/lib/tools/_beta_session_runner.py:523
↓ 2 callersFunction_runner_fields
(tool: object, fields: dict[str, Any])
tests/lib/threads/helpers.py:122
↓ 2 callersFunction_safe_member_name
Return `name` as a confined relative path, or raise on path-traversal. Strips `.` components; rejects absolute paths and any `..` component o
src/anthropic/lib/tools/_skills.py:46
↓ 2 callersFunction_seamed_http_response
A copy of the served hop's response with `seams` prepended to its `content`, or `None` when the body isn't the expected message shape. The ca
src/anthropic/lib/middleware/_fallbacks.py:1448
↓ 2 callersMethod_send
(self, messages: Iterable[BetaMessageParam | BetaMessage], overrides: TurnOverrides)
src/anthropic/lib/threads/_beta_threads.py:309
↓ 2 callersMethod_send
(self, messages: Iterable[BetaMessageParam | BetaMessage], overrides: TurnOverrides)
src/anthropic/lib/threads/_beta_threads.py:522
↓ 2 callersMethod_send
(self)
tests/lib/tools/test_runner_eager_tools.py:975
↓ 2 callersMethod_send_pending_tool_changes
(self, hold: bool)
src/anthropic/lib/tools/_beta_runner.py:545
↓ 2 callersFunction_serialize_sse
Serialize an event back to its SSE wire form (`event: ...\\ndata: ...\\n\\n`). Multi-line `data` is emitted as one `data:` line per line, matchin
src/anthropic/lib/middleware/_fallbacks.py:1635
↓ 2 callersFunction_serving
A toolset class that serves `members` and nothing else, on the synchronous class or (`twin`) the async one.
tests/lib/tools/toolsets/test_computer_interface.py:241
↓ 2 callersFunction_sessions_token_from_secret
Extract the per-item sessions token from a work item's `secret` payload. The `secret` the poll response populates is not itself a credential: it
src/anthropic/lib/environments/_worker.py:275
↓ 2 callersMethod_set_private_attributes
( self, client: SyncAPIClient, model: Type[_T], options: FinalRequestOptions,
src/anthropic/_base_client.py:286
↓ 2 callersMethod_settle_sent
Resolve the uploads whose response never arrived, against a fresh listing. A memory holding exactly the sha that was sent is that upload, sav
src/anthropic/lib/tools/_memories.py:584
↓ 2 callersMethod_should_retry_exception
Whether an exception raised by a request attempt should be retried. Also returns the HTTP response behind the failure, when there is one, so
src/anthropic/_base_client.py:969
↓ 2 callersMethod_should_stop
(self)
src/anthropic/lib/tools/_beta_runner.py:553
↓ 2 callersMethod_should_stream_response_body
(self, request: httpx2.Request)
src/anthropic/_base_client.py:754
↓ 2 callersMethod_shrink
(self, request: APIRequest)
tests/test_middleware.py:162
↓ 2 callersFunction_spliced_http_response
A synthetic response standing in for `original`, with `stream` as its body. The spliced frames are emitted post-decode, so the original's con
src/anthropic/lib/middleware/_fallbacks.py:1674
↓ 2 callersFunction_split_lines_keeping_cr
Split on LF only (keeping any CR), without the empty tail a trailing newline leaves.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:368
↓ 2 callersMethod_stamp_and_pull
Write the trust marker, then pull every remote memory; pushes nothing. The baseline is cleared and rebuilt from successful writes only, so a
src/anthropic/lib/tools/_memories.py:598
↓ 2 callersMethod_start_index
The chain entry this request starts at (-1 = the original params). Only an explicit `BetaFallbackState` pin moves the start; without one
src/anthropic/lib/middleware/_fallbacks.py:370
↓ 2 callersMethod_start_tool_runner_span
Starts the `anthropic.messages.tool_runner` span of one run, or returns `None` when tracing is off.
src/anthropic/lib/tools/_beta_runner.py:259
↓ 2 callersMethod_store_turn
Move what was staged into the stored history, followed by `reply` if there is one.
src/anthropic/lib/threads/_thread_state.py:379
↓ 2 callersFunction_streamed_responses
()
tests/lib/tools/test_runners.py:3495
↓ 2 callersFunction_strip_seam_blocks
A copy of `body` with `{type: "fallback"}` seam blocks filtered out of the replayed message history; `body` itself when there are none. An as
src/anthropic/lib/middleware/_fallbacks.py:1379
↓ 2 callersFunction_strip_top
Drop the leading `top` component from `safe` (an already-confined relative path). Returns `""` for the bare top-dir entry itself.
src/anthropic/lib/tools/_skills.py:114
↓ 2 callersMethod_surface_call
Yield `call` to the consumer, tolerating a consumer that left early. `BrokenResourceError` — the consumer broke out of the iterator;
src/anthropic/lib/tools/_beta_session_runner.py:908
↓ 2 callersMethod_take_compaction_thread
A fork of the thread that sends the compaction request: the whole history and the thread's fields plus `compaction`, minus what `_without_comp
src/anthropic/lib/tools/_beta_runner.py:391
↓ 2 callersFunction_to_iteration_usage
( type: Literal["message", "fallback_message"], model: str, usage: dict[str, Any] | None )
src/anthropic/lib/middleware/_fallbacks.py:1649
↓ 2 callersFunction_to_message_param
(message: BetaMessageParam | BetaMessage)
src/anthropic/lib/threads/_thread_state.py:686
↓ 2 callersFunction_to_prefill_blocks
Convert a hop's accumulated response blocks to the appended assistant turn. A `fallback_has_prefill_claim` refusal guarantees the partial output
src/anthropic/lib/middleware/_fallbacks.py:1349
↓ 2 callersFunction_tool_runner_responses
()
tests/lib/test_vertex.py:127
↓ 2 callersFunction_tool_runner_responses
()
tests/lib/test_bedrock.py:755
↓ 2 callersMethod_toolset_check_tool_use
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_toolsets/_runnable.py:100
↓ 2 callersMethod_toolset_for
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:577
↓ 2 callersMethod_toolset_not_found_result
(tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:593
↓ 2 callersMethod_turn_params
The thread's request fields with this turn's overrides, and the output format as `output_config`.
src/anthropic/lib/threads/_thread_state.py:444
↓ 2 callersMethod_upload
Push one local file; `None` keeps the old baseline so the next pass retries. A refusal the server would repeat (400/413, the utf-8 gate) ente
src/anthropic/lib/tools/_memories.py:799
↓ 2 callersFunction_user_agent
`User-Agent` value sent on token-endpoint POSTs. Computed lazily so this module doesn't need to import `_version` at module load time (the cr
src/anthropic/lib/credentials/_constants.py:52
↓ 2 callersFunction_validate_no_symlink_escape
(target_path: Path, memory_root: Path)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:339
↓ 2 callersFunction_warn_once
Emit a log warning at most once per `key` per process.
src/anthropic/lib/credentials/_auth.py:21
↓ 2 callersFunction_weather_then_browser_replies
(stream: bool)
tests/lib/tools/test_runners.py:3579
↓ 2 callersFunction_with_middleware_headers
A copy of `request` with `betas` appended to its `anthropic-beta` header (skipping values already present) and the middleware's helper-telemetry t
src/anthropic/lib/middleware/_fallbacks.py:1410
↓ 2 callersFunction_with_tools
(*tools: Any)
tests/lib/tools/toolsets/test_browser_runner.py:576
← previousnext →901–1,000 of 12,274, ranked by callers