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

Method put

src/openai/_base_client.py:1360–1384  ·  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

1358 return self.request(cast_to, opts)
1359
1360 def put(
1361 self,
1362 path: str,
1363 *,
1364 cast_to: Type[ResponseT],
1365 body: Body | None = None,
1366 content: BinaryTypes | None = None,
1367 files: RequestFiles | None = None,
1368 options: RequestOptions = {},
1369 ) -> ResponseT:
1370 if body is not None and content is not None:
1371 raise TypeError("Passing both `body` and `content` is not supported")
1372 if files is not None and content is not None:
1373 raise TypeError("Passing both `files` and `content` is not supported")
1374 if isinstance(body, bytes):
1375 warnings.warn(
1376 "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1377 "Please pass raw bytes via the `content` parameter instead.",
1378 DeprecationWarning,
1379 stacklevel=2,
1380 )
1381 opts = FinalRequestOptions.construct(
1382 method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1383 )
1384 return self.request(cast_to, opts)
1385
1386 def delete(
1387 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