copy() — anthropic-sdk-python Function Reference
Architecture documentation for the copy() function in _client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 36d0becb_82f8_5e48_ffe9_ad9bc847f367["copy()"] a885dabd_0206_9ba5_949f_5990703d0a04["AsyncAnthropicVertex"] 36d0becb_82f8_5e48_ffe9_ad9bc847f367 -->|defined in| a885dabd_0206_9ba5_949f_5990703d0a04 b236dbaf_763e_a93f_2228_184f29f8884a["copy()"] b236dbaf_763e_a93f_2228_184f29f8884a -->|calls| 36d0becb_82f8_5e48_ffe9_ad9bc847f367 b236dbaf_763e_a93f_2228_184f29f8884a["copy()"] 36d0becb_82f8_5e48_ffe9_ad9bc847f367 -->|calls| b236dbaf_763e_a93f_2228_184f29f8884a style 36d0becb_82f8_5e48_ffe9_ad9bc847f367 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/vertex/_client.py lines 321–373
def copy(
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,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
set_default_query: Mapping[str, object] | None = None,
_extra_kwargs: Mapping[str, Any] = {},
) -> Self:
"""
Create a new client instance re-using the same options given to the current client with optional overriding.
"""
if default_headers is not None and set_default_headers is not None:
raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive")
if default_query is not None and set_default_query is not None:
raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive")
headers = self._custom_headers
if default_headers is not None:
headers = {**headers, **default_headers}
elif set_default_headers is not None:
headers = set_default_headers
params = self._custom_query
if default_query is not None:
params = {**params, **default_query}
elif set_default_query is not None:
params = set_default_query
http_client = http_client or self._client
return self.__class__(
region=region if is_given(region) else self.region,
project_id=project_id if is_given(project_id) else self.project_id or NOT_GIVEN,
access_token=access_token or self.access_token,
credentials=credentials or self.credentials,
base_url=base_url or self.base_url,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
http_client=http_client,
max_retries=max_retries if is_given(max_retries) else self.max_retries,
default_headers=headers,
default_query=params,
**_extra_kwargs,
)
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does copy() do?
copy() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/vertex/_client.py.
Where is copy() defined?
copy() is defined in src/anthropic/lib/vertex/_client.py at line 321.
What does copy() call?
copy() calls 1 function(s): copy.
What calls copy()?
copy() is called by 1 function(s): copy.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free