diff --git a/web/screens/Chat/ChatInput/index.tsx b/web/screens/Chat/ChatInput/index.tsx index 052720d6c..a7985a59c 100644 --- a/web/screens/Chat/ChatInput/index.tsx +++ b/web/screens/Chat/ChatInput/index.tsx @@ -165,8 +165,7 @@ const ChatInput: React.FC = () => { if ( fileUpload.length > 0 || (activeThread?.assistants[0].tools && - !activeThread?.assistants[0].tools[0]?.enabled && - !activeThread?.assistants[0].model.settings.vision_model) + !activeThread?.assistants[0].tools[0]?.enabled) ) { e.stopPropagation() } else { @@ -178,8 +177,7 @@ const ChatInput: React.FC = () => { {fileUpload.length > 0 || (activeThread?.assistants[0].tools && - !activeThread?.assistants[0].tools[0]?.enabled && - !activeThread?.assistants[0].model.settings.vision_model && ( + !activeThread?.assistants[0].tools[0]?.enabled && ( {fileUpload.length !== 0 && ( @@ -205,7 +203,7 @@ const ChatInput: React.FC = () => { {showAttacmentMenus && (
  • { const isGeneratingResponse = useAtomValue(isGeneratingResponseAtom) + const acceptedFormat: Accept = activeThread?.assistants[0].model.settings + .vision_model + ? { + 'application/pdf': ['.pdf'], + 'image/jpeg': ['.jpeg'], + 'image/png': ['.png'], + 'image/jpg': ['.jpg'], + } + : { + 'application/pdf': ['.pdf'], + } + const { getRootProps, isDragReject } = useDropzone({ noClick: true, multiple: false, - accept: { - 'application/pdf': ['.pdf'], - }, + accept: acceptedFormat, onDragOver: (e) => { // Retrieval file drag and drop is experimental feature @@ -164,10 +174,21 @@ const ChatScreen: React.FC = () => {
    {isDragReject - ? 'Currently, we only support 1 attachment at the same time with PDF format' + ? `Currently, we only support 1 attachment at the same time with ${ + activeThread?.assistants[0].model.settings + .vision_model + ? 'PDF, JPEG, JPG, PNG' + : 'PDF' + } format` : 'Drop file here'}
    - {!isDragReject &&

    (PDF)

    } + {!isDragReject && ( +

    + {activeThread?.assistants[0].model.settings.vision_model + ? 'PDF, JPEG, JPG, PNG' + : 'PDF'} +

    + )}