MCPcopy Create free account

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

Types & classes2,085 in github.com/anthropics/anthropic-sdk-python

↓ 124 callersClassAnthropic
src/anthropic/_client.py:146
↓ 124 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:705
↓ 80 callersClassAsyncAnthropic
src/anthropic/_client.py:580
↓ 80 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:104
↓ 69 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:192
↓ 68 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
↓ 68 callersClassFinalRequestOptions
src/anthropic/_models.py:975
↓ 55 callersClassAnthropicGoogleCloud
Synchronous client for the first-party Anthropic API served through Google's gateway (Claude Platform on Google Cloud). The whole first-party
src/anthropic/lib/google_cloud/_client.py:186
↓ 48 callersClassFakeAsyncEvents
tests/lib/tools/test_session_runner.py:173
↓ 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
↓ 46 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
↓ 46 callersClassBetaMemoryTool20250818CreateCommand
src/anthropic/types/beta/beta_memory_tool_20250818_create_command.py:8
↓ 38 callersClassPropertyInfo
Metadata class to be used in Annotated types to provide information about a given type. For example: class MyParams(TypedDict): acco
src/anthropic/_utils/_transform.py:44
↓ 38 callersClass_FakeTool
tests/lib/tools/test_session_runner.py:234
↓ 36 callersClassAnthropicAWS
src/anthropic/lib/aws/_client.py:25
↓ 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:138
↓ 32 callersClassRecordingMiddleware
tests/test_middleware.py:88
↓ 29 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
↓ 24 callersClassAnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:152
↓ 23 callersClassEnvironmentWorker
Run a self-hosted environment worker. Composed from the control-plane poller (`client.beta.environments.work.poller`) and the per-session `Se
src/anthropic/lib/environments/_worker.py:302
↓ 22 callersClassAnthropicError
src/anthropic/_exceptions.py:31
↓ 22 callersClass_StubWork
Minimal stand-in for `BetaSelfHostedWork` — only fields the poller reads.
tests/lib/environments/test_poller_method.py:30
↓ 21 callersClassAsyncAnthropicGoogleCloud
Asynchronous client for the first-party Anthropic API served through Google's gateway (Claude Platform on Google Cloud). See `AnthropicGoogleCloud
src/anthropic/lib/google_cloud/_client.py:446
↓ 21 callersClassStaticToken
An `AccessTokenProvider` that always returns a fixed token with no expiry.
src/anthropic/lib/credentials/_providers.py:118
↓ 21 callersClass_FakeSessions
tests/lib/environments/test_worker.py:137
↓ 19 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:160
↓ 19 callersClass_FakeWorkResource
tests/lib/environments/test_worker.py:90
↓ 18 callersClassFakeWork
Sync resource fake. `poll_script` is consumed in order; values are either `BetaSelfHostedWork`-shaped stubs, `None` (no work available), `Exce
tests/lib/environments/test_poller_method.py:44
↓ 17 callersClassAsyncAnthropicAWS
src/anthropic/lib/aws/_client.py:239
↓ 17 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:160
↓ 16 callersClassAnthropicFoundry
src/anthropic/lib/foundry.py:92
↓ 15 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:62
↓ 15 callersClassBetaMemoryTool20250818ViewCommand
src/anthropic/types/beta/beta_memory_tool_20250818_view_command.py:9
↓ 15 callersClassFakeClock
tests/lib/test_credentials.py:1455
↓ 15 callersClass_FakeCredentials
Duck-typed stand-in for a `google.auth` Credentials object.
tests/lib/test_google_cloud.py:49
↓ 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 callersClassAPIResponse
src/anthropic/_response.py:298
↓ 13 callersClassCredentialsError
Raised when credentials cannot be loaded from local files, config, or the environment.
src/anthropic/_exceptions.py:117
↓ 12 callersClassAsyncAPIResponse
src/anthropic/_response.py:411
↓ 12 callersClassBetaMemoryTool20250818InsertCommand
src/anthropic/types/beta/beta_memory_tool_20250818_insert_command.py:8
↓ 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:736
↓ 12 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:787
↓ 11 callersClassAsyncAnthropicFoundry
src/anthropic/lib/foundry.py:310
↓ 11 callersClassWorkloadIdentityError
Raised when the OIDC token exchange (`POST /v1/oauth/token`) fails.
src/anthropic/lib/credentials/_workload.py:110
↓ 10 callersClassAnthropicBedrock
src/anthropic/lib/bedrock/_client.py:132
↓ 10 callersClassAnthropicVertex
src/anthropic/lib/vertex/_client.py:92
↓ 10 callersClassAsyncAnthropicVertex
src/anthropic/lib/vertex/_client.py:256
↓ 10 callersClassBetaMemoryTool20250818StrReplaceCommand
src/anthropic/types/beta/beta_memory_tool_20250818_str_replace_command.py:8
↓ 9 callersClassAPIStatusError
Raised when an API response has a status code of 4xx or 5xx.
src/anthropic/_exceptions.py:71
↓ 9 callersClassBetaManagedAgentsTextBlock
Regular text content.
src/anthropic/types/beta/sessions/beta_managed_agents_text_block.py:8
↓ 9 callersClassFakeAsyncWork
tests/lib/environments/test_poller_method.py:68
↓ 9 callersClassQuerystring
src/anthropic/_qs.py:19
↓ 8 callersClassBetaMemoryTool20250818DeleteCommand
src/anthropic/types/beta/beta_memory_tool_20250818_delete_command.py:8
↓ 8 callersClassBetaMemoryTool20250818RenameCommand
src/anthropic/types/beta/beta_memory_tool_20250818_rename_command.py:8
↓ 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 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:145
↓ 7 callersClassCountingProvider
tests/lib/test_credentials.py:1463
↓ 7 callersClassProvider
tests/lib/test_credentials.py:3414
↓ 7 callersClassUser
tests/test_utils/test_json.py:25
↓ 7 callersClass_StubEvent
Stand-in for the various session event types — only the fields the runner reads are populated.
tests/lib/tools/test_session_runner.py:65
↓ 6 callersClassInspectResponse
Records the response wrapper returned by `call_next` and passes it through.
tests/test_middleware.py:253
↓ 6 callersClassJSONOutputFormatParam
src/anthropic/types/json_output_format_param.py:9
↓ 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 callersClassAsyncAnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:345
↓ 5 callersClassAttemptRecorder
Records the `retries_taken` and response status of every attempt the chain runs for.
tests/test_middleware.py:196
↓ 5 callersClassModel
tests/test_models.py:161
↓ 5 callersClass_FakeStream
Stand-in for the AsyncStream returned by `events.stream()`. Yields scripted events in order; once exhausted, blocks forever (the real stream
tests/lib/tools/test_session_runner.py:131
↓ 4 callersClassAWSEventStreamDecoder
src/anthropic/lib/bedrock/_stream_decoder.py:25
↓ 4 callersClassAsyncAnthropicBedrock
src/anthropic/lib/bedrock/_client.py:310
↓ 4 callersClassBetaJSONOutputFormatParam
src/anthropic/types/beta/beta_json_output_format_param.py:9
↓ 4 callersClassExploding
tests/test_middleware.py:231
↓ 4 callersClassModelFallback
tests/test_middleware.py:132
↓ 4 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:362
↓ 4 callersClassTimeout
tests/test_client.py:395
↓ 4 callersClassUnsupportedMCPValueError
Raised when an MCP value cannot be converted to a format supported by the Claude API.
src/anthropic/lib/tools/mcp.py:115
↓ 4 callersClass_Lease
This worker's view of one work-item lease: whether it has ended, and why. Shared by `_heartbeat_loop` and the code serving the item. The first
src/anthropic/lib/environments/_worker.py:128
↓ 3 callersClassAsyncCallableMiddleware
A middleware object that is a class instance with an async `__call__` method.
tests/test_middleware.py:291
↓ 3 callersClassAsyncMessages
src/anthropic/lib/bedrock/_beta_messages.py:44
↓ 3 callersClassAsyncMessages
src/anthropic/lib/vertex/_beta_messages.py:45
↓ 3 callersClassAsyncMessagesWithRawResponse
src/anthropic/lib/vertex/_beta_messages.py:81
↓ 3 callersClassAsyncMessagesWithStreamingResponse
src/anthropic/lib/vertex/_beta_messages.py:99
↓ 3 callersClassAsyncServiceAccountsWithRawResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:764
↓ 3 callersClassAsyncServiceAccountsWithStreamingResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:806
↓ 3 callersClassAsyncStream
Provides the core interface to iterate over an asynchronous stream response.
src/anthropic/_streaming.py:169
↓ 3 callersClassBetaLocalFilesystemMemoryTool
File-based memory storage implementation for Claude conversations
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:387
↓ 3 callersClassBetaUsage
src/anthropic/types/beta/beta_usage.py:14
↓ 3 callersClassBoom
tests/test_middleware.py:227
↓ 3 callersClassEnvToken
An `AccessTokenProvider` that reads `ANTHROPIC_AUTH_TOKEN` at call time.
src/anthropic/lib/credentials/_providers.py:129
↓ 3 callersClassHTTPTransport
tests/test_client.py:398
↓ 3 callersClassMessages
src/anthropic/lib/bedrock/_beta_messages.py:18
↓ 3 callersClassMessages
src/anthropic/lib/vertex/_beta_messages.py:18
↓ 3 callersClassMessagesWithRawResponse
src/anthropic/lib/vertex/_beta_messages.py:72
↓ 3 callersClassMessagesWithStreamingResponse
src/anthropic/lib/vertex/_beta_messages.py:90
↓ 3 callersClassMissingDependencyError
src/anthropic/lib/_extras/_common.py:11
↓ 3 callersClassP
tests/lib/test_credentials.py:1545
↓ 3 callersClassParsedBetaMessage
src/anthropic/types/beta/parsed_beta_message.py:81
↓ 3 callersClassSSEDecoder
src/anthropic/_streaming.py:369
↓ 3 callersClassServerSentEvent
src/anthropic/_streaming.py:317
↓ 3 callersClassServiceAccountsWithRawResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:743
↓ 3 callersClassServiceAccountsWithStreamingResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:785
next →1–100 of 2,085, ranked by callers