MCPcopy
hub / github.com/anthropics/anthropic-sdk-python / patch

Method patch

src/anthropic/_base_client.py:1538–1562  ·  view source on GitHub ↗
(
        self,
        path: str,
        *,
        cast_to: Type[ResponseT],
        body: Body | None = None,
        content: BinaryTypes | None = None,
        files: RequestFiles | None = None,
        options: RequestOptions = {},
    )

Source from the content-addressed store, hash-verified

1536 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
1537
1538 def patch(
1539 self,
1540 path: str,
1541 *,
1542 cast_to: Type[ResponseT],
1543 body: Body | None = None,
1544 content: BinaryTypes | None = None,
1545 files: RequestFiles | None = None,
1546 options: RequestOptions = {},
1547 ) -> ResponseT:
1548 if body is not None and content is not None:
1549 raise TypeError("Passing both `body` and `content` is not supported")
1550 if files is not None and content is not None:
1551 raise TypeError("Passing both `files` and `content` is not supported")
1552 if isinstance(body, bytes):
1553 warnings.warn(
1554 "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1555 "Please pass raw bytes via the `content` parameter instead.",
1556 DeprecationWarning,
1557 stacklevel=2,
1558 )
1559 opts = FinalRequestOptions.construct(
1560 method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1561 )
1562 return self.request(cast_to, opts)
1563
1564 def put(
1565 self,

Callers 2

test_validate_headersMethod · 0.45
test_validate_headersMethod · 0.45

Calls 3

requestMethod · 0.95
to_httpx_filesFunction · 0.85
constructMethod · 0.45

Tested by 2

test_validate_headersMethod · 0.36
test_validate_headersMethod · 0.36