MCPcopy Create free account

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

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

↓ 7 callersMethodaclose
(self)
src/anthropic/lib/credentials/_close.py:19
↓ 7 callersFunctionapplication_trace_context
Runs with a sampled span and a baggage entry current, as an instrumented application calls the SDK.
tests/test_open_telemetry.py:4122
↓ 7 callersFunctionb64_obj
(data: object)
tests/test_prepare.py:121
↓ 7 callersFunctionbeta_agent_toolset_20260401
Return the `agent_toolset_20260401` implementations bound to `ctx`. The result is a plain list of `anthropic.lib.tools.BetaAsyncFunctionTool`
src/anthropic/lib/tools/agent_toolset.py:988
↓ 7 callersFunctionbeta_glob_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:826
↓ 7 callersFunctionbeta_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:117
↓ 7 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding. A credential passed her
src/anthropic/_client.py:855
↓ 7 callersMethoddispose
Remove the root iff `open` created it; pre-existing roots are kept.
src/anthropic/lib/tools/_file_store.py:122
↓ 7 callersMethodexec
(self, cmd: str, timeout: float = BASH_DEFAULT_TIMEOUT)
src/anthropic/lib/tools/agent_toolset.py:507
↓ 7 callersMethodexecute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_interface.py:139
↓ 7 callersMethodextra_headers
Return headers derived from the config file (e.g. `workspace_id`). Eagerly reads the config if not yet loaded. The returned dict is s
src/anthropic/lib/credentials/_providers.py:287
↓ 7 callersFunctionextract_type_var_from_base
Given a type like `Foo[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g. ```py
src/anthropic/_utils/_typing.py:91
↓ 7 callersFunctionfield_types
(cls: Any)
tests/test_open_telemetry.py:8245
↓ 7 callersFunctionhttp_client
( client_class: ClientClass, transport: httpx2.MockTransport | None = None )
tests/lib/test_client_copy.py:186
↓ 7 callersFunctionmarker_stamp
(local: Path)
tests/lib/tools/memory_sync/test_folder_trust.py:28
↓ 7 callersFunctionquoted_name
A model-chosen name as it is echoed inside single quotes in a text the model reads: one line, cut short, and without the quotes and runs of spaces
src/anthropic/lib/tools/_toolsets/_sanitize.py:69
↓ 7 callersMethodread
Read and return the binary response content.
src/anthropic/_response.py:361
↓ 7 callersFunctionresolve_open_telemetry
`option` with `propagation` and every field of its `traces`. The environment variables are for a client that is given no option, `None`: `env_ope
src/anthropic/_tracing.py:154
↓ 7 callersFunctionsession_event
(type: str, id: str, **fields: Any)
tests/lib/tools/test_open_telemetry.py:2130
↓ 7 callersFunctionspan_id
(span: ReadableSpan | trace.Span)
tests/test_open_telemetry.py:214
↓ 7 callersFunctiontrace_id
(span: ReadableSpan)
tests/test_open_telemetry.py:220
↓ 7 callersFunctiontype_names
The `type` of each member of a union.
tests/test_open_telemetry.py:8257
↓ 7 callersFunctionunmarked
`marked(text)` without the marker.
tests/lib/threads/helpers.py:180
↓ 7 callersFunctionvalidate_credentials
Raise if only one of aws_access_key/aws_secret_key is provided.
src/anthropic/lib/aws/_credentials.py:7
↓ 6 callersMethod__init__
( self, *, thread: ThreadT, options: TurnOverrides | RequestOptions, t
src/anthropic/lib/tools/_beta_runner.py:179
↓ 6 callersMethod_build_workload_delegate
(self, auth: Dict[str, Any])
src/anthropic/lib/credentials/_providers.py:692
↓ 6 callersFunction_disabled
(entry: Any)
tests/lib/tools/toolsets/test_interface.py:72
↓ 6 callersFunction_encode_secret
Build a work-item `secret` the way the API does: URL-safe base64 of a JSON payload, without padding.
tests/lib/environments/test_worker.py:57
↓ 6 callersMethod_in_terminated_thread
Whether `ev` names a thread that has terminated.
src/anthropic/lib/tools/_beta_session_runner.py:783
↓ 6 callersFunction_is_status
(err: Exception, code: int)
src/anthropic/lib/environments/_poller.py:45
↓ 6 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:132
↓ 6 callersFunction_mock_deployment
Mock one deployment: its token endpoint mints `token` and its messages endpoint accepts anything. Pair with `_requests_to` to check that a cli
tests/lib/test_credentials.py:2421
↓ 6 callersFunction_mode
(p: Path)
tests/lib/tools/test_skills.py:202
↓ 6 callersFunction_on
(world: World, tab_id: str, url: str, *, active: bool = False)
tests/lib/tools/toolsets/test_enforcement.py:34
↓ 6 callersFunction_paused_server_tool_use
()
tests/lib/tools/test_runners.py:653
↓ 6 callersFunction_polling_worker
(monkeypatch: pytest.MonkeyPatch, work: _PolledWorkResource, serve: Any)
tests/lib/environments/test_worker.py:1255
↓ 6 callersFunction_reject_httpx_object
`httpx` objects don't work with `httpx2`, and would otherwise fail deep inside a request.
src/anthropic/_base_client.py:161
↓ 6 callersFunction_requests_to
(respx_mock: MockRouter, base_url: str)
tests/lib/test_credentials.py:2430
↓ 6 callersFunction_sha
(content: str | bytes)
tests/lib/tools/test_file_store.py:27
↓ 6 callersFunction_sha
(content: str)
tests/lib/tools/memory_sync/_fake_anthropic.py:23
↓ 6 callersFunction_status_error
(code: int)
tests/lib/tools/memory_sync/_fake_anthropic.py:27
↓ 6 callersFunction_symlink_fixture
Workdir with two symlink cycles, a link that escapes, and a link whose target spells its way through a cycle to the escaping link.
tests/lib/tools/test_agent_toolset.py:88
↓ 6 callersMethod_tool_use_span
The span of one run of `tool` for the call `tool_use`. The result the runner sends back, an error result too, is made inside it.
src/anthropic/lib/tools/_beta_runner.py:264
↓ 6 callersMethod_toolset_refuse_if_closed
(self)
src/anthropic/lib/tools/_toolsets/_runnable.py:91
↓ 6 callersMethod_validate_path
Validate and resolve memory paths
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:686
↓ 6 callersFunction_within
True if `child` is `root` or a path inside it (both already resolved). Names compare exactly: on Windows `relative_to` lowercases them first,
src/anthropic/lib/tools/_skills.py:39
↓ 6 callersMethod_workload_provider
(self, handler: Callable[[httpx2.Request], httpx2.Response])
tests/lib/test_credentials.py:4879
↓ 6 callersFunctionassert_http_attributes
Checks that `span` is of a `method` request to `path`, and that its route is `path` with a placeholder for each ID.
tests/test_open_telemetry.py:6956
↓ 6 callersFunctionassert_signatures_in_sync
Ensure that the signature of the second function matches the first.
src/anthropic/_utils/_reflection.py:30
↓ 6 callersFunctionbuild_headers
Fold header layers into one `httpx2.Headers`, later layers taking precedence whatever a name's casing. An `Omit` value removes the header set by
src/anthropic/_base_client.py:2787
↓ 6 callersFunctionchange
(runner: Any, _reply: Any, _tool_response: Any)
tests/lib/threads/helpers.py:569
↓ 6 callersFunctionclassify
The rule for an exception out of a member call, at the `execute` boundary and in the runner alike: a `ToolsetUsageError` propagates, a `ToolError`
src/anthropic/lib/tools/_toolsets/_runnable.py:216
↓ 6 callersMethodclose
(self)
tests/lib/test_credentials.py:3937
↓ 6 callersFunctiondefer_calls
Defers the calls with these ids, when the caller sees their blocks finish. Pass each event to what it returns.
tests/lib/tools/test_runner_eager_toolsets.py:445
↓ 6 callersMethodend
Ends the span, unless it has ended. The status stays unset when `error` is a cancellation, and when the consumer stopped before it `f
src/anthropic/lib/_tracing/_work.py:54
↓ 6 callersMethodended
(self, spans: Spans, content_mode: str, *, output: bool = True)
tests/test_open_telemetry.py:7758
↓ 6 callersFunctionextract_response_type
Given a type like `APIResponse[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g.
src/anthropic/_response.py:867
↓ 6 callersFunctionfailing_tracing
An `open_telemetry` option whose tracer provider fails every span at `failure`.
tests/test_open_telemetry.py:7930
↓ 6 callersMethodfind
(self, context: BetaToolsetCallContext, input: BetaBrowserFindInput)
src/anthropic/lib/tools/_toolsets/_browser.py:396
↓ 6 callersFunctionfoo
(a: str | None = None)
tests/test_required_args.py:10
↓ 6 callersFunctionget_args
(tp: type[Any])
src/anthropic/_utils/_compat.py:15
↓ 6 callersFunctionget_helper_tag
Get the helper name from an object, if any.
src/anthropic/lib/_stainless_helpers.py:96
↓ 6 callersFunctiongiven
`values` without the entries whose value is `omit` or `not_given`, or `None` for an `extra_*` request option (whose "not given" default is `None`)
src/anthropic/lib/threads/_params.py:132
↓ 6 callersFunctionids
(tool_uses: list[Any])
tests/lib/tools/test_runner_eager_tools.py:864
↓ 6 callersFunctioniter_next
(iter: Iterator[_T] | AsyncIterator[_T])
tests/decoders/test_jsonl.py:127
↓ 6 callersFunctioniteration
An entry of a response's `usage.iterations`.
tests/test_open_telemetry.py:725
↓ 6 callersFunctionmcp_resource_to_content
Convert MCP resource contents to an Anthropic content block. Finds the first resource with a supported MIME type from the result's `contents`
src/anthropic/lib/tools/mcp.py:246
↓ 6 callersFunctionmember_calls
A reply with one `tool_use` for each call, which is its id, its name and its `toolset_name`, if it has one.
tests/lib/tools/test_open_telemetry.py:247
↓ 6 callersFunctionone_line
A page- or model-supplied text on one line the model or an operator reads: a tab's title, a download's error, a field of a member's confirmation l
src/anthropic/lib/tools/_toolsets/_sanitize.py:58
↓ 6 callersMethodparse
Like `send()`, and parses the reply against the thread's `output_format` into `parsed_output`.
src/anthropic/lib/threads/_beta_threads.py:205
↓ 6 callersMethodpoller
Async-iterate work items claimed from a self-hosted environment. Each yielded item has been ack'd. The environment key authenticates the
src/anthropic/resources/beta/environments/work.py:1297
↓ 6 callersFunctionprepare_request_data
Copy request params into plain data that can be serialized and re-sent. Drops `NotGiven` / `Omit` entries (`keep_top_level_omit` keeps `Omit` dir
src/anthropic/_utils/_prepare.py:47
↓ 6 callersFunctionredeemed_token
The request-body form of a redeemed credit token — the object shape, best-effort mode.
tests/lib/test_refusal_fallback_streaming.py:152
↓ 6 callersFunctionsee
(event: Any)
tests/lib/tools/test_runner_eager_toolsets.py:448
↓ 6 callersMethodsend
Send the staged messages and `messages` as one turn and return the reply. Keyword arguments apply to this turn only. Raises `AnthropicError` w
src/anthropic/lib/threads/_beta_threads.py:180
↓ 6 callersFunctionsession_api
A client for the session `sesn_1`, whose event history is `history` and whose event stream gives `live`. Reading the history fails when `history`
tests/lib/tools/test_open_telemetry.py:2147
↓ 6 callersMethodstart_span
(self, name: str, *args: Any, **kwargs: Any)
tests/test_tracing.py:58
↓ 6 callersMethodstop
Track a content_block_stop, shifting `event["index"]`.
src/anthropic/lib/middleware/_fallbacks.py:1309
↓ 6 callersFunctiontext_part
(content: str)
tests/test_open_telemetry.py:291
↓ 6 callersMethodto_param
Convert this response Message to a MessageParam so it can be passed back to the API as an input message, e.g. in the `messages` param.
src/anthropic/types/message.py:141
↓ 6 callersFunctiontool_spans
(spans: Spans)
tests/lib/tools/test_open_telemetry.py:299
↓ 6 callersFunctionwell_formed
`text` with each unpaired surrogate replaced by U+FFFD, so it can be sent.
src/anthropic/lib/tools/_toolsets/_sanitize.py:41
↓ 6 callersMethodwith_middleware
A new client with the given middleware appended after this client's middleware. Convenience for applying extra middleware to a single request
src/anthropic/_client.py:554
↓ 5 callersMethod__get_proxied__
(self)
src/anthropic/_utils/_proxy.py:57
↓ 5 callersMethod__init__
(self, message: str, request: httpx2.Request, *, body: object | None)
src/anthropic/_exceptions.py:64
↓ 5 callersMethod__init__
( self, *, url: URL, )
src/anthropic/_base_client.py:182
↓ 5 callersMethod__init__
( self, *, family: ToolsetFamily, helper_tag: StainlessHelperHeaderValue,
src/anthropic/lib/tools/_toolsets/_base.py:117
↓ 5 callersFunction_api_status_error
(code: int)
tests/lib/environments/test_poller_method.py:50
↓ 5 callersFunction_api_status_error
(code: int, body: object = None)
tests/lib/environments/test_worker.py:63
↓ 5 callersMethod_available_tool_names
The tool names currently available, after applying any mid-conversation `tool_removal` / `tool_addition` blocks. Removal is only a hi
src/anthropic/lib/tools/_beta_runner.py:560
↓ 5 callersFunction_bearer_tokens
The token on each HTTP request so far, in order.
tests/lib/test_credentials.py:3547
↓ 5 callersFunction_chunk_bytes_to_sse
(raw: bytes)
src/anthropic/lib/bedrock/_stream_decoder.py:71
↓ 5 callersFunction_created_store
(root: Path, *, utf8_only: bool = False)
tests/lib/tools/test_file_store.py:31
↓ 5 callersFunction_disabled
(entry: Any)
tests/lib/tools/toolsets/test_computer_interface.py:53
↓ 5 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_two_pass.py:24
↓ 5 callersFunction_drain_one
Pull a single item from a sync iterator; assert there was one.
tests/lib/environments/test_poller_method.py:136
↓ 5 callersFunction_emit
(event: str, payload: dict[str, Any])
src/anthropic/lib/middleware/_fallbacks.py:1621
↓ 5 callersMethod_get_http_client
Return an `httpx2.Client`, lazily creating (and tracking) one we own.
src/anthropic/lib/credentials/_providers.py:430
↓ 5 callersFunction_is_base_client
True only for the base `Anthropic` / `AsyncAnthropic` classes, not subclasses. Subclasses (`AnthropicAWS`, `AnthropicFoundry`) have their own aut
src/anthropic/_client.py:54
↓ 5 callersMethod_load_config
Read and cache the config file, resolving `base_url` and `credentials_path`. On Unix, refuses a file that group or others can write.
src/anthropic/lib/credentials/_providers.py:304
← previousnext →401–500 of 12,274, ranked by callers