feat: Supports chatting with files/images #1880 (#1943)

### What problem does this PR solve?

feat: Supports chatting with files/images #1880

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-14 17:26:47 +08:00
committed by GitHub
parent 78ed8fe9a5
commit a3a5a9966f
17 changed files with 487 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import { SupportedPreviewDocumentTypes } from '@/constants/common';
import { Images, SupportedPreviewDocumentTypes } from '@/constants/common';
import { IChunk } from '@/interfaces/database/knowledge';
import { UploadFile } from 'antd';
import { v4 as uuid } from 'uuid';
@ -51,3 +51,7 @@ export const getUnSupportedFilesCount = (message: string) => {
export const isSupportedPreviewDocumentType = (fileExtension: string) => {
return SupportedPreviewDocumentTypes.includes(fileExtension);
};
export const isImage = (image: string) => {
return [...Images, 'svg'].some((x) => x === image);
};