Name and Version
latest
What is the problem this feature will solve?
FileDownloadResponse should expose HTTP response metadata such as headers and content type through public accessors.
What is the feature you are proposing to solve the problem?
Motivation
Consumers sometimes need the downloaded file content together with response metadata. In StatGPT Backend we need to return file bytes together with the Content-Type header.
At the moment, this requires accessing a private field:
download = await async_client.files.download(url)
content = await download.aget_content()
content_type = download._response.headers.get("content-type", "application/octet-stream")
This works, but it depends on an internal implementation detail.
Proposed API
Add one or more public accessors to FileDownloadResponse, for example:
@property
def headers(self) -> httpx.Headers: ...
@property
def content_type(self) -> str | None: ...
Use Case
StatGPT Backend currently wraps DIAL file downloads in a helper that returns (content, content_type). Without a public metadata accessor, fully migrating to aidial-client still requires private _response access.
What alternatives have you considered?
No response
Name and Version
latest
What is the problem this feature will solve?
FileDownloadResponseshould expose HTTP response metadata such as headers and content type through public accessors.What is the feature you are proposing to solve the problem?
Motivation
Consumers sometimes need the downloaded file content together with response metadata. In StatGPT Backend we need to return file bytes together with the
Content-Typeheader.At the moment, this requires accessing a private field:
This works, but it depends on an internal implementation detail.
Proposed API
Add one or more public accessors to
FileDownloadResponse, for example:Use Case
StatGPT Backend currently wraps DIAL file downloads in a helper that returns
(content, content_type). Without a public metadata accessor, fully migrating toaidial-clientstill requires private_responseaccess.What alternatives have you considered?
No response