MCPcopy Create free account

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

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

↓ 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:216
↓ 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_client
(api: FakeApi, name: str, options: Mapping[str, Any] | None)
tests/lib/environments/_schedules.py:227
↓ 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 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 callersFunctionbody
(_item: object)
tests/lib/environments/test_poller.py:331
↓ 2 callersFunctionbuild
Construct a BaseModel class without validation. This is useful for cases where you need to instantiate a `BaseModel` from an API response as
src/anthropic/_models.py:630
↓ 2 callersMethodbuild
( cls: type[_T], *, response: Response, data: object, )
src/anthropic/_types.py:299
↓ 2 callersFunctionbuild_events
( *, event: BetaRawMessageStreamEvent, message_snapshot: ParsedBetaMessage[ResponseFormatT], )
src/anthropic/lib/streaming/_beta_messages.py:384
↓ 2 callersFunctionbuild_events
( *, event: RawMessageStreamEvent, message_snapshot: ParsedMessage[ResponseFormatT], )
src/anthropic/lib/streaming/_messages.py:368
↓ 2 callersMethodcancel_tools_if
(self, condition: Callable[[str], bool])
src/anthropic/lib/tools/_beta_session_runner.py:903
↓ 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 callersFunctioncheck_max_concurrent_calls
(value: int | None)
src/anthropic/lib/tools/_beta_session_runner.py:1045
↓ 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:440
↓ 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 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_client.py:271
↓ 2 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_client.py:453
↓ 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 callersFunctiondefault_tools
(session: FakeSession, observer: Observer)
tests/lib/tools/_fake_sessions_api.py:823
↓ 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 callersFunctionempty_message
()
tests/lib/tools/test_runner_eager_tools.py:896
↓ 2 callersFunctionencoded
(payload: object)
tests/lib/environments/_fake_work_api.py:527
↓ 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 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 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 callersFunctionfixed_jitter
(jitter: float)
tests/lib/environments/_schedules.py:271
↓ 2 callersFunctionflatten
(t: Iterable[Iterable[_T]])
src/anthropic/_utils/_utils.py:33
↓ 2 callersFunctionget_architecture
()
src/anthropic/_base_client.py:2724
↓ 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:2645
↓ 2 callersFunctionget_tool_use_response_without_caller
()
tests/lib/streaming/test_messages.py:212
↓ 2 callersMethodhandle
(self)
src/anthropic/lib/environments/_worker.py:497
↓ 2 callersMethodhandle
(self, request: APIRequest, call_next: Any)
tests/lib/environments/_schedules.py:240
↓ 2 callersMethodhandle_item
Service a single, already-claimed work item without the poll loop. Claims the item with a first heartbeat, builds the per-session `Ag
src/anthropic/lib/environments/_worker.py:369
↓ 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 callersMethodheartbeat
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:362
↓ 2 callersMethodheld
(self)
src/anthropic/lib/tools/_beta_runner.py:1704
↓ 2 callersFunctionhelper_tags
(index: int)
tests/lib/tools/toolsets/test_runner.py:819
↓ 2 callersFunctionhistory_with_nested_blocks
A history with `marker` in every block, nested ones included. Its free-form data has `cache_control` keys of its own, and so do the `tool_changes`
tests/lib/threads/helpers.py:211
↓ 2 callersMethodhold
(self, tool_use: BetaToolUseBlock | str)
src/anthropic/lib/tools/_beta_runner.py:1696
↓ 2 callersMethodhop_body
The hop's request body: the entry applied as a patch against the ORIGINAL request params (never a previous hop's patched body), extended
src/anthropic/lib/middleware/_fallbacks.py:1156
↓ 2 callersFunctionin_a_cycle
Drops `held` in a way that leaves it to the garbage collector to free it.
tests/utils.py:273
↓ 2 callersFunctioninject_trace_headers
Writes the trace context of `span` into `headers`, in place of any already there.
src/anthropic/_tracing.py:411
↓ 2 callersFunctioninstrument
Runs `method` of the runner's class in a span named after it, as instrumentation that the SDK knows nothing about would: a patched library, or a c
tests/lib/tools/test_open_telemetry.py:218
↓ 2 callersFunctionis_async_callable
Whether calling `obj` returns a coroutine: an `async def` function, an object whose `__call__` is one, or a `functools.partial` of either.
src/anthropic/lib/tools/_toolsets/_base.py:445
↓ 2 callersFunctionis_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callersFunctionis_content_query
Whether `query`, as `defined_query` gives it, has one of the `CONTENT_QUERY_PARAMS` or of `content_names`. `content_names` has the parameters tha
src/anthropic/_tracing.py:742
← previousnext →1,101–1,200 of 13,873, ranked by callers