Home / Function/ patch() — anthropic-sdk-python Function Reference

patch() — anthropic-sdk-python Function Reference

Architecture documentation for the patch() function in _base_client.py from the anthropic-sdk-python codebase.

Function python AnthropicClient AsyncAPI calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  e5242aaa_095d_25da_f39e_7db21a476f1e["patch()"]
  3224f719_8046_78c8_59e1_47301a46ddd4["AsyncAPIClient"]
  e5242aaa_095d_25da_f39e_7db21a476f1e -->|defined in| 3224f719_8046_78c8_59e1_47301a46ddd4
  d930ee05_6ad8_f29b_14ca_02564abee461["patch()"]
  d930ee05_6ad8_f29b_14ca_02564abee461 -->|calls| e5242aaa_095d_25da_f39e_7db21a476f1e
  d930ee05_6ad8_f29b_14ca_02564abee461["patch()"]
  e5242aaa_095d_25da_f39e_7db21a476f1e -->|calls| d930ee05_6ad8_f29b_14ca_02564abee461
  41e4dab8_bf10_15e9_1d57_2ba669f0414a["async_to_httpx_files()"]
  e5242aaa_095d_25da_f39e_7db21a476f1e -->|calls| 41e4dab8_bf10_15e9_1d57_2ba669f0414a
  4e74c968_63fc_ca6c_ccf4_c01326e7060e["construct()"]
  e5242aaa_095d_25da_f39e_7db21a476f1e -->|calls| 4e74c968_63fc_ca6c_ccf4_c01326e7060e
  c21c2971_d83f_0afc_9811_0642b34cfcd3["request()"]
  e5242aaa_095d_25da_f39e_7db21a476f1e -->|calls| c21c2971_d83f_0afc_9811_0642b34cfcd3
  style e5242aaa_095d_25da_f39e_7db21a476f1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_base_client.py lines 1994–2023

    async def patch(
        self,
        path: str,
        *,
        cast_to: Type[ResponseT],
        body: Body | None = None,
        content: AsyncBinaryTypes | None = None,
        files: RequestFiles | None = None,
        options: RequestOptions = {},
    ) -> ResponseT:
        if body is not None and content is not None:
            raise TypeError("Passing both `body` and `content` is not supported")
        if files is not None and content is not None:
            raise TypeError("Passing both `files` and `content` is not supported")
        if isinstance(body, bytes):
            warnings.warn(
                "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
                "Please pass raw bytes via the `content` parameter instead.",
                DeprecationWarning,
                stacklevel=2,
            )
        opts = FinalRequestOptions.construct(
            method="patch",
            url=path,
            json_data=body,
            content=content,
            files=await async_to_httpx_files(files),
            **options,
        )
        return await self.request(cast_to, opts)

Subdomains

Called By

Frequently Asked Questions

What does patch() do?
patch() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_base_client.py.
Where is patch() defined?
patch() is defined in src/anthropic/_base_client.py at line 1994.
What does patch() call?
patch() calls 4 function(s): async_to_httpx_files, construct, patch, request.
What calls patch()?
patch() is called by 1 function(s): patch.

Analyze Your Own Codebase

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

Try Supermodel Free