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.
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
}
}
}
| 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.
|
GetChatFileResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |