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

Method put

src/openai/_base_client.py:1964–1988  ·  src/openai/_base_client.py::AsyncAPIClient.put
(
        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

1962 return await self.request(cast_to, opts)
1963
1964 async def put(
1965 self,
1966 path: str,
1967 *,
1968 cast_to: Type[ResponseT],
1969 body: Body | None = None,
1970 content: AsyncBinaryTypes | None = None,
1971 files: RequestFiles | None = None,
1972 options: RequestOptions = {},
1973 ) -> ResponseT:
1974 if body is not None and content is not None:
1975 raise TypeError(class="st">"Passing both `body` and `content` is not supported")
1976 if files is not None and content is not None:
1977 raise TypeError(class="st">"Passing both `files` and `content` is not supported")
1978 if isinstance(body, bytes):
1979 warnings.warn(
1980 class="st">"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1981 class="st">"Please pass raw bytes via the `content` parameter instead.",
1982 DeprecationWarning,
1983 stacklevel=2,
1984 )
1985 opts = FinalRequestOptions.construct(
1986 method=class="st">"put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1987 )
1988 return await self.request(cast_to, opts)
1989
1990 async def delete(
1991 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