__init__() — anthropic-sdk-python Function Reference
Architecture documentation for the __init__() function in _client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD d29c8920_0fbf_b030_6f1b_87922ee2648a["__init__()"] 5fb2d3b6_3351_6580_364d_089a42b38b46["AnthropicVertex"] d29c8920_0fbf_b030_6f1b_87922ee2648a -->|defined in| 5fb2d3b6_3351_6580_364d_089a42b38b46 style d29c8920_0fbf_b030_6f1b_87922ee2648a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/vertex/_client.py lines 94–144
def __init__(
self,
*,
region: str | NotGiven = NOT_GIVEN,
project_id: str | NotGiven = NOT_GIVEN,
access_token: str | None = None,
credentials: GoogleCredentials | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
# Configure a custom httpx client. See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details.
http_client: httpx.Client | None = None,
_strict_response_validation: bool = False,
) -> None:
if not is_given(region):
region = os.environ.get("CLOUD_ML_REGION", NOT_GIVEN)
if not is_given(region):
raise ValueError(
"No region was given. The client should be instantiated with the `region` argument or the `CLOUD_ML_REGION` environment variable should be set."
)
if base_url is None:
base_url = os.environ.get("ANTHROPIC_VERTEX_BASE_URL")
if base_url is None:
if region == "global":
base_url = "https://aiplatform.googleapis.com/v1"
else:
base_url = f"https://{region}-aiplatform.googleapis.com/v1"
super().__init__(
version=__version__,
base_url=base_url,
timeout=timeout,
max_retries=max_retries,
custom_headers=default_headers,
custom_query=default_query,
http_client=http_client,
_strict_response_validation=_strict_response_validation,
)
if is_given(project_id):
self.project_id = project_id
self.region = region
self.access_token = access_token
self.credentials = credentials
self.messages = Messages(self)
self.beta = Beta(self)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does __init__() do?
__init__() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/vertex/_client.py.
Where is __init__() defined?
__init__() is defined in src/anthropic/lib/vertex/_client.py at line 94.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free