Replies: 2 comments 8 replies
-
To provide a directory path to a variable in a custom component, you can use the from langflow.custom.custom_component.custom_component import CustomComponent
# Create an instance of the CustomComponent
custom_component = CustomComponent()
# Define the directory path
directory_path = "/path/to/your/directory"
# Resolve the directory path
resolved_path = custom_component.resolve_path(directory_path)
# Use the resolved path as needed
print(resolved_path) In this example, the Additionally, if you are working with a from langflow.components.documentloaders.DirectoryLoader import DirectoryLoaderComponent
# Create an instance of the DirectoryLoaderComponent
directory_loader_component = DirectoryLoaderComponent()
# Define the directory path and other parameters
directory_path = "/path/to/your/directory"
glob_pattern = "**/*.txt"
max_concurrency = 4
load_hidden = False
recursive = True
silent_errors = False
use_multithreading = True
# Use the build method to process the directory
loaded_records = directory_loader_component.build(
glob=glob_pattern,
path=directory_path,
max_concurrency=max_concurrency,
load_hidden=load_hidden,
recursive=recursive,
silent_errors=silent_errors,
use_multithreading=use_multithreading
)
# Use the loaded records as needed
print(loaded_records) In this extended example, the |
Beta Was this translation helpful? Give feedback.
-
Hi! 👋 We are using other channels as our official means of communication with users. We apologize for the delayed response. Thank you for your understanding. Best regards, |
Beta Was this translation helpful? Give feedback.
-
While creating a custom component how can I provide a directory path to a variable
Beta Was this translation helpful? Give feedback.
All reactions