Skip to content

fix: add supported file loaders to detect the override file from upsert API#6375

Open
prd-hoang-doan wants to merge 1 commit into
FlowiseAI:mainfrom
prd-hoang-doan:fix/6102_file_loader_upsert_api
Open

fix: add supported file loaders to detect the override file from upsert API#6375
prd-hoang-doan wants to merge 1 commit into
FlowiseAI:mainfrom
prd-hoang-doan:fix/6102_file_loader_upsert_api

Conversation

@prd-hoang-doan
Copy link
Copy Markdown
Contributor

Issue:

Root Cause:

  • Pull Request: Fix Paramater Override Bypass #5667
  • Although the user enable override configuration on File Loader, but they can use the file from request to upsert data into vector db.
image

Changes

  • Add SUPPORTED_FILE_LOADERS (source) to detect the overrideConfig from API: vector/upsert/:uuid
  • Get the latest file from overrideConfig instead of using the default file name in Chatflow in Upsert History

Testing

  • Creating the Chatflow with initial file (test3.docx)
  • Using Upsert API to upload another (test.docx)
create_and_upsert_chatflow.mov
  • Verify the Upsert History
check_upsert_history.mov

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a list of supported file loaders and updates the server utilities to handle file storage overrides during the upsert process. It includes logic to correctly identify filenames from overrides and maps specific file loader parameters to a generic 'files' key for override validation. Feedback indicates that the node type check for file loaders is too restrictive and should be expanded to include specific file types like 'Pdf File'. Furthermore, several naming inconsistencies were identified in the SUPPORTED_FILE_LOADERS list that need to be aligned with the document loader components to ensure overrides function correctly for all file types.

Comment thread packages/server/src/utils/index.ts
Comment thread packages/server/src/utils/constants.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant