Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.chat.get_chat_file(file_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
file_id |
str |
✔️ |
Identifier of the chat file to download. |
preview |
Optional[bool] |
➖ |
When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment.
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
httpx.Response
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |