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

_base_client.py — anthropic-sdk-python Source File

Architecture documentation for _base_client.py, a python file in the anthropic-sdk-python codebase. 65 imports, 7 dependents.

File python AnthropicClient AsyncAPI 65 imports 7 dependents 12 functions 16 classes

Entity Profile

Dependency Diagram

graph LR
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad["_base_client.py"]
  f6cccbc2_b5f1_afc1_d6b1_b929a0d4c116["f6cccbc2:b5f1:afc1:d6b1:b929a0d4c116"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> f6cccbc2_b5f1_afc1_d6b1_b929a0d4c116
  738dc346_a11e_4dc7_f7df_dced9f1a2476["_qs.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 738dc346_a11e_4dc7_f7df_dced9f1a2476
  765fcca3_81c1_6ab1_98e8_c2929e7562e2["Querystring"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 765fcca3_81c1_6ab1_98e8_c2929e7562e2
  e20f2c32_b105_01cb_557f_c10174db767d["_files.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> e20f2c32_b105_01cb_557f_c10174db767d
  fe1e967b_1ba5_59ce_0b67_87ce63fe58e9["to_httpx_files"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> fe1e967b_1ba5_59ce_0b67_87ce63fe58e9
  41e4dab8_bf10_15e9_1d57_2ba669f0414a["async_to_httpx_files"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 41e4dab8_bf10_15e9_1d57_2ba669f0414a
  87f621ac_b3e0_a225_72b3_99f9818f3002["_types.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 87f621ac_b3e0_a225_72b3_99f9818f3002
  14d855f4_2395_cbc9_e501_5be17b6905d0["Omit"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 14d855f4_2395_cbc9_e501_5be17b6905d0
  f30eca5a_2fa0_68c1_64aa_b52331a2dcc8["NotGiven"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> f30eca5a_2fa0_68c1_64aa_b52331a2dcc8
  540086aa_efe6_8999_9b19_1737df953145["HttpxSendArgs"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 540086aa_efe6_8999_9b19_1737df953145
  7ce58abf_a0c1_a253_85bf_5988de0346a4["RequestOptions"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 7ce58abf_a0c1_a253_85bf_5988de0346a4
  bab3bcb9_c063_9bc5_9713_fd02b9e2ca7b["ModelBuilderProtocol"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> bab3bcb9_c063_9bc5_9713_fd02b9e2ca7b
  6dadb144_3070_6111_357f_214554108905["__init__.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 6dadb144_3070_6111_357f_214554108905
  5828b8ae_9c8c_9b95_9f29_d2659004d334["_compat.py"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad --> 5828b8ae_9c8c_9b95_9f29_d2659004d334
  style 31e60ad8_cac8_652d_176d_4f7cf7dda1ad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

import sys
import json
import time
import uuid
import email
import socket
import asyncio
import inspect
import logging
import platform
import warnings
import email.utils
from types import TracebackType
from random import random
from typing import (
    TYPE_CHECKING,
    Any,
    Dict,
    List,
    Type,
    Tuple,
    Union,
    Generic,
    Mapping,
    TypeVar,
    Iterable,
    Iterator,
    Optional,
    Generator,
    AsyncIterator,
    cast,
    overload,
)
from typing_extensions import Literal, override, get_origin

import anyio
import httpx
import distro
import pydantic
from httpx import URL, Proxy, HTTPTransport, AsyncHTTPTransport
from pydantic import PrivateAttr

from . import _exceptions
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
    Body,
    Omit,
    Query,
    Headers,
    Timeout,
    NotGiven,
    ResponseT,
    AnyMapping,
    PostParser,
    BinaryTypes,
    RequestFiles,
    HttpxSendArgs,
// ... (2208 more lines)

Subdomains

Frequently Asked Questions

What does _base_client.py do?
_base_client.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, AsyncAPI subdomain.
What functions are defined in _base_client.py?
_base_client.py defines 12 function(s): DefaultAsyncHttpxClient, DefaultHttpxClient, _DefaultAioHttpClient, _merge_mappings, get_architecture, get_platform, get_python_runtime, get_python_version, httpx, httpx_aiohttp, and 2 more.
What does _base_client.py depend on?
_base_client.py imports 65 module(s): APIConnectionError, APIResponse, APIResponseValidationError, APIStatusError, APITimeoutError, AsyncAPIResponse, AsyncStream, BaseAPIResponse, and 57 more.
What files import _base_client.py?
_base_client.py is imported by 7 file(s): __init__.py, _client.py, _legacy_response.py, _resource.py, _response.py, _streaming.py, pagination.py.
Where is _base_client.py in the architecture?
_base_client.py is located at src/anthropic/_base_client.py (domain: AnthropicClient, subdomain: AsyncAPI, directory: src/anthropic).

Analyze Your Own Codebase

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

Try Supermodel Free