From 5d267aa8e26679be408cde3661c6bd2b0c3fcb6b Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Tue, 1 Jul 2025 22:36:29 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=80=20fix:=20Assistants=20API=20File?= =?UTF-8?q?=20Attachments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Chat/Input/Files/AttachFileChat.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/Chat/Input/Files/AttachFileChat.tsx b/client/src/components/Chat/Input/Files/AttachFileChat.tsx index d49230ff89..6bdecca22a 100644 --- a/client/src/components/Chat/Input/Files/AttachFileChat.tsx +++ b/client/src/components/Chat/Input/Files/AttachFileChat.tsx @@ -4,18 +4,21 @@ import { supportsFiles, mergeFileConfig, isAgentsEndpoint, + isAssistantsEndpoint, fileConfig as defaultFileConfig, } from 'librechat-data-provider'; import type { EndpointFileConfig } from 'librechat-data-provider'; import { useGetFileConfig } from '~/data-provider'; import AttachFileMenu from './AttachFileMenu'; import { useChatContext } from '~/Providers'; +import AttachFile from './AttachFile'; function AttachFileChat({ disableInputs }: { disableInputs: boolean }) { const { conversation } = useChatContext(); const conversationId = conversation?.conversationId ?? Constants.NEW_CONVO; const { endpoint, endpointType } = conversation ?? { endpoint: null }; const isAgents = useMemo(() => isAgentsEndpoint(endpoint), [endpoint]); + const isAssistants = useMemo(() => isAssistantsEndpoint(endpoint), [endpoint]); const { data: fileConfig = defaultFileConfig } = useGetFileConfig({ select: (data) => mergeFileConfig(data), @@ -25,7 +28,9 @@ function AttachFileChat({ disableInputs }: { disableInputs: boolean }) { const endpointSupportsFiles: boolean = supportsFiles[endpointType ?? endpoint ?? ''] ?? false; const isUploadDisabled = (disableInputs || endpointFileConfig?.disabled) ?? false; - if (isAgents || (endpointSupportsFiles && !isUploadDisabled)) { + if (isAssistants && endpointSupportsFiles && !isUploadDisabled) { + return ; + } else if (isAgents || (endpointSupportsFiles && !isUploadDisabled)) { return ( ); } - return null; }