langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
35.33k stars 4.21k forks source link

the Directory plugin is not working in DS Langflow #4396

Open fanimali opened 2 weeks ago

fanimali commented 2 weeks ago

Bug Description

I am trying to read files from a directory, using the Data>Directory plugin, in Datastax Astra Langflow.

The Directory plugin doesn't do anything when the user clicks on the Path box.

In theory, one expects that a filw browser opens and allows the user to choose a directory on the local filesystem, like it is the OSS Langflow.

Can you please comment if this plugin should work like in the OSS Langflow or not? image

Reproduction

  1. open Langflow on Datastax Astra portal.
  2. open a generic flow or create a new one
  3. drag in the Data>Directory plugin and try to read files from a directory.

Expected behavior

the Directory plugin should allow users to import files from a dir

Who can help?

No response

Operating System

ASTRA

Langflow Version

1.0.9-post1

Python Version

None

Screenshot

image

Flow File

No response

dosubot[bot] commented 2 weeks ago

The Directory plugin in the OSS Langflow version is designed to recursively load files from a specified directory, allowing users to specify the directory path, file types, search depth, and other parameters [1]. However, there is no specific information available about how this plugin should behave in the Datastax Astra environment or if there are any known limitations or differences in its functionality compared to the OSS version [2].

If the Directory plugin is not opening a file browser in the Datastax Astra environment, it might be due to platform-specific restrictions or differences in how file system access is handled. Unfortunately, without specific documentation or code comments addressing this behavior in cloud environments like Datastax Astra, it's challenging to provide a definitive answer [2].

If this functionality is critical, you might need to explore alternative methods for file selection or consult any available documentation specific to the Datastax Astra environment for Langflow.

To continue talking to Dosu, mention @dosu.

erichare commented 2 weeks ago

@fanimali this is a great point - I'm working on improvements to the File Component, that allow uploading a zip and recursively parsing the zip. I think this is a good workaround right now (this is already merged into GitHub).

The directory component will likely be retired... the basic issue is it requires a path, but the path is a string - and relative to the machine Langflow is running on. As you noted. The file component will take its place. Now, you're right however that the ideal UI would not be uploading a zip, but allowing selection of a directory. With that in mind, there still needs to be UI work to allow that - the zip solution is somewhat of a workaround.

TLDR:

  1. Current workaround - upload a zip with the new file component, and all files will be recursively processed.
  2. Pending improvement - allow multiselect / uploading of a directory in the file component

Once #2 is complete, i think we can deprecate / remove the directory component.