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

Method patch

src/openai/_base_client.py:1334–1358  ·  src/openai/_base_client.py::SyncAPIClient.patch
(
        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

1332 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
1333
1334 def patch(
1335 self,
1336 path: str,
1337 *,
1338 cast_to: Type[ResponseT],
1339 body: Body | None = None,
1340 content: BinaryTypes | None = None,
1341 files: RequestFiles | None = None,
1342 options: RequestOptions = {},
1343 ) -> ResponseT:
1344 if body is not None and content is not None:
1345 raise TypeError(class="st">"Passing both `body` and `content` is not supported")
1346 if files is not None and content is not None:
1347 raise TypeError(class="st">"Passing both `files` and `content` is not supported")
1348 if isinstance(body, bytes):
1349 warnings.warn(
1350 class="st">"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1351 class="st">"Please pass raw bytes via the `content` parameter instead.",
1352 DeprecationWarning,
1353 stacklevel=2,
1354 )
1355 opts = FinalRequestOptions.construct(
1356 method=class="st">"patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1357 )
1358 return self.request(cast_to, opts)
1359
1360 def put(
1361 self,

Callers

nothing calls this directly

Calls 3

requestMethod · 0.95
to_httpx_filesFunction · 0.85
constructMethod · 0.45

Tested by

no test coverage detected