mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
💻 fix(client): Allow Code Filetypes and Suppress Known Vite Warnings (#2492)
* refactor(vite): suppress known warnings * fix: allow known code filetypes if there is a mismatch of expected type, or originalFile.type is empty * refactor(useFileHandling): naming, use variable
This commit is contained in:
parent
738207de50
commit
f94a782b4f
4 changed files with 55 additions and 10 deletions
|
|
@ -127,8 +127,24 @@ export const codeInterpreterMimeTypes = [
|
|||
imageMimeTypes,
|
||||
];
|
||||
|
||||
export const codeTypeMapping: { [key: string]: string } = {
|
||||
c: 'text/x-c',
|
||||
cs: 'text/x-csharp',
|
||||
cpp: 'text/x-c++',
|
||||
md: 'text/markdown',
|
||||
php: 'text/x-php',
|
||||
py: 'text/x-python',
|
||||
rb: 'text/x-ruby',
|
||||
tex: 'text/x-tex',
|
||||
js: 'text/javascript',
|
||||
sh: 'application/x-sh',
|
||||
ts: 'application/typescript',
|
||||
tar: 'application/x-tar',
|
||||
zip: 'application/zip',
|
||||
};
|
||||
|
||||
export const retrievalMimeTypes = [
|
||||
/^(text\/(x-c|x-c\+\+|html|x-java|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain))$/,
|
||||
/^(text\/(x-c|x-c\+\+|html|x-java|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|xml))$/,
|
||||
/^(application\/(json|pdf|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.presentation)))$/,
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue