MCPcopy Create free account

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

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

↓ 2 callersMethod_write
Write a memory's content to disk; `False` (and a warning) on failure. A `..` component in the wire path reaches here as `FileStoreErr
src/anthropic/lib/tools/_memories.py:731
↓ 2 callersFunction_zip_unix_mode
(info: zipfile.ZipInfo)
src/anthropic/lib/tools/_skills.py:98
↓ 2 callersMethodabsorb_refusal
Fold a refused hop's outcome in, readying the next hop.
src/anthropic/lib/middleware/_fallbacks.py:1178
↓ 2 callersMethodack
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:297
↓ 2 callersMethodaclose
(self)
tests/test_open_telemetry.py:649
↓ 2 callersFunctionaclose_runnable_tool
Run a runnable tool's optional cleanup. Drives the legacy `aclose` / `close` attribute (awaited if it returns an awaitable) and, when the too
src/anthropic/lib/tools/_beta_functions.py:318
↓ 2 callersMethodapi_call_start_attributes
The attributes that the span of every API call starts with, so that a sampler sees them.
src/anthropic/lib/_tracing/_config.py:35
↓ 2 callersFunctionask_for_global_tracer_provider_again
Makes the SDK forget whether OpenTelemetry could load its global tracer provider, which it asks once a process.
tests/test_open_telemetry.py:8214
↓ 2 callersFunctionassert_basic_response
(events: list[ParsedMessageStreamEvent[None]], message: Message)
tests/lib/streaming/test_messages.py:61
↓ 2 callersFunctionassert_basic_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:237
↓ 2 callersFunctionassert_compaction_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:275
↓ 2 callersFunctionassert_context_management_response
(message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:384
↓ 2 callersFunctionassert_fallback_credit_response
(message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:358
↓ 2 callersFunctionassert_fallback_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:305
↓ 2 callersFunctionassert_input_transformations_response
(message: BetaMessage, expected: List[Dict[str, str]])
tests/lib/streaming/test_beta_messages.py:409
↓ 2 callersFunctionassert_message_delta_fields_response
(message: Message)
tests/lib/streaming/test_messages.py:226
↓ 2 callersFunctionassert_message_delta_fields_response
(message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:366
↓ 2 callersFunctionassert_message_delta_omitted_usage_response
(message: Message)
tests/lib/streaming/test_messages.py:244
↓ 2 callersFunctionassert_refusal_response
(message: Message)
tests/lib/streaming/test_messages.py:218
↓ 2 callersFunctionassert_refusal_response
(message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:285
↓ 2 callersFunctionassert_server_tool_use_response
(events: list[ParsedMessageStreamEvent[None]], message: Message)
tests/lib/streaming/test_messages.py:168
↓ 2 callersFunctionassert_server_tool_use_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:338
↓ 2 callersFunctionassert_span_has_no_sampling_attributes
(span: ReadableSpan)
tests/test_open_telemetry.py:885
↓ 2 callersFunctionassert_span_has_nothing_that_message_delta_gives
(span: ReadableSpan)
tests/test_open_telemetry.py:870
↓ 2 callersFunctionassert_span_has_what_message_delta_gave
(span: ReadableSpan, *, beta: bool)
tests/test_open_telemetry.py:854
↓ 2 callersFunctionassert_time_to_first_chunk_is_set_at_the_first_delta
`times` has the type of each event that the application read, and the span's time to first chunk then.
tests/test_open_telemetry.py:709
↓ 2 callersFunctionassert_tool_use_caller_unset
(message: Message)
tests/lib/streaming/test_messages.py:208
↓ 2 callersFunctionassert_tool_use_response
(events: list[ParsedMessageStreamEvent[None]], message: Message)
tests/lib/streaming/test_messages.py:116
↓ 2 callersFunctionassert_tool_use_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:265
↓ 2 callersFunctionassert_unknown_events_response
(events: list[ParsedMessageStreamEvent[None]], message: Message)
tests/lib/streaming/test_messages.py:90
↓ 2 callersFunctionassert_unknown_events_response
(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage)
tests/lib/streaming/test_beta_messages.py:242
↓ 2 callersFunctionasync_collect
Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.
tests/utils.py:290
↓ 2 callersFunctionasync_send_hop
( request: APIRequest, entry: BetaFallbackParam, call_next: AsyncCallNext )
src/anthropic/lib/middleware/_fallbacks.py:1515
↓ 2 callersFunctionattribute_value
`value` as an attribute of `type`, and `None` for a value of another type. So a body that this version of the SDK does not know sets no attribute
src/anthropic/_tracing.py:819
↓ 2 callersFunctionb64encode
(file: Base64FileInput, content: object)
src/anthropic/_utils/_prepare.py:203
↓ 2 callersFunctionbackoff
Exponential backoff for `attempt` (1-indexed), capped at `cap`.
src/anthropic/lib/_retry.py:32
↓ 2 callersMethodbegin
(self)
src/anthropic/_tracing.py:522
↓ 2 callersMethodbegin
The chain state after stream A's chainable refusal. `body` is the original request params (pre-pin) — the base every hop patches; `in
src/anthropic/lib/middleware/_fallbacks.py:1096
↓ 2 callersFunctionbuild_events
( *, event: BetaRawMessageStreamEvent, message_snapshot: ParsedBetaMessage[ResponseFormatT], )
src/anthropic/lib/streaming/_beta_messages.py:383
↓ 2 callersFunctionbuild_events
( *, event: RawMessageStreamEvent, message_snapshot: ParsedMessage[ResponseFormatT], )
src/anthropic/lib/streaming/_messages.py:366
↓ 2 callersMethodcheck_create_only_fields
(self, params: ThreadFields)
src/anthropic/lib/threads/_thread_state.py:507
↓ 2 callersFunctioncheck_files
`allowed` gives the committed path of each file's name in the archive
scripts/utils/check-dist.py:186
↓ 2 callersMethodcheck_next_turn
Raise what the next turn with `overrides` would raise before it is sent.
src/anthropic/lib/threads/_thread_state.py:421
↓ 2 callersFunctioncheck_sync_hook
Raise when `hook` (`confirm`, or a family's own hook) is async and `cls` is a synchronous toolset. The asynchronous classes take either kind.
src/anthropic/lib/tools/_toolsets/_base.py:466
↓ 2 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_response.py:381
↓ 2 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/_streaming.py:143
↓ 2 callersMethodclose
Close the owned `httpx2.Client` if we created one.
src/anthropic/lib/credentials/_providers.py:438
↓ 2 callersMethodclose
Close the underlying `httpx2.Client` if we created it.
src/anthropic/lib/credentials/_workload.py:229
↓ 2 callersFunctionclose_stream
Closes `result` when it is a stream, which ends the span of its call.
tests/test_open_telemetry.py:3726
↓ 2 callersMethodclose_tab
(self, context: BetaToolsetCallContext, input: BetaBrowserCloseTabInput)
tests/lib/tools/toolsets/_fakes.py:150
↓ 2 callersFunctioncoerce_boolean
(val: str)
src/anthropic/_utils/_utils.py:359
↓ 2 callersFunctioncollect
Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.
tests/utils.py:279
↓ 2 callersFunctionconfirm
(context: BetaConfirmContext)
tests/lib/tools/toolsets/test_confirm.py:49
↓ 2 callersFunctionconfirm_outcome
Turn what the `confirm` callable did into the gate's decision: return to proceed, or raise the refusal the model reads. A `ToolError` that `c
src/anthropic/lib/tools/_toolsets/_base.py:532
↓ 2 callersFunctionconstructor_arguments_error
The error for a tool runner constructor call that has neither of the two sets of `arguments`, or both.
src/anthropic/lib/tools/_beta_runner.py:1739
↓ 2 callersMethodcontent_blocks
The accumulated content blocks, in start order.
src/anthropic/lib/middleware/_fallbacks.py:1283
↓ 2 callersMethodcontinuation
(self)
src/anthropic/lib/middleware/_fallbacks.py:1153
↓ 2 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_mantle.py:463
↓ 2 callersFunctioncopy_tree
Returns `[copied data]` and the slots whose file input is still to be read (in a body only).
src/anthropic/_utils/_prepare.py:85
↓ 2 callersMethodcreate_arguments
Settle the `thread` field for this turn and build its `create()` keyword arguments except `stream`: request fields, betas, the delta or full h
src/anthropic/lib/threads/_thread_state.py:386
↓ 2 callersMethodcursor_position
( self, context: BetaToolsetCallContext, input: BetaComputerCursorPositionInput )
tests/lib/tools/toolsets/_computer_fakes.py:60
↓ 2 callersFunctiondecompress
`None` unless `data` is one whole stream
scripts/utils/check-dist.py:115
↓ 2 callersFunctiondefined_query
The pairs of `query`, as sent, whose parameter is one of `names`, which an endpoint defines. A name is one of them when, percent-decoded, it is i
src/anthropic/_tracing.py:724
↓ 2 callersMethoddelete
Delete File Args: file_id: ID of the File. workspace_id: Optional header to select the Workspace for this reque
src/anthropic/resources/files.py:134
↓ 2 callersFunctionedit
Replace text in a file by exact string match.
src/anthropic/lib/tools/agent_toolset.py:764
↓ 2 callersFunctionempty_message
()
tests/lib/tools/test_runner_eager_tools.py:896
↓ 2 callersFunctionend_api_call_span
Ends the call span with the call's `result`. A span that already ended is left alone.
src/anthropic/_tracing.py:424
↓ 2 callersFunctionend_tool_runner_span
Ends a tool runner's span, if it has one. Never raises.
src/anthropic/lib/_tracing/_tools.py:80
↓ 2 callersFunctionends_turn
Whether `ev` is a `session.status_idle` whose turn is over. Only `requires_action` leaves the turn open: the session resumes once a client re
src/anthropic/lib/tools/_beta_session_runner.py:1153
↓ 2 callersFunctionerror_content
(error: ToolError)
src/anthropic/lib/tools/_toolsets/_base.py:546
↓ 2 callersFunctionerror_text_content
The text blocks of a `ToolError`'s content. Deliberate: the API accepts only text on an `is_error` result and answers anything else with a 400 tha
src/anthropic/lib/tools/_toolsets/_sanitize.py:81
↓ 2 callersFunctionevent_by_event
(canned: Reply, *, fails_before: str | None = None)
tests/lib/tools/test_runner_eager_tools.py:995
↓ 2 callersFunctionevents_before_message_delta
The events of a stream that ends before `message_delta`, whose `message_start` has every placeholder.
tests/test_open_telemetry.py:847
↓ 2 callersFunctionevents_with_first_delta
The events of `stream_events` with `delta`, twice, as the deltas of `content_block`, and a `ping` before them.
tests/test_open_telemetry.py:691
↓ 2 callersFunctionevents_without_a_delta
The events of `stream_events`, with the text block whole in its `content_block_start`.
tests/test_open_telemetry.py:719
↓ 2 callersFunctionextract_error_code
(body: object)
src/anthropic/_exceptions.py:262
↓ 2 callersFunctionextract_property
Follows `path` through nested mappings. Returns `None` once a value is not a mapping or lacks the next key.
src/anthropic/_utils/_utils.py:426
↓ 2 callersFunctionfallback
The block a refusal starts when it hands the reply to a fallback model.
tests/lib/tools/test_runner_eager_tools.py:825
↓ 2 callersFunctionfallback_reply
The reply of `fallback_response()`.
tests/lib/threads/helpers.py:350
↓ 2 callersFunctionfallback_response
A reply that `FALLBACK_MODEL` wrote after `MODEL` declined, with the block that marks the hand-over.
tests/lib/threads/helpers.py:366
↓ 2 callersFunctionfallback_stream_events
The events of `stream_events`, after a `fallback` block: another model serves the rest of the response.
tests/test_open_telemetry.py:803
↓ 2 callersMethodfeed
Process one event, returning the frames to forward for it.
src/anthropic/lib/middleware/_fallbacks.py:859
↓ 2 callersFunctionfield_get_default
(field: FieldInfo)
src/anthropic/_compat.py:88
↓ 2 callersFunctionfile_name
(file: FileContent)
src/anthropic/_files.py:80
↓ 2 callersFunctionfinish
Await `result` if it is the coroutine of an async thread's `send()` or `parse()`, which runs nothing until then.
tests/lib/threads/test_beta_threads.py:2267
↓ 2 callersMethodfinish
The session's last sync — once, at a clean end. Same reconciliation as the cadence syncs, but server deletes skip the waiting window
src/anthropic/lib/tools/_memories.py:342
↓ 2 callersMethodfinish
The outcome once the hop's stream is fully consumed (or cut early).
src/anthropic/lib/middleware/_fallbacks.py:1020
↓ 2 callersMethodfinish_frames
Frames still owed when the stream ends without a chainable refusal.
src/anthropic/lib/middleware/_fallbacks.py:1014
↓ 2 callersFunctionflatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callersFunctionget_architecture
()
src/anthropic/_base_client.py:2708
↓ 2 callersFunctionget_environment_proxies
Gets the proxy mappings based on environment variables. We use our own logic to parse these variables, as HTTPX doesn’t allow full config
src/anthropic/_utils/_httpx.py:32
↓ 2 callersMethodget_next_page
(self: SyncPageT)
src/anthropic/_base_client.py:321
↓ 2 callersMethodget_page_text
(self, context: BetaToolsetCallContext, input: BetaBrowserGetPageTextInput)
tests/lib/tools/toolsets/_fakes.py:116
↓ 2 callersFunctionget_platform
()
src/anthropic/_base_client.py:2629
↓ 2 callersFunctionget_tool_use_response_without_caller
()
tests/lib/streaming/test_messages.py:204
↓ 2 callersMethodhandler
(_request: httpx2.Request)
tests/test_open_telemetry.py:2580
↓ 2 callersFunctionhas_explicit_credential
Whether one of a client's credential arguments was passed. Raises `ValueError` for more than one.
src/anthropic/_client.py:89
↓ 2 callersMethodhas_next_page
(self)
src/anthropic/_base_client.py:237
↓ 2 callersMethodheld
(self)
src/anthropic/lib/tools/_beta_runner.py:1704
↓ 2 callersFunctionhelper_tags
(index: int)
tests/lib/tools/toolsets/test_runner.py:819
← previousnext →1,001–1,100 of 12,274, ranked by callers