Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 3.4 KB

File metadata and controls

49 lines (30 loc) · 3.4 KB

Chat

Overview

Available Operations

get_chat_file

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.

Example Usage

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)

Parameters

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.

Response

httpx.Response

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*