mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-02 08:38:51 +01:00
🗂️ feat: Send Attachments Directly to Provider (Google) (#9100)
* feat: add validation for google PDFs and add google endpoint as a document supporting endpoint * feat: add proper pdf formatting for google endpoints (requires PR #14 in agents) * feat: add multimodal support for google endpoint attachments * feat: add audio file svg * fix: refactor attachments logic so multi-attachment messages work properly * feat: add video file svg * fix: allows for followup questions of uploaded multimodal attachments * fix: remove incorrect final message filtering that was breaking Attachment component rendering
This commit is contained in:
parent
b5aadf1302
commit
aae47e7b3f
13 changed files with 581 additions and 15 deletions
|
|
@ -88,6 +88,8 @@ const AttachFileMenu = ({
|
|||
inputRef.current.accept = '.pdf,application/pdf';
|
||||
} else if (fileType === 'multimodal') {
|
||||
inputRef.current.accept = 'image/*,.pdf,application/pdf';
|
||||
} else if (fileType === 'google_multimodal') {
|
||||
inputRef.current.accept = 'image/*,.pdf,application/pdf,video/*,audio/*';
|
||||
} else {
|
||||
inputRef.current.accept = '';
|
||||
}
|
||||
|
|
@ -97,7 +99,7 @@ const AttachFileMenu = ({
|
|||
|
||||
const dropdownItems = useMemo(() => {
|
||||
const createMenuItems = (
|
||||
onAction: (fileType?: 'image' | 'document' | 'multimodal') => void,
|
||||
onAction: (fileType?: 'image' | 'document' | 'multimodal' | 'google_multimodal') => void,
|
||||
) => {
|
||||
const items: MenuItemProps[] = [];
|
||||
|
||||
|
|
@ -108,7 +110,7 @@ const AttachFileMenu = ({
|
|||
label: localize('com_ui_upload_provider'),
|
||||
onClick: () => {
|
||||
setToolResource(EToolResources.direct_attach);
|
||||
onAction('multimodal');
|
||||
onAction(endpoint === EModelEndpoint.google ? 'google_multimodal' : 'multimodal');
|
||||
},
|
||||
icon: <FileImageIcon className="icon-md" />,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
import { SheetPaths, TextPaths, FilePaths, CodePaths } from '@librechat/client';
|
||||
import {
|
||||
SheetPaths,
|
||||
TextPaths,
|
||||
FilePaths,
|
||||
CodePaths,
|
||||
AudioPaths,
|
||||
VideoPaths,
|
||||
} from '@librechat/client';
|
||||
import {
|
||||
megabyte,
|
||||
QueryKeys,
|
||||
|
|
@ -38,6 +45,18 @@ const artifact = {
|
|||
title: 'Code',
|
||||
};
|
||||
|
||||
const audioFile = {
|
||||
paths: AudioPaths,
|
||||
fill: '#FF6B35',
|
||||
title: 'Audio',
|
||||
};
|
||||
|
||||
const videoFile = {
|
||||
paths: VideoPaths,
|
||||
fill: '#8B5CF6',
|
||||
title: 'Video',
|
||||
};
|
||||
|
||||
export const fileTypes = {
|
||||
/* Category matches */
|
||||
file: {
|
||||
|
|
@ -47,6 +66,8 @@ export const fileTypes = {
|
|||
},
|
||||
text: textDocument,
|
||||
txt: textDocument,
|
||||
audio: audioFile,
|
||||
video: videoFile,
|
||||
// application:,
|
||||
|
||||
/* Partial matches */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue