fix: reference file with 'docx' type can not open #844 (#1635)

### What problem does this PR solve?

fix: reference file with 'docx' type can not open #844

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-22 15:54:15 +08:00
committed by GitHub
parent 29a7b7a040
commit cf12c3cc1f
6 changed files with 52 additions and 24 deletions

View File

@ -1,3 +1,4 @@
import { SupportedPreviewDocumentTypes } from '@/constants/common';
import { IChunk } from '@/interfaces/database/knowledge';
import { UploadFile } from 'antd';
import { v4 as uuid } from 'uuid';
@ -46,3 +47,7 @@ export const isPdf = (name: string) => {
export const getUnSupportedFilesCount = (message: string) => {
return message.split('\n').length;
};
export const isSupportedPreviewDocumentType = (fileExtension: string) => {
return SupportedPreviewDocumentTypes.includes(fileExtension);
};