feat: rag md support

This commit is contained in:
Timothy J. Baek 2024-01-09 15:24:53 -08:00
parent 358f79f533
commit c1ec604f21
4 changed files with 22 additions and 1 deletions

View file

@ -149,9 +149,13 @@
if (inputFiles && inputFiles.length > 0) {
const file = inputFiles[0];
console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
reader.readAsDataURL(file);
} else if (SUPPORTED_FILE_TYPE.includes(file['type'])) {
} else if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
['md'].includes(file.name.split('.').at(-1))
) {
uploadDoc(file);
} else {
toast.error(`Unsupported File Type '${file['type']}'.`);

View file

@ -14,6 +14,7 @@ export const REQUIRED_OLLAMA_VERSION = '0.1.16';
export const SUPPORTED_FILE_TYPE = [
'application/pdf',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'text/markdown',
'text/plain',
'text/csv'
];