Skip to content

Commit 14e4941

Browse files
maxessedustinhealy
andauthored
📎 fix: Document Uploads for Custom Endpoints (danny-avila#10336)
* Fixed upload to provider for custom endpoints + unit tests * fix: add support back for agents to be able to use Upload to Provider with supported providers * ci: add test for agents endpoint still recognizing document supported providers * chore: address ESLint suggestions * Improved unit tests * Linting error on unit tests fixed --------- Co-authored-by: Dustin Healy <dustinhealy1@gmail.com>
1 parent ce7e6ed commit 14e4941

4 files changed

Lines changed: 728 additions & 3 deletions

File tree

client/src/components/Chat/Input/Files/AttachFileMenu.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ const AttachFileMenu = ({
117117
const items: MenuItemProps[] = [];
118118

119119
const currentProvider = provider || endpoint;
120-
121-
if (isDocumentSupportedProvider(currentProvider || endpointType)) {
120+
if (
121+
isDocumentSupportedProvider(endpointType) ||
122+
isDocumentSupportedProvider(currentProvider)
123+
) {
122124
items.push({
123125
label: localize('com_ui_upload_provider'),
124126
onClick: () => {

client/src/components/Chat/Input/Files/DragDropModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const DragDropModal = ({ onOptionSelect, setShowModal, files, isVisible }: DragD
5757
const currentProvider = provider || endpoint;
5858

5959
// Check if provider supports document upload
60-
if (isDocumentSupportedProvider(currentProvider || endpointType)) {
60+
if (isDocumentSupportedProvider(endpointType) || isDocumentSupportedProvider(currentProvider)) {
6161
const isGoogleProvider = currentProvider === EModelEndpoint.google;
6262
const validFileTypes = isGoogleProvider
6363
? files.every(

0 commit comments

Comments
 (0)