MCPcopy Create free account

hub / github.com/anthropics/anthropic-sdk-python / types & classes

Types & classes4,472 in github.com/anthropics/anthropic-sdk-python

↓ 248 callersClassUnionDiscriminator
Annotated metadata naming the field that tells the variants of a union apart, e.g. ```py Pet: TypeAlias = Annotated[Union[Cat, Dog], UnionDis
src/anthropic/_models.py:793
↓ 182 callersClassAnthropic
src/anthropic/_client.py:151
↓ 164 callersClassAsyncBedrock
src/anthropic/resources/beta/bedrock/bedrock.py:66
↓ 164 callersClassBedrock
src/anthropic/resources/beta/bedrock/bedrock.py:33
↓ 121 callersClassAsyncAnthropic
src/anthropic/_client.py:566
↓ 111 callersClassBetaRefusalFallbackMiddleware
Middleware that retries refused beta `/v1/messages` requests down a fallback chain, reproducing the server-side `fallbacks` wire shape client-
src/anthropic/lib/middleware/_fallbacks.py:106
↓ 97 callersClassUnavailableMemberError
The refusal the model reads for a member the driver does not implement.
src/anthropic/lib/tools/_toolsets/_errors.py:97
↓ 88 callersClassAgentToolContext
Workdir + path-policy for the agent toolset. Trust model — two tiers: - The file tools (`beta_read_tool`, `beta_write_tool`, `beta_edi
src/anthropic/lib/tools/agent_toolset.py:206
↓ 79 callersClassFakeBrowser
tests/lib/tools/toolsets/_fakes.py:158
↓ 77 callersClassAnthropicGoogleCloud
Synchronous client for Claude Models on Google Cloud (Anthropic managed): the first-party Anthropic API served through Google's gateway. The
src/anthropic/lib/google_cloud/_client.py:240
↓ 75 callersClassToolError
Error that can be raised from a tool to return structured content with `is_error: True`. When the tool runner catches this error, it will use the
src/anthropic/lib/tools/_beta_functions.py:30
↓ 74 callersClassCredentialsFile
An `AccessTokenProvider` backed by a named profile. A profile is a pair of files under the config directory (`~/.config/anthropic/` by defaul
src/anthropic/lib/credentials/_providers.py:146
↓ 70 callersClassFinalRequestOptions
src/anthropic/_models.py:1073
↓ 65 callersClassCall
tests/lib/tools/_fake_sessions_api.py:53
↓ 48 callersClassBetaMemoryTool20250818CreateCommand
src/anthropic/types/beta/beta_memory_tool_20250818_create_command.py:8
↓ 47 callersClassAccessToken
An Anthropic API access token with optional expiry. `expires_at` is unix seconds; `None` means no expiry information (the token will be treat
src/anthropic/lib/credentials/_types.py:25
↓ 47 callersClassTokenCache
Thread-safe cache wrapping an `AccessTokenProvider` or an `AsyncAccessTokenProvider` with two-tier proactive refresh and single-flight semanti
src/anthropic/lib/credentials/_cache.py:75
↓ 43 callersClassAsyncFakeBrowser
tests/lib/tools/toolsets/_fakes.py:228
↓ 41 callersClassAnthropicAWS
src/anthropic/lib/aws/_client.py:24
↓ 40 callersClassAsyncAnthropicGoogleCloud
Asynchronous client for Claude Models on Google Cloud (Anthropic managed): the first-party Anthropic API served through Google's gateway. See
src/anthropic/lib/google_cloud/_client.py:488
↓ 34 callersClassRecordingMiddleware
tests/test_middleware.py:90
↓ 34 callersClassWorkloadIdentityCredentials
Exchanges an external OIDC JWT for an Anthropic access token via the RFC 7523 `jwt-bearer` grant. This is an `AccessTokenProvider`: calling i
src/anthropic/lib/credentials/_workload.py:135
↓ 32 callersClassTool
tests/lib/tools/_fake_sessions_api.py:794
↓ 29 callersClassAnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:144
↓ 28 callersClassAnthropicError
src/anthropic/_exceptions.py:43
↓ 25 callersClassEchoBrowserToolset
tests/lib/tools/toolsets/_stubs.py:43
↓ 24 callersClassFakeDesktop
tests/lib/tools/toolsets/_computer_fakes.py:78
↓ 22 callersClassAsyncAnthropicAWS
src/anthropic/lib/aws/_client.py:249
↓ 21 callersClassAnthropicFoundry
src/anthropic/lib/foundry.py:93
↓ 20 callersClassAnthropicVertex
src/anthropic/lib/vertex/_client.py:55
↓ 20 callersClassBetaMemoryTool20250818ViewCommand
src/anthropic/types/beta/beta_memory_tool_20250818_view_command.py:9
↓ 20 callersClassSessionMemoryStores
The memory stores attached to one session, materialised on disk. `download` opens a `._file_store.LocalFileStore` at each attached store's di
src/anthropic/lib/tools/_memories.py:167
↓ 19 callersClassAsyncEchoBrowserToolset
tests/lib/tools/toolsets/_stubs.py:67
↓ 19 callersClassBetaFallbackState
Tracks which fallback a sequence of requests is pinned to. Create one and enter it (`with state:` — the same context manager works for both c
src/anthropic/lib/middleware/_fallbacks.py:64
↓ 19 callersClassOmit
To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json
src/anthropic/_types.py:266
↓ 18 callersClassAnthropicBedrock
src/anthropic/lib/bedrock/_client.py:152
↓ 17 callersClassVariant
Responses that the API reference does not specify, so that a client has to handle each.
tests/lib/environments/_fake_work_api.py:53
↓ 17 callersClass_FakeCredentials
Duck-typed stand-in for a `google.auth` Credentials object.
tests/lib/test_google_cloud.py:49
↓ 16 callersClassAsyncAnthropicVertex
src/anthropic/lib/vertex/_client.py:221
↓ 16 callersClassStaticToken
An `AccessTokenProvider` that always returns a fixed token with no expiry.
src/anthropic/lib/credentials/_providers.py:118
↓ 15 callersClassAsyncAnthropicFoundry
src/anthropic/lib/foundry.py:305
↓ 15 callersClassFakeClock
tests/lib/test_credentials.py:1586
↓ 14 callersClassAPIResponse
src/anthropic/_response.py:298
↓ 13 callersClassAPIRequest
A view over the request that the client is about to execute. Treat instances as immutable; use `copy()` to derive a modified request.
src/anthropic/_request.py:15
↓ 13 callersClassAsyncAPIResponse
src/anthropic/_response.py:411
↓ 13 callersClassBetaBrowserNavigateResult
Where a navigation ended up. Rendered as `Navigated to {url} — {title} (HTTP {status})`, each value made safe for one line of text (control, line-
src/anthropic/lib/tools/_toolsets/_results.py:32
↓ 13 callersClassBetaMemoryTool20250818InsertCommand
src/anthropic/types/beta/beta_memory_tool_20250818_insert_command.py:8
↓ 13 callersClassBetaToolUseBlock
src/anthropic/types/beta/beta_tool_use_block.py:16
↓ 13 callersClassCredentialsError
Raised when credentials cannot be loaded from local files, config, or the environment.
src/anthropic/_exceptions.py:164
↓ 13 callersClassInMemoryConfig
An `AccessTokenProvider` driven by an in-memory config dict (same shape as `configs/<profile>.json`) rather than files on disk. Intended for
src/anthropic/lib/credentials/_providers.py:802
↓ 12 callersClassBetaLocalFilePolicy
The file policy the SDK ships: `file_upload` may read paths under `upload_roots` (symlinks resolved, whole components compared, a `..` component r
src/anthropic/lib/tools/_toolsets/_security.py:165
↓ 12 callersClassBody
A response body that counts how often it is closed. It holds more than a test reads.
tests/utils.py:188
↓ 12 callersClassIdentityTokenFile
An `IdentityTokenProvider` that reads a JWT from a file on every call. Kubernetes projected service-account tokens (and similar) are rotated in p
src/anthropic/lib/credentials/_providers.py:751
↓ 11 callersClassBetaMemoryTool20250818StrReplaceCommand
src/anthropic/types/beta/beta_memory_tool_20250818_str_replace_command.py:8
↓ 11 callersClassSyncTool
tests/lib/tools/_fake_sessions_api.py:807
↓ 11 callersClassTwoMembers
tests/lib/tools/toolsets/test_interface.py:48
↓ 11 callersClassWorkloadIdentityError
Raised when the OIDC token exchange (`POST /v1/oauth/token`) fails.
src/anthropic/lib/credentials/_workload.py:107
↓ 10 callersClassAsyncFakeDesktop
tests/lib/tools/toolsets/_computer_fakes.py:133
↓ 10 callersClassBetaManagedAgentsTextBlock
Regular text content.
src/anthropic/types/beta/sessions/beta_managed_agents_text_block.py:8
↓ 10 callersClassBetaMemoryTool20250818RenameCommand
src/anthropic/types/beta/beta_memory_tool_20250818_rename_command.py:8
↓ 10 callersClassBetaScreenshotResult
A screenshot or zoom image from a browser or computer toolset, rendered as one image block. The image must already fit the model's image limits: t
src/anthropic/lib/tools/_toolsets/_base.py:86
↓ 10 callersClassPageInfo
Stores the necessary information to build the request to retrieve the next page. Either `url` or `params` must be set.
src/anthropic/_base_client.py:171
↓ 10 callersClassSpans
tests/lib/tools/test_open_telemetry.py:126
↓ 10 callersClassToolsetContractError
Misuse of the SDK's own interface detected at call time (for example a `url_policy` that returns a value).
src/anthropic/lib/tools/_toolsets/_errors.py:54
↓ 9 callersClassAsyncAnthropicBedrock
src/anthropic/lib/bedrock/_client.py:334
↓ 9 callersClassAsyncAnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:334
↓ 9 callersClassBetaBrowserState
The browser after a call: what `_browser_state` returns. Forwarded to the API with download paths the file policy does not expose removed and each
src/anthropic/lib/tools/_toolsets/_results.py:79
↓ 9 callersClassQuerystring
src/anthropic/_qs.py:20
↓ 9 callersClassTwoMembers
tests/lib/tools/toolsets/test_computer_interface.py:37
↓ 8 callersClassBetaMemoryTool20250818DeleteCommand
src/anthropic/types/beta/beta_memory_tool_20250818_delete_command.py:8
↓ 8 callersClassBetaToolsetCallContext
What a member receives alongside its input: the `tool_use` block the call answers (`context.tool_use.id`). `None` only when a member is invoked ou
src/anthropic/lib/tools/_toolsets/_runnable.py:76
↓ 8 callersClassFileStoreError
A refused operation — input the store will not act on. OS errors propagate as `OSError`.
src/anthropic/lib/tools/_file_store.py:36
↓ 8 callersClassServer
Answers a call, after one retry if `retried`. Records each request, and the context of the span that was current while the HTTP client sent it.
tests/test_tracing.py:99
↓ 7 callersClassBetaBrowserNavigateInput
Navigate to a URL, or go back/forward/reload in history. The protocol may be omitted (defaults to https://).
src/anthropic/types/beta/beta_browser_navigate_input.py:8
↓ 7 callersClassCountingProvider
tests/lib/test_credentials.py:1594
↓ 7 callersClassProvider
tests/lib/test_credentials.py:3927
↓ 7 callersClassSessionToolRunner
Attach to a managed-agents session and dispatch its tool calls locally. The sessions-side counterpart to `client.beta.messages.tool_runner`: an
src/anthropic/lib/tools/_beta_session_runner.py:266
↓ 7 callersClassStartAttributes
Keeps the name and the attributes that each span starts with, which is all that a sampler is given.
tests/test_open_telemetry.py:193
↓ 7 callersClassUser
tests/test_utils/test_json.py:49
↓ 6 callersClassBetaComputerCursorPositionResult
Where the cursor is, in screenshot pixels; rendered as `X={x},Y={y}`.
src/anthropic/lib/tools/_toolsets/_computer_results.py:26
↓ 6 callersClassInspectResponse
Records the response wrapper returned by `call_next` and passes it through.
tests/test_middleware.py:255
↓ 6 callersClassJSONOutputFormatParam
src/anthropic/types/json_output_format_param.py:9
↓ 6 callersClassToolsetConfigError
A construction-time mistake: an option combination the toolset cannot honour.
src/anthropic/lib/tools/_toolsets/_errors.py:50
↓ 6 callersClass_RevocableLogin
A provider that serves `tok-1` until it is forced to refresh, and a server that accepts only `valid`.
tests/lib/test_credentials.py:2465
↓ 6 callersClass_Tool
Stands in for a `@beta_tool` / toolset object: `tools=` takes anything with a `to_dict()`.
tests/lib/test_stainless_helpers.py:21
↓ 5 callersClassAttemptRecorder
Records the `retries_taken` and response status of every attempt the chain runs for.
tests/test_middleware.py:198
↓ 5 callersClassDesktop
The desktop both fakes drive: the cursor, a call log, and what each member hands back.
tests/lib/tools/toolsets/_computer_fakes.py:33
↓ 5 callersClassForecast
tests/lib/threads/helpers.py:50
↓ 5 callersClassModel
tests/test_models.py:176
↓ 5 callersClassRecordingProvider
tests/test_tracing.py:68
↓ 4 callersClassAPIConnectionError
src/anthropic/_exceptions.py:142
↓ 4 callersClassAsyncStream
Provides the core interface to iterate over an asynchronous stream response.
src/anthropic/_streaming.py:154
↓ 4 callersClassAsyncTwoMembers
tests/lib/tools/toolsets/test_interface.py:58
↓ 4 callersClassBetaDialogDismissed
A native dialog (`alert`, `confirm`, `prompt`) the page opened and the driver dismissed. Its `type` is the SDK's own and is never sent: the SDK r
src/anthropic/lib/tools/_toolsets/_results.py:54
↓ 4 callersClassBetaURLContext
What a hook receives about the call it serves: the first argument of `url_policy(context, url)` and of the file policy's `resolve_upload_paths(con
src/anthropic/lib/tools/_toolsets/_hooks.py:27
↓ 4 callersClassCounter
tests/test_client.py:91
↓ 4 callersClassExploding
tests/test_middleware.py:233
↓ 4 callersClassModelFallback
tests/test_middleware.py:134
↓ 4 callersClassNew
The next turn is a `create` with the whole history. `replaces_lost_thread` says whether the server did not find the thread before it.
src/anthropic/lib/threads/_thread_state.py:471
↓ 4 callersClassSSEDecoder
src/anthropic/_streaming.py:335
next →1–100 of 4,472, ranked by callers