Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 3.42 KB

File metadata and controls

58 lines (38 loc) · 3.42 KB

Chat

Overview

Available Operations

getChatFile

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

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetChatFileResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        GetChatFileResponse res = sdk.chat().getChatFile()
                .fileId("<id>")
                .call();

        if (res.responseStream().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
fileId String ✔️ Identifier of the chat file to download.
preview Optional<Boolean> When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment.

Response

GetChatFileResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*