mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
🔧 fix: Improve Assistants File Citation & Download Handling (#2248)
* fix(processMessages): properly handle assistant file citations and add sources list * feat: improve file download UX by making any downloaded files accessible within the app post-download * refactor(processOpenAIImageOutput): correctly handle two different outputs for images since OpenAI generates a file in their storage, shares filepath for image rendering * refactor: create `addFileToCache` helper to use across frontend * refactor: add ImageFile parts to cache on processing content stream
This commit is contained in:
parent
bc2a628902
commit
6a6b2e79b0
11 changed files with 142 additions and 57 deletions
|
|
@ -6,6 +6,7 @@ import * as t from './types';
|
|||
import * as s from './schemas';
|
||||
import request from './request';
|
||||
import * as endpoints from './api-endpoints';
|
||||
import type { AxiosResponse } from 'axios';
|
||||
|
||||
export function abortRequestWithMessage(
|
||||
endpoint: string,
|
||||
|
|
@ -201,9 +202,9 @@ export const uploadAssistantAvatar = (data: m.AssistantAvatarVariables): Promise
|
|||
);
|
||||
};
|
||||
|
||||
export const getFileDownload = async (userId: string, filepath: string): Promise<Blob> => {
|
||||
export const getFileDownload = async (userId: string, filepath: string): Promise<AxiosResponse> => {
|
||||
const encodedFilePath = encodeURIComponent(filepath);
|
||||
return request.get(`${endpoints.files()}/download/${userId}/${encodedFilePath}`, {
|
||||
return request.getResponse(`${endpoints.files()}/download/${userId}/${encodedFilePath}`, {
|
||||
responseType: 'blob',
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue