Home / File/ _types.py — anthropic-sdk-python Source File

_types.py — anthropic-sdk-python Source File

Architecture documentation for _types.py, a python file in the anthropic-sdk-python codebase. 12 imports, 9 dependents.

File python AnthropicClient SyncAPI 12 imports 9 dependents 4 functions 9 classes

Entity Profile

Dependency Diagram

graph LR
  87f621ac_b3e0_a225_72b3_99f9818f3002["_types.py"]
  3912cc3f_b0e8_a732_b8e2_613b018b830d["_models.py"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 3912cc3f_b0e8_a732_b8e2_613b018b830d
  17ce5647_6f06_0676_a4a5_e378a3f57cb1["BaseModel"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 17ce5647_6f06_0676_a4a5_e378a3f57cb1
  2e9c15bb_de03_aa91_93be_0e05db0a552e["_response.py"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 2e9c15bb_de03_aa91_93be_0e05db0a552e
  c5dafd2e_e591_b4ff_d0c8_67a1204aef83["APIResponse"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> c5dafd2e_e591_b4ff_d0c8_67a1204aef83
  8968fc97_d184_e3da_727e_c38832cb23a5["AsyncAPIResponse"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 8968fc97_d184_e3da_727e_c38832cb23a5
  f3a9224d_bdab_aa4b_9f5e_877302fb10bc["_legacy_response.py"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> f3a9224d_bdab_aa4b_9f5e_877302fb10bc
  707108e1_1591_e5c4_7fa0_ca26831eab86["HttpxBinaryResponseContent"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 707108e1_1591_e5c4_7fa0_ca26831eab86
  bb0af148_44a9_df40_49c4_0fa6ceb5a403["os"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> bb0af148_44a9_df40_49c4_0fa6ceb5a403
  89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875["typing"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875
  37c05070_ca59_d596_7250_de9d1939227f["typing_extensions"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 37c05070_ca59_d596_7250_de9d1939227f
  9c26e8a9_1ad2_1174_876a_1fc500ce0eaf["httpx"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 9c26e8a9_1ad2_1174_876a_1fc500ce0eaf
  21de8837_7dae_989e_fdbb_1415c0770d90["pydantic"]
  87f621ac_b3e0_a225_72b3_99f9818f3002 --> 21de8837_7dae_989e_fdbb_1415c0770d90
  05a7b67e_1fde_5c25_9b37_cc7e827cb62e["__init__.py"]
  05a7b67e_1fde_5c25_9b37_cc7e827cb62e --> 87f621ac_b3e0_a225_72b3_99f9818f3002
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad["_base_client.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 87f621ac_b3e0_a225_72b3_99f9818f3002
  style 87f621ac_b3e0_a225_72b3_99f9818f3002 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

from os import PathLike
from typing import (
    IO,
    TYPE_CHECKING,
    Any,
    Dict,
    List,
    Type,
    Tuple,
    Union,
    Mapping,
    TypeVar,
    Callable,
    Iterable,
    Iterator,
    Optional,
    Sequence,
    AsyncIterable,
)
from typing_extensions import (
    Set,
    Literal,
    Protocol,
    TypeAlias,
    TypedDict,
    SupportsIndex,
    overload,
    override,
    runtime_checkable,
)

import httpx
import pydantic
from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport

if TYPE_CHECKING:
    from ._models import BaseModel
    from ._response import APIResponse, AsyncAPIResponse
    from ._legacy_response import HttpxBinaryResponseContent

Transport = BaseTransport
AsyncTransport = AsyncBaseTransport
Query = Mapping[str, object]
Body = object
AnyMapping = Mapping[str, object]
ModelT = TypeVar("ModelT", bound=pydantic.BaseModel)
_T = TypeVar("_T")


# Approximates httpx internal ProxiesTypes and RequestFiles types
# while adding support for `PathLike` instances
ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]]
ProxiesTypes = Union[str, Proxy, ProxiesDict]
if TYPE_CHECKING:
    Base64FileInput = Union[IO[bytes], PathLike[str]]
    FileContent = Union[IO[bytes], bytes, PathLike[str]]
else:
    Base64FileInput = Union[IO[bytes], PathLike]
// ... (213 more lines)

Subdomains

Frequently Asked Questions

What does _types.py do?
_types.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, SyncAPI subdomain.
What functions are defined in _types.py?
_types.py defines 4 function(s): Base64FileInput, NoneType, SequenceNotStr, _models.
What does _types.py depend on?
_types.py imports 12 module(s): APIResponse, AsyncAPIResponse, BaseModel, HttpxBinaryResponseContent, _legacy_response.py, _models.py, _response.py, httpx, and 4 more.
What files import _types.py?
_types.py is imported by 9 file(s): __init__.py, _base_client.py, _client.py, _compat.py, _files.py, _legacy_response.py, _models.py, _qs.py, and 1 more.
Where is _types.py in the architecture?
_types.py is located at src/anthropic/_types.py (domain: AnthropicClient, subdomain: SyncAPI, directory: src/anthropic).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free