MCPcopy
hub / github.com/openai/openai-python / patch

Method patch

src/openai/_base_client.py:1933–1962  ·  src/openai/_base_client.py::AsyncAPIClient.patch
(
        self,
        path: str,
        *,
        cast_to: Type[ResponseT],
        body: Body | None = None,
        content: AsyncBinaryTypes | None = None,
        files: RequestFiles | None = None,
        options: RequestOptions = {},
    )

Source from the content-addressed store, hash-verified

1931 return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
1932
1933 async def patch(
1934 self,
1935 path: str,
1936 *,
1937 cast_to: Type[ResponseT],
1938 body: Body | None = None,
1939 content: AsyncBinaryTypes | None = None,
1940 files: RequestFiles | None = None,
1941 options: RequestOptions = {},
1942 ) -> ResponseT:
1943 if body is not None and content is not None:
1944 raise TypeError(class="st">"Passing both `body` and `content` is not supported")
1945 if files is not None and content is not None:
1946 raise TypeError(class="st">"Passing both `files` and `content` is not supported")
1947 if isinstance(body, bytes):
1948 warnings.warn(
1949 class="st">"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1950 class="st">"Please pass raw bytes via the `content` parameter instead.",
1951 DeprecationWarning,
1952 stacklevel=2,
1953 )
1954 opts = FinalRequestOptions.construct(
1955 method=class="st">"patch",
1956 url=path,
1957 json_data=body,
1958 content=content,
1959 files=await async_to_httpx_files(files),
1960 **options,
1961 )
1962 return await self.request(cast_to, opts)
1963
1964 async def put(
1965 self,

Callers

nothing calls this directly

Calls 3

requestMethod · 0.95
async_to_httpx_filesFunction · 0.85
constructMethod · 0.45

Tested by

no test coverage detected